Holds a vector of ns3::DeviceEnergyModel pointers. More...
#include <device-energy-model-container.h>
Public Types | |
typedef std::vector< Ptr < DeviceEnergyModel > >::const_iterator | Iterator |
Public Member Functions | |
DeviceEnergyModelContainer () | |
DeviceEnergyModelContainer (Ptr< DeviceEnergyModel > model) | |
DeviceEnergyModelContainer (std::string modelName) | |
DeviceEnergyModelContainer (const DeviceEnergyModelContainer &a, const DeviceEnergyModelContainer &b) | |
Iterator | Begin (void) const |
Get an iterator which refers to the first DeviceEnergyModel pointer in the container. | |
Iterator | End (void) const |
Get an iterator which refers to the last DeviceEnergyModel pointer in the container. | |
uint32_t | GetN (void) const |
Get the number of Ptr<DeviceEnergyModel> stored in this container. | |
Ptr< DeviceEnergyModel > | Get (uint32_t i) const |
Get the i-th Ptr<DeviceEnergyModel> stored in this container. | |
void | Add (DeviceEnergyModelContainer container) |
void | Add (Ptr< DeviceEnergyModel > model) |
Append a single Ptr<DeviceEnergyModel> to the end of this container. | |
void | Add (std::string modelName) |
Append a single Ptr<DeviceEnergyModel> referred to by its object name to the end of this container. | |
void | Clear (void) |
Removes all elements in the container. |
Holds a vector of ns3::DeviceEnergyModel pointers.
DeviceEnergyModelContainer returns a list of DeviceEnergyModel pointers installed on a node. Users can use this list to access DeviceEnergyModel objects to obtain total device energy consumption on a node easily.
ns3::DeviceEnergyModelContainer::DeviceEnergyModelContainer | ( | ) |
Creates an empty DeviceEnergyModelContainer.
ns3::DeviceEnergyModelContainer::DeviceEnergyModelContainer | ( | Ptr< DeviceEnergyModel > | model | ) |
model | Pointer to a DeviceEnergyModel. |
Creates a DeviceEnergyModelContainer with exactly one DeviceEnergyModel previously instantiated.
ns3::DeviceEnergyModelContainer::DeviceEnergyModelContainer | ( | std::string | modelName | ) |
modelName | Name of DeviceEnergyModel. |
Creates an DeviceEnergyModelContainer with exactly one DeviceEnergyModel previously instantiated and assigned a name using the Object name service. This DeviceEnergyModel is specified by its assigned name.
ns3::DeviceEnergyModelContainer::DeviceEnergyModelContainer | ( | const DeviceEnergyModelContainer & | a, | |
const DeviceEnergyModelContainer & | b | |||
) |
a | A DeviceEnergyModelContainer. | |
b | Another DeviceEnergyModelContainer. |
Creates a DeviceEnergyModelContainer by concatenating DeviceEnergyModelContainer b to DeviceEnergyModelContainer a.
void ns3::DeviceEnergyModelContainer::Add | ( | std::string | modelName | ) |
Append a single Ptr<DeviceEnergyModel> referred to by its object name to the end of this container.
modelName | Name of DeviceEnergyModel object. |
void ns3::DeviceEnergyModelContainer::Add | ( | Ptr< DeviceEnergyModel > | model | ) |
Append a single Ptr<DeviceEnergyModel> to the end of this container.
model | Pointer to an DeviceEnergyModel. |
void ns3::DeviceEnergyModelContainer::Add | ( | DeviceEnergyModelContainer | container | ) |
container | Another DeviceEnergyModelContainer. |
Appends the contents of another DeviceEnergyModelContainer to the end of this DeviceEnergyModelContainer.
Iterator ns3::DeviceEnergyModelContainer::Begin | ( | void | ) | const |
Get an iterator which refers to the first DeviceEnergyModel pointer in the container.
DeviceEnergyModels 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 DeviceEnergyModels.
DeviceEnergyModelContainer::Iterator i; for (i = container.Begin (); i != container.End (); ++i) { (*i)->method (); // some DeviceEnergyModel method }
Iterator ns3::DeviceEnergyModelContainer::End | ( | void | ) | const |
Get an iterator which refers to the last DeviceEnergyModel pointer in the container.
DeviceEnergyModels 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 DeviceEnergyModels.
DeviceEnergyModelContainer::Iterator i; for (i = container.Begin (); i != container.End (); ++i) { (*i)->method (); // some DeviceEnergyModel method }
Ptr<DeviceEnergyModel> ns3::DeviceEnergyModelContainer::Get | ( | uint32_t | i | ) | const |
Get the i-th Ptr<DeviceEnergyModel> stored in this container.
i | Index of the requested Ptr<DeviceEnergyModel>. |
uint32_t ns3::DeviceEnergyModelContainer::GetN | ( | void | ) | const |
Get the number of Ptr<DeviceEnergyModel> stored in this container.