add operator << for Packet and TraceContext

This commit is contained in:
Mathieu Lacage
2007-08-27 13:15:27 +02:00
parent 9a836af0d0
commit 3f159872c0
4 changed files with 16 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -99,6 +99,8 @@ private:
} * m_data;
};
std::ostream& operator<< (std::ostream& os, const TraceContext &context);
}//namespace ns3
namespace ns3 {