22 #include "ns3/abort.h" 23 #include "ns3/queue-limits.h" 24 #include "ns3/net-device-queue-interface.h" 25 #include "ns3/simulator.h" 32 : m_stoppedByDevice (false),
33 m_stoppedByQueueLimits (false)
153 static TypeId tid =
TypeId (
"ns3::NetDeviceQueueInterface")
155 .SetGroupName(
"Network")
163 m_lateTxQueuesCreation (false)
193 if (!t.first->TraceDisconnectWithoutContext (
"Enqueue", t.second[0])
194 || !t.first->TraceDisconnectWithoutContext (
"Dequeue", t.second[1])
195 || !t.first->TraceDisconnectWithoutContext (
"DropAfterDequeue", t.second[1])
196 || !t.first->TraceDisconnectWithoutContext (
"DropBeforeEnqueue", t.second[2]))
198 NS_LOG_WARN (
"NetDeviceQueueInterface: Trying to disconnected a callback that" 199 " has not been connected to a traced callback");
215 " device transmission queues once they have been created.");
226 " have been already created.");
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
std::map< Ptr< QueueBase >, std::vector< CallbackBase > > m_traceMap
Map storing all the connected traces.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
bool m_stoppedByDevice
True if the queue has been stopped by the device.
void NotifyQueuedBytes(uint32_t bytes)
Called by the netdevice to report the number of bytes queued to the device queue. ...
bool m_stoppedByQueueLimits
True if the queue has been stopped by a queue limits object.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
WakeCallback m_wakeCallback
Wake callback.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetSelectQueueCallback(SelectQueueCallback cb)
Set the select queue callback.
virtual void DoDispose(void)
Destructor implementation.
uint8_t GetNTxQueues(void) const
Get the number of device transmission queues.
bool IsStopped(void) const
Get the status of the device transmission queue.
virtual void Start(void)
Called by the device to start this device transmission queue.
bool GetLateTxQueuesCreation(void) const
Get the value of the late TX queues creation flag.
static TypeId GetTypeId(void)
Get the type ID.
SelectQueueCallback m_selectQueueCallback
Select queue callback.
Network device transmission queue interface.
SelectQueueCallback GetSelectQueueCallback(void) const
Get the select queue callback.
uint8_t m_numTxQueues
Number of transmission queues to create.
bool m_lateTxQueuesCreation
True if a device wants to create the TX queues by itself.
void ResetQueueLimits()
Reset queue limits state.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void Stop(void)
Called by the device to stop this device transmission queue.
std::vector< Ptr< NetDeviceQueue > > m_txQueuesVector
Device transmission queues.
virtual void DoDispose(void)
Dispose of the object.
void SetQueueLimits(Ptr< QueueLimits > ql)
Set queue limits to this queue.
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
void NotifyTransmittedBytes(uint32_t bytes)
Called by the netdevice to report the number of bytes it is going to transmit.
void SetLateTxQueuesCreation(bool value)
Set the late TX queues creation flag.
Ptr< QueueLimits > m_queueLimits
Queue limits object.
NetDeviceQueueInterface()
Constructor.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
virtual void Wake(void)
Called by the device to wake the queue disc associated with this device transmission queue...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
void CreateTxQueues(void)
Create the device transmission queues.
Ptr< QueueLimits > GetQueueLimits()
Get queue limits to this queue.
virtual void SetWakeCallback(WakeCallback cb)
Set the wake callback.
virtual ~NetDeviceQueueInterface()
Ptr< NetDeviceQueue > GetTxQueue(uint8_t i) const
Get the i-th transmission queue of the device.
A base class which provides memory management and object aggregation.
virtual ~NetDeviceQueue()
bool IsNull(void) const
Check for null implementation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void SetTxQueuesN(uint8_t numTxQueues)
Set the number of device transmission queues to create.