11#include "ns3/trace-source-accessor.h"
12#include "ns3/uinteger.h"
28 .SetGroupName(
"Network")
29 .AddTraceSource(
"PacketsInQueue",
30 "Number of packets currently stored in the queue",
32 "ns3::TracedValueCallback::Uint32")
33 .AddTraceSource(
"BytesInQueue",
34 "Number of bytes currently stored in the queue",
36 "ns3::TracedValueCallback::Uint32");
42 m_nTotalReceivedBytes(0),
44 m_nTotalReceivedPackets(0),
45 m_nTotalDroppedBytes(0),
46 m_nTotalDroppedBytesBeforeEnqueue(0),
47 m_nTotalDroppedBytesAfterDequeue(0),
48 m_nTotalDroppedPackets(0),
49 m_nTotalDroppedPacketsBeforeEnqueue(0),
50 m_nTotalDroppedPacketsAfterDequeue(0)
64 if (typeId.back() !=
'>')
66 typeId.append(
"<" + itemType +
">");
202 "The new maximum queue size cannot be less than the current size");
A base class which provides memory management and object aggregation.
uint32_t m_nTotalDroppedBytesBeforeEnqueue
Total dropped bytes before enqueue.
uint32_t GetTotalDroppedPacketsAfterDequeue() const
TracedValue< uint32_t > m_nPackets
Number of packets in the queue.
uint32_t GetTotalDroppedPacketsBeforeEnqueue() const
uint32_t m_nTotalDroppedPacketsAfterDequeue
Total dropped packets after dequeue.
uint32_t m_nTotalReceivedPackets
Total received packets.
uint32_t GetTotalDroppedBytesAfterDequeue() const
QueueSize GetMaxSize() const
uint32_t GetTotalReceivedBytes() const
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...
void ResetStatistics()
Resets the counts for dropped packets, dropped bytes, received packets, and received bytes.
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 GetTotalDroppedBytes() const
static TypeId GetTypeId()
Get the type ID.
uint32_t GetTotalDroppedBytesBeforeEnqueue() const
uint32_t m_nTotalDroppedBytes
Total dropped bytes.
uint32_t GetNBytes() const
uint32_t m_nTotalDroppedPacketsBeforeEnqueue
Total dropped packets before enqueue.
QueueSize m_maxSize
max queue size
uint32_t m_nTotalDroppedPackets
Total dropped packets.
uint32_t GetNPackets() const
void SetMaxSize(QueueSize size)
Set the maximum size of this queue.
uint32_t GetTotalReceivedPackets() const
TracedValue< uint32_t > m_nBytes
Number of bytes in the queue.
uint32_t m_nTotalDroppedBytesAfterDequeue
Total dropped bytes after dequeue.
uint32_t GetTotalDroppedPackets() const
uint32_t m_nTotalReceivedBytes
Total received bytes.
QueueSize GetCurrentSize() const
Class for representing queue sizes.
QueueSizeUnit GetUnit() const
Get the underlying unit.
uint32_t GetValue() const
Get the underlying value.
T Get() 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 with one template parameter and register the resulting instan...
#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.