add operator << for Packet and TraceContext
This commit is contained in:
@@ -199,6 +199,12 @@ Packet::Deserialize (Buffer buffer)
|
||||
buffer.RemoveAtStart (metadataDeserialized);
|
||||
}
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const Packet &packet)
|
||||
{
|
||||
packet.Print (os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
|
||||
@@ -328,6 +328,8 @@ private:
|
||||
static uint32_t m_globalUid;
|
||||
};
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const Packet &packet);
|
||||
|
||||
/**
|
||||
* \defgroup packetperf Packet Performance
|
||||
* The current implementation of the byte buffers and tag list is based
|
||||
|
||||
@@ -231,6 +231,12 @@ TraceContext::Print (std::ostream &os) const
|
||||
} while (true);
|
||||
}
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const TraceContext &context)
|
||||
{
|
||||
context.Print (os);
|
||||
return os;
|
||||
}
|
||||
|
||||
}//namespace ns3
|
||||
|
||||
#include "test.h"
|
||||
|
||||
@@ -99,6 +99,8 @@ private:
|
||||
} * m_data;
|
||||
};
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const TraceContext &context);
|
||||
|
||||
}//namespace ns3
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
Reference in New Issue
Block a user