19 #include "ns3/abort.h"
21 #include "ns3/uinteger.h"
22 #include "ns3/trace-source-accessor.h"
38 .SetGroupName (
"Network")
39 .AddTraceSource (
"PacketsInQueue",
40 "Number of packets currently stored in the queue",
42 "ns3::TracedValueCallback::Uint32")
43 .AddTraceSource (
"BytesInQueue",
44 "Number of bytes currently stored in the queue",
46 "ns3::TracedValueCallback::Uint32")
53 m_nTotalReceivedBytes (0),
55 m_nTotalReceivedPackets (0),
56 m_nTotalDroppedBytes (0),
57 m_nTotalDroppedBytesBeforeEnqueue (0),
58 m_nTotalDroppedBytesAfterDequeue (0),
59 m_nTotalDroppedPackets (0),
60 m_nTotalDroppedPacketsBeforeEnqueue (0),
61 m_nTotalDroppedPacketsAfterDequeue (0)
75 if (typeId.back () !=
'>')
77 typeId.append (
"<" + itemType +
">");
213 "The new maximum queue size cannot be less than the current size");
A base class which provides memory management and object aggregation.
uint32_t GetTotalDroppedPacketsBeforeEnqueue(void) const
uint32_t GetTotalDroppedBytes(void) const
uint32_t m_nTotalDroppedBytesBeforeEnqueue
Total dropped bytes before enqueue.
uint32_t GetTotalDroppedPackets(void) const
void ResetStatistics(void)
Resets the counts for dropped packets, dropped bytes, received packets, and received bytes.
TracedValue< uint32_t > m_nPackets
Number of packets in the queue.
uint32_t m_nTotalDroppedPacketsAfterDequeue
Total dropped packets after dequeue.
uint32_t m_nTotalReceivedPackets
Total received packets.
bool WouldOverflow(uint32_t nPackets, uint32_t nBytes) const
Check if the queue would overflow with additional bytes or packets Note: the check is performed accor...
uint32_t GetNPackets(void) const
uint32_t GetTotalDroppedBytesAfterDequeue(void) const
static void AppendItemTypeIfNotPresent(std::string &typeId, const std::string &itemType)
Append the item type to the provided type ID if the latter does not end with '>'.
uint32_t m_nTotalDroppedBytes
Total dropped bytes.
uint32_t m_nTotalDroppedPacketsBeforeEnqueue
Total dropped packets before enqueue.
uint32_t GetTotalDroppedBytesBeforeEnqueue(void) const
QueueSize m_maxSize
max queue size
uint32_t m_nTotalDroppedPackets
Total dropped packets.
uint32_t GetTotalReceivedPackets(void) const
void SetMaxSize(QueueSize size)
Set the maximum size of this queue.
uint32_t GetTotalReceivedBytes(void) const
TracedValue< uint32_t > m_nBytes
Number of bytes in the queue.
QueueSize GetCurrentSize(void) const
uint32_t m_nTotalDroppedBytesAfterDequeue
Total dropped bytes after dequeue.
uint32_t m_nTotalReceivedBytes
Total received bytes.
uint32_t GetTotalDroppedPacketsAfterDequeue(void) const
static TypeId GetTypeId(void)
Get the type ID.
uint32_t GetNBytes(void) const
QueueSize GetMaxSize(void) const
Class for representing queue sizes.
QueueSizeUnit GetUnit() const
Get the underlying unit.
uint32_t GetValue() const
Get the underlying value.
T Get(void) const
Get the underlying value.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_TEMPLATE_CLASS_DEFINE(type, param)
Explicitly instantiate a template class and register the resulting instance with the TypeId system.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
@ BYTES
Use number of bytes for queue size.
@ PACKETS
Use number of packets for queue size.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.