22 #include "ns3/config.h"
23 #include "ns3/names.h"
45 for (
auto i = c.
Begin(); i != c.
End(); ++i)
55 if (!EnergySourceContainerOnNode)
58 fac.
SetTypeId(
"ns3::EnergySourceContainer");
60 EnergySourceContainerOnNode->Add(src);
61 (*i)->AggregateObject(EnergySourceContainerOnNode);
65 EnergySourceContainerOnNode->Add(src);
74 Ptr<Node> node = Names::Find<Node>(nodeName);
97 NS_ASSERT(device->GetNode() == source->GetNode());
108 auto dev = deviceContainer.
Begin();
109 auto src = sourceContainer.
Begin();
110 while (dev != deviceContainer.
End())
113 NS_ASSERT((*dev)->GetNode() == (*src)->GetNode());
Holds a vector of ns3::DeviceEnergyModel pointers.
DeviceEnergyModelContainer Install(Ptr< NetDevice > device, Ptr< EnergySource > source) const
virtual ~DeviceEnergyModelHelper()
virtual Ptr< DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< EnergySource > source) const =0
Holds a vector of ns3::EnergySource pointers.
uint32_t GetN() const
Get the number of Ptr<EnergySource> stored in this container.
Iterator Begin() const
Get an iterator which refers to the first EnergySource pointer in the container.
virtual ~EnergySourceHelper()
EnergySourceContainer Install(Ptr< Node > node) const
virtual Ptr< EnergySource > DoInstall(Ptr< Node > node) const =0
EnergySourceContainer InstallAll() const
This function installs an EnergySource on all nodes in simulation.
holds a vector of ns3::NetDevice pointers
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in this container.
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
static NodeContainer GetGlobal()
Create a NodeContainer that contains a list of all nodes created through NodeContainer::Create() and ...
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
#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.