|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include "ns3/config.h"
23 #include "ns3/names.h"
54 if (EnergySourceContainerOnNode == NULL)
57 fac.
SetTypeId (
"ns3::EnergySourceContainer");
59 EnergySourceContainerOnNode->Add (src);
60 (*i)->AggregateObject (EnergySourceContainerOnNode);
64 EnergySourceContainerOnNode->Add (src);
73 Ptr<Node> node = Names::Find<Node> (nodeName);
110 while (dev != deviceContainer.
End ())
113 NS_ASSERT ((*dev)->GetNode () == (*src)->GetNode ());
115 container.
Add (model);
holds a vector of ns3::NetDevice pointers
DeviceEnergyModelContainer Install(Ptr< NetDevice > device, Ptr< EnergySource > source) const
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
EnergySourceContainer InstallAll(void) const
This function installs an EnergySource on all nodes in simulation.
Iterator Begin(void) const
Get an iterator which refers to the first EnergySource pointer in the container.
static NodeContainer GetGlobal(void)
Create a NodeContainer that contains a list of all nodes created through NodeContainer::Create() and ...
Holds a vector of ns3::EnergySource pointers.
EnergySourceContainer Install(Ptr< Node > node) const
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
virtual Ptr< Node > GetNode(void) const =0
Instantiate subclasses of ns3::Object.
virtual ~EnergySourceHelper()
virtual Ptr< EnergySource > DoInstall(Ptr< Node > node) const =0
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
Holds a vector of ns3::DeviceEnergyModel pointers.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
std::vector< Ptr< EnergySource > >::const_iterator Iterator
uint32_t GetN(void) const
Get the number of Ptr<EnergySource> stored in this container.
virtual ~DeviceEnergyModelHelper()
virtual Ptr< DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< EnergySource > source) const =0
keep track of a set of node pointers.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
uint32_t GetN(void) const
Get the number of Ptr<NetDevice> stored in this container.
void Add(EnergySourceContainer container)
void Add(DeviceEnergyModelContainer container)