|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/abort.h"
22 #include "ns3/queue-limits.h"
23 #include "ns3/net-device-queue-interface.h"
24 #include "ns3/simulator.h"
25 #include "ns3/uinteger.h"
26 #include "ns3/queue-item.h"
37 .SetGroupName(
"Network")
44 : m_stoppedByDevice (false),
45 m_stoppedByQueueLimits (false),
180 static TypeId tid =
TypeId (
"ns3::NetDeviceQueueInterface")
182 .SetGroupName(
"Network")
184 .AddAttribute (
"TxQueuesType",
185 "The type of transmission queues to be used",
190 .AddAttribute (
"NTxQueues",
"The number of device transmission queues",
195 MakeUintegerChecker<uint16_t> (1, 65535))
243 tx->NotifyAggregatedObject (
this);
268 for (std::size_t i = 0; i < numTxQueues; i++)
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void NotifyNewAggregate(void)
Notify all Objects aggregated to this one of a new Object being aggregated.
virtual void NotifyNewAggregate(void)
Notify that an object was aggregated.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
ObjectFactory m_txQueues
Device transmission queues TypeId.
Ptr< NetDeviceQueue > GetTxQueue(std::size_t i) const
Get the i-th transmission queue of the device.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WakeCallback m_wakeCallback
Wake callback.
bool IsNull(void) const
Check for null implementation.
void SetQueueLimits(Ptr< QueueLimits > ql)
Set queue limits to this queue.
virtual void Wake(void)
Called by the device to wake the queue disc associated with this device transmission queue.
void SetTxQueuesType(TypeId type)
Set the type of device transmission queues to create.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
SelectQueueCallback GetSelectQueueCallback(void) const
Get the select queue callback.
@ ATTR_GET
The attribute can be read.
Ptr< QueueLimits > m_queueLimits
Queue limits object.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
virtual ~NetDeviceQueueInterface()
Smart pointer class similar to boost::intrusive_ptr.
virtual void DoDispose(void)
Dispose of the object.
NetDeviceQueueInterface()
Constructor.
AttributeValue implementation for TypeId.
static TypeId GetTypeId(void)
Get the type ID.
A base class which provides memory management and object aggregation.
virtual bool IsStopped(void) const
Get the status of the device transmission queue.
Ptr< NetDevice > m_device
the netdevice aggregated to the NetDeviceQueueInterface
void SetNTxQueues(std::size_t numTxQueues)
Set the number of device transmission queues to create.
Network device transmission queue.
bool m_stoppedByQueueLimits
True if the queue has been stopped by a queue limits object.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
friend class ObjectFactory
Friends.
void SetSelectQueueCallback(SelectQueueCallback cb)
Set the select queue callback.
virtual ~NetDeviceQueue()
virtual void Stop(void)
Called by the device to stop this device transmission queue.
Network device transmission queue interface.
bool m_stoppedByDevice
True if the queue has been stopped by the device.
std::vector< Ptr< NetDeviceQueue > > m_txQueuesVector
Device transmission queues.
#define NS_LOG_TEMPLATE_DEFINE(name)
Initialize a reference to a Log component.
SelectQueueCallback m_selectQueueCallback
Select queue callback.
virtual void NotifyQueuedBytes(uint32_t bytes)
Called by the netdevice to report the number of bytes queued to the device queue.
virtual void SetWakeCallback(WakeCallback cb)
Set the wake callback.
std::function< std::size_t(Ptr< QueueItem >)> SelectQueueCallback
Callback invoked to determine the tx queue selected for a given packet.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void NotifyAggregatedObject(Ptr< NetDeviceQueueInterface > ndqi)
Notify this NetDeviceQueue that the NetDeviceQueueInterface was aggregated to an object.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Hold an unsigned integer type.
Ptr< QueueLimits > GetQueueLimits()
Get queue limits to this queue.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
virtual void Start(void)
Called by the device to start this device transmission queue.
virtual void NotifyTransmittedBytes(uint32_t bytes)
Called by the netdevice to report the number of bytes it is going to transmit.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
std::size_t GetNTxQueues(void) const
Get the number of device transmission queues.
void ResetQueueLimits()
Reset queue limits state.
virtual void DoDispose(void)
Destructor implementation.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
static TypeId GetTypeId(void)
Get the type ID.
Ptr< const AttributeChecker > MakeTypeIdChecker(void)
Ptr< const AttributeAccessor > MakeTypeIdAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Network layer to device interface.
void Nullify(void)
Discard the implementation, set it to null.