ns-3
|
keep track of a set of building pointers. More...
#include <building-container.h>
Public Types | |
typedef std::vector< Ptr < Building > >::const_iterator | Iterator |
Public Member Functions | |
BuildingContainer () | |
BuildingContainer (Ptr< Building > building) | |
BuildingContainer (std::string buildingName) | |
Iterator | Begin (void) const |
Get an iterator which refers to the first Building in the container. | |
Iterator | End (void) const |
Get an iterator which indicates past-the-last Building in the container. | |
uint32_t | GetN (void) const |
Get the number of Ptr<Building> stored in this container. | |
Ptr< Building > | Get (uint32_t i) const |
Get the Ptr<Building> stored in this container at a given index. | |
void | Create (uint32_t n) |
Create n buildings and append pointers to them to the end of this BuildingContainer. | |
void | Add (BuildingContainer other) |
Append the contents of another BuildingContainer to the end of this container. | |
void | Add (Ptr< Building > building) |
Append a single Ptr<Building> to this container. | |
void | Add (std::string buildingName) |
Append to this container the single Ptr<Building> referred to via its object name service registered name. |
Static Public Member Functions | |
static BuildingContainer | GetGlobal (void) |
Create a BuildingContainer that contains a list of all buildings stored in the ns3::BuildingList. |
keep track of a set of building pointers.
Some ns-3 helpers operate on more than one building at a time. For example a PositionAllocator may want to position nodes on a set of buildings. The helper methods will then usually take a BuildingContainer as a parameter. BuildingContainers hold the multiple Ptr<Building> which are used to refer to the buildings.
ns3::BuildingContainer::BuildingContainer | ( | ) |
Create an empty BuildingContainer.
Create a BuildingContainer with exactly one building which has been previously instantiated. The single Building is specified by a smart pointer.
building | The Ptr<Building> to add to the container. |
ns3::BuildingContainer::BuildingContainer | ( | std::string | buildingName | ) |
Create a BuildingContainer with exactly one building which has been previously instantiated and assigned a name using the Object Name Service. This Building is then specified by its assigned name.
void ns3::BuildingContainer::Add | ( | BuildingContainer | other | ) |
Append the contents of another BuildingContainer to the end of this container.
other | The BuildingContainer to append. |
References Begin(), and End().
Referenced by ns3::GridBuildingAllocator::Create(), and GetGlobal().
Append a single Ptr<Building> to this container.
building | The Ptr<Building> to append. |
void ns3::BuildingContainer::Add | ( | std::string | buildingName | ) |
Append to this container the single Ptr<Building> referred to via its object name service registered name.
BuildingContainer::Iterator ns3::BuildingContainer::Begin | ( | void | ) | const |
Get an iterator which refers to the first Building in the container.
Buildings 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 Buildings
Referenced by Add().
void ns3::BuildingContainer::Create | ( | uint32_t | n | ) |
Create n buildings and append pointers to them to the end of this BuildingContainer.
Buildings are at the heart of any ns-3 simulation. One of the first tasks that any simulation needs to do is to create a number of buildings. This method automates that task.
n | The number of Buildings to create |
BuildingContainer::Iterator ns3::BuildingContainer::End | ( | void | ) | const |
Get an iterator which indicates past-the-last Building in the container.
Buildings 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 Buildings
Referenced by Add(), and GetGlobal().
Get the Ptr<Building> stored in this container at a given index.
Buildings 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<Appliation>.
i | the index of the requested building pointer. |
|
static |
Create a BuildingContainer that contains a list of all buildings stored in the ns3::BuildingList.
Whenever a Building is created, a Ptr<Building> is added to a global list of all buildings in the system. It is sometimes useful to be able to get to all buildings in one place. This method creates a BuildingContainer that is initialized to contain all of the simulation buildings,
References Add(), ns3::BuildingList::Begin(), and End().
uint32_t ns3::BuildingContainer::GetN | ( | void | ) | const |
Get the number of Ptr<Building> stored in this container.
Buildings 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 Buildings