20 #include "ns3/trace-source-accessor.h"
27 NS_OBJECT_ENSURE_REGISTERED (Queue);
30 Queue::GetTypeId (
void)
32 static TypeId tid = TypeId (
"ns3::Queue")
34 .AddTraceSource (
"Enqueue",
"Enqueue a packet in the queue.",
36 .AddTraceSource (
"Dequeue",
"Dequeue a packet from the queue.",
38 .AddTraceSource (
"Drop",
"Drop a packet stored in the queue.",
46 m_nTotalReceivedBytes (0),
48 m_nTotalReceivedPackets (0),
49 m_nTotalDroppedBytes (0),
50 m_nTotalDroppedPackets (0)
69 bool retval = DoEnqueue (p);
77 m_nTotalReceivedBytes += size;
80 m_nTotalReceivedPackets++;
101 m_traceDequeue (packet);
145 return m_nPackets == 0;
153 return m_nTotalReceivedBytes;
161 return m_nTotalReceivedPackets;
169 return m_nTotalDroppedBytes;
177 return m_nTotalDroppedPackets;
184 m_nTotalReceivedBytes = 0;
185 m_nTotalReceivedPackets = 0;
186 m_nTotalDroppedBytes = 0;
187 m_nTotalDroppedPackets = 0;
195 m_nTotalDroppedPackets++;
196 m_nTotalDroppedBytes += p->
GetSize ();
#define NS_LOG_FUNCTION(parameters)
bool Enqueue(Ptr< Packet > p)
uint32_t GetTotalDroppedPackets(void) const
#define NS_ASSERT(condition)
#define NS_LOG_COMPONENT_DEFINE(name)
uint32_t GetSize(void) const
void ResetStatistics(void)
uint32_t GetTotalReceivedBytes(void) const
Ptr< Packet > Dequeue(void)
uint32_t GetNPackets(void) const
#define NS_LOG_LOGIC(msg)
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
uint32_t GetNBytes(void) const
Ptr< const Packet > Peek(void) const
uint32_t GetTotalReceivedPackets(void) const
uint32_t GetTotalDroppedBytes(void) const