19 #include "ns3/abort.h" 21 #include "ns3/uinteger.h" 22 #include "ns3/trace-source-accessor.h" 37 .SetGroupName (
"Network")
38 .AddAttribute (
"MaxSize",
44 .AddTraceSource (
"PacketsInQueue",
45 "Number of packets currently stored in the queue",
47 "ns3::TracedValueCallback::Uint32")
48 .AddTraceSource (
"BytesInQueue",
49 "Number of bytes currently stored in the queue",
51 "ns3::TracedValueCallback::Uint32")
58 m_nTotalReceivedBytes (0),
60 m_nTotalReceivedPackets (0),
61 m_nTotalDroppedBytes (0),
62 m_nTotalDroppedBytesBeforeEnqueue (0),
63 m_nTotalDroppedBytesAfterDequeue (0),
64 m_nTotalDroppedPackets (0),
65 m_nTotalDroppedPacketsBeforeEnqueue (0),
66 m_nTotalDroppedPacketsAfterDequeue (0)
79 if (typeId.back () !=
'>')
81 typeId.append (
"<" + itemType +
">");
217 "The new maximum queue size cannot be less than the current size");
uint32_t m_nTotalDroppedPacketsBeforeEnqueue
Total dropped packets before enqueue.
uint32_t m_nTotalReceivedPackets
Total received packets.
uint32_t m_nTotalDroppedPackets
Total dropped packets.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Class for representing queue sizes.
QueueSize GetMaxSize(void) const
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
uint32_t GetTotalDroppedPacketsBeforeEnqueue(void) const
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
uint32_t GetValue() const
Get the underlying value.
uint32_t GetTotalDroppedBytes(void) const
uint32_t GetTotalReceivedPackets(void) const
uint32_t m_nTotalDroppedBytes
Total dropped bytes.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_nTotalDroppedPacketsAfterDequeue
Total dropped packets after dequeue.
uint32_t GetTotalDroppedBytesBeforeEnqueue(void) const
uint32_t m_nTotalDroppedBytesAfterDequeue
Total dropped bytes after dequeue.
TracedValue< uint32_t > m_nPackets
Number of packets in the queue.
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 '>'. ...
QueueSize m_maxSize
max queue size
uint32_t GetTotalDroppedBytesAfterDequeue(void) const
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
uint32_t GetNBytes(void) const
uint32_t m_nTotalDroppedBytesBeforeEnqueue
Total dropped bytes before enqueue.
Use number of packets for queue size.
Ptr< const AttributeAccessor > MakeQueueSizeAccessor(T1 a1)
Ptr< const AttributeChecker > MakeQueueSizeChecker(void)
uint32_t m_nTotalReceivedBytes
Total received bytes.
void ResetStatistics(void)
Resets the counts for dropped packets, dropped bytes, received packets, and received bytes...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t GetTotalDroppedPacketsAfterDequeue(void) const
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
QueueSizeUnit GetUnit() const
Get the underlying unit.
uint32_t GetTotalDroppedPackets(void) const
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
T Get(void) const
Get the underlying value.
#define NS_OBJECT_TEMPLATE_CLASS_DEFINE(type, param)
Explicitly instantiate a template class and register the resulting instance with the TypeId system...
A base class which provides memory management and object aggregation.
uint32_t GetTotalReceivedBytes(void) const
void SetMaxSize(QueueSize size)
Set the maximum size of this queue.
QueueSize GetCurrentSize(void) const
uint32_t GetNPackets(void) const
Use number of bytes for queue size.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
static TypeId GetTypeId(void)
Get the type ID.
TracedValue< uint32_t > m_nBytes
Number of bytes in the queue.