Holds a vector of ns3::QueueDisc pointers. More...
#include "queue-disc-container.h"
Public Types | |
typedef std::vector< Ptr< QueueDisc > >::const_iterator | ConstIterator |
QueueDisc container const iterator. | |
Public Member Functions | |
QueueDiscContainer () | |
Create an empty QueueDiscContainer. | |
QueueDiscContainer (Ptr< QueueDisc > qDisc) | |
void | Add (Ptr< QueueDisc > qDisc) |
Append a single Ptr<QueueDisc> to this container. | |
void | Add (QueueDiscContainer other) |
Append the contents of another QueueDiscContainer to the end of this container. | |
ConstIterator | Begin () const |
Get a const iterator which refers to the first QueueDisc in the container. | |
ConstIterator | End () const |
Get a const iterator which indicates past-the-last QueueDisc in the container. | |
Ptr< QueueDisc > | Get (std::size_t i) const |
Get the Ptr<QueueDisc> stored in this container at a given index. | |
std::size_t | GetN () const |
Get the number of Ptr<QueueDisc> stored in this container. | |
Private Attributes | |
std::vector< Ptr< QueueDisc > > | m_queueDiscs |
QueueDiscs smart pointers. | |
Holds a vector of ns3::QueueDisc pointers.
Typically ns-3 QueueDiscs are installed on net devices using a traffic control helper. The helper Install method takes a NetDeviceContainer which holds some number of Ptr<NetDevice>. For each of the net devices in the NetDeviceContainer the helper will instantiate a queue disc and install it to the net device. For each of the queue discs, the helper also adds the queue disc into a Container for later use by the caller. This is that container used to hold the Ptr<QueueDisc> which are instantiated by the traffic control helper.
Definition at line 34 of file queue-disc-container.h.
typedef std::vector<Ptr<QueueDisc>>::const_iterator ns3::QueueDiscContainer::ConstIterator |
QueueDisc container const iterator.
Definition at line 38 of file queue-disc-container.h.
ns3::QueueDiscContainer::QueueDiscContainer | ( | ) |
Create an empty QueueDiscContainer.
Definition at line 14 of file queue-disc-container.cc.
qDisc | a queue disc to add to the container |
Create a QueueDiscContainer with exactly one queue disc that has previously been instantiated
Definition at line 18 of file queue-disc-container.cc.
References m_queueDiscs.
Append a single Ptr<QueueDisc> to this container.
qDisc | The Ptr<QueueDisc> to append. |
Definition at line 57 of file queue-disc-container.cc.
References m_queueDiscs.
void ns3::QueueDiscContainer::Add | ( | QueueDiscContainer | other | ) |
Append the contents of another QueueDiscContainer to the end of this container.
other | The QueueDiscContainer to append. |
Definition at line 48 of file queue-disc-container.cc.
References Begin(), End(), and m_queueDiscs.
QueueDiscContainer::ConstIterator ns3::QueueDiscContainer::Begin | ( | ) | const |
Get a const iterator which refers to the first QueueDisc in the container.
QueueDiscs can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the iterator method and is typically used in a for-loop to run through the QueueDiscs
Definition at line 24 of file queue-disc-container.cc.
References m_queueDiscs.
Referenced by Add().
QueueDiscContainer::ConstIterator ns3::QueueDiscContainer::End | ( | ) | const |
Get a const iterator which indicates past-the-last QueueDisc in the container.
QueueDiscs can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the iterator method and is typically used in a for-loop to run through the QueueDiscs
Definition at line 30 of file queue-disc-container.cc.
References m_queueDiscs.
Referenced by Add().
Get the Ptr<QueueDisc> stored in this container at a given index.
QueueDiscs can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the direct method and is used to retrieve the indexed Ptr<QueueDisc>.
i | the index of the requested queue disc pointer. |
Definition at line 42 of file queue-disc-container.cc.
References m_queueDiscs.
Referenced by UdpSocketImplTest::DoRun(), and experiment().
std::size_t ns3::QueueDiscContainer::GetN | ( | ) | const |
Get the number of Ptr<QueueDisc> stored in this container.
QueueDiscs can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the direct method and is typically used to define an ending condition in a for-loop that runs through the stored QueueDiscs
Definition at line 36 of file queue-disc-container.cc.
References m_queueDiscs.
QueueDiscs smart pointers.
Definition at line 156 of file queue-disc-container.h.
Referenced by QueueDiscContainer(), Add(), Add(), Begin(), End(), Get(), and GetN().