Holds a vector of ns3::OFSwitch13Device pointers. More...
#include "ofswitch13-device-container.h"
Public Types | |
typedef std::vector< Ptr< OFSwitch13Device > >::const_iterator | Iterator |
OFSwitch13Device container iterator. More... | |
Public Member Functions | |
OFSwitch13DeviceContainer () | |
Create an empty OFSwitch13DeviceContainer. More... | |
OFSwitch13DeviceContainer (const OFSwitch13DeviceContainer &a, const OFSwitch13DeviceContainer &b) | |
Create a device container which is a concatenation of the two input OFSwitch13DeviceContainers. More... | |
OFSwitch13DeviceContainer (Ptr< OFSwitch13Device > dev) | |
Create a OFSwitch13DeviceContainer with exactly one device that has previously been instantiated. More... | |
OFSwitch13DeviceContainer (std::string devName) | |
Create a OFSwitch13DeviceContainer with exactly one device. More... | |
void | Add (OFSwitch13DeviceContainer other) |
Append the contents of another OFSwitch13DeviceContainer to the end of this container. More... | |
void | Add (Ptr< OFSwitch13Device > device) |
Append a single Ptr<OFSwitch13Device> to this container. More... | |
void | Add (std::string deviceName) |
Append to this container the single Ptr<OFSwitch13Device> referred to via its object name service registered name. More... | |
Iterator | Begin () const |
Get an iterator which refers to the first OpenFlow device in the container. More... | |
Iterator | End () const |
Get an iterator which indicates past-the-last OpenFlow device in the container. More... | |
Ptr< OFSwitch13Device > | Get (uint32_t i) const |
Get the Ptr<OFSwitch13Device> stored in this container at a given index. More... | |
uint32_t | GetN () const |
Get the number of Ptr<OFSwitch13Device> stored in this container. More... | |
Private Attributes | |
std::vector< Ptr< OFSwitch13Device > > | m_devices |
OFSwitch13Device pointers. More... | |
Holds a vector of ns3::OFSwitch13Device pointers.
Typically OpenFlow Devices are aggregated to nodes using the OFSwitch13Helper. The helper InstallSwitch* methods takes a NodeContainer which holds some number of Ptr<Node>. For each of the Nodes in the NodeContainer the helper will instantiate an OpenFlow device and aggregate it to the node. For each of the devices, the helper also adds the device into a Container for later use by the caller. This is that container used to hold the Ptr<OFSwitch13Device> which are instantiated by the device helper.
Definition at line 44 of file ofswitch13-device-container.h.
typedef std::vector<Ptr<OFSwitch13Device> >::const_iterator ns3::OFSwitch13DeviceContainer::Iterator |
OFSwitch13Device container iterator.
Definition at line 48 of file ofswitch13-device-container.h.
ns3::OFSwitch13DeviceContainer::OFSwitch13DeviceContainer | ( | ) |
Create an empty OFSwitch13DeviceContainer.
Definition at line 27 of file ofswitch13-device-container.cc.
ns3::OFSwitch13DeviceContainer::OFSwitch13DeviceContainer | ( | Ptr< OFSwitch13Device > | dev | ) |
Create a OFSwitch13DeviceContainer with exactly one device that has previously been instantiated.
dev | An OpenFlow device to add to the container. |
Definition at line 31 of file ofswitch13-device-container.cc.
References m_devices.
ns3::OFSwitch13DeviceContainer::OFSwitch13DeviceContainer | ( | std::string | devName | ) |
Create a OFSwitch13DeviceContainer with exactly one device.
Create a OFSwitch13DeviceContainer with exactly one device which has been previously instantiated and assigned a name using the Object name service. This OpenFlow device is specified by its assigned name.
devName | The name of the device to add to the container. |
Definition at line 36 of file ofswitch13-device-container.cc.
References m_devices.
ns3::OFSwitch13DeviceContainer::OFSwitch13DeviceContainer | ( | const OFSwitch13DeviceContainer & | a, |
const OFSwitch13DeviceContainer & | b | ||
) |
Create a device container which is a concatenation of the two input OFSwitch13DeviceContainers.
a | A device container |
b | Another device container |
Definition at line 42 of file ofswitch13-device-container.cc.
References Add().
void ns3::OFSwitch13DeviceContainer::Add | ( | OFSwitch13DeviceContainer | other | ) |
Append the contents of another OFSwitch13DeviceContainer to the end of this container.
other | The OFSwitch13DeviceContainer to append. |
Definition at line 75 of file ofswitch13-device-container.cc.
References Begin(), End(), and m_devices.
Referenced by OFSwitch13DeviceContainer().
void ns3::OFSwitch13DeviceContainer::Add | ( | Ptr< OFSwitch13Device > | device | ) |
Append a single Ptr<OFSwitch13Device> to this container.
device | The Ptr<OFSwitch13Device> to append. |
Definition at line 84 of file ofswitch13-device-container.cc.
References m_devices.
void ns3::OFSwitch13DeviceContainer::Add | ( | std::string | deviceName | ) |
Append to this container the single Ptr<OFSwitch13Device> referred to via its object name service registered name.
deviceName | The name of the OFSwitch13Device object to add to the container. |
Definition at line 90 of file ofswitch13-device-container.cc.
References m_devices.
OFSwitch13DeviceContainer::Iterator ns3::OFSwitch13DeviceContainer::Begin | ( | ) | const |
Get an iterator which refers to the first OpenFlow device in the container.
OpenFlow devices 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 devices.
Definition at line 51 of file ofswitch13-device-container.cc.
References m_devices.
Referenced by Add().
OFSwitch13DeviceContainer::Iterator ns3::OFSwitch13DeviceContainer::End | ( | ) | const |
Get an iterator which indicates past-the-last OpenFlow device in the container.
OpenFlow devices 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 devices
Definition at line 57 of file ofswitch13-device-container.cc.
References m_devices.
Referenced by Add().
Ptr< OFSwitch13Device > ns3::OFSwitch13DeviceContainer::Get | ( | uint32_t | i | ) | const |
Get the Ptr<OFSwitch13Device> stored in this container at a given index.
OpenFlow devices 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<OFSwitch13Device>.
i | the index of the requested device pointer. |
Definition at line 69 of file ofswitch13-device-container.cc.
References m_devices.
uint32_t ns3::OFSwitch13DeviceContainer::GetN | ( | ) | const |
Get the number of Ptr<OFSwitch13Device> stored in this container.
OpenFlow devices 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 devices
Definition at line 63 of file ofswitch13-device-container.cc.
References m_devices.
|
private |
OFSwitch13Device pointers.
Definition at line 204 of file ofswitch13-device-container.h.
Referenced by OFSwitch13DeviceContainer(), Add(), Begin(), End(), Get(), and GetN().