11#include "ns3/config.h"
34 for (
auto i = c.
Begin(); i != c.
End(); ++i)
44 if (!EnergySourceContainerOnNode)
47 fac.
SetTypeId(
"ns3::energy::EnergySourceContainer");
49 EnergySourceContainerOnNode->Add(src);
50 (*i)->AggregateObject(EnergySourceContainerOnNode);
54 EnergySourceContainerOnNode->Add(src);
86 NS_ASSERT(device->GetNode() == source->GetNode());
97 auto dev = deviceContainer.
Begin();
98 auto src = sourceContainer.
Begin();
99 while (dev != deviceContainer.
End())
102 NS_ASSERT((*dev)->GetNode() == (*src)->GetNode());
104 container.Add(model);
energy::DeviceEnergyModelContainer Install(Ptr< NetDevice > device, Ptr< energy::EnergySource > source) const
virtual Ptr< energy::DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< energy::EnergySource > source) const =0
virtual ~DeviceEnergyModelHelper()
virtual ~EnergySourceHelper()
energy::EnergySourceContainer InstallAll() const
This function installs an EnergySource on all nodes in simulation.
energy::EnergySourceContainer Install(Ptr< Node > node) const
virtual Ptr< energy::EnergySource > DoInstall(Ptr< Node > node) const =0
static Ptr< T > Find(std::string path)
Given a name path string, look to see if there's an object in the system with that associated to it.
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.
Smart pointer class similar to boost::intrusive_ptr.
Holds a vector of ns3::DeviceEnergyModel pointers.
Holds a vector of ns3::EnergySource pointers.
Iterator Begin() const
Get an iterator which refers to the first EnergySource pointer in the container.
uint32_t GetN() const
Get the number of Ptr<EnergySource> stored in this container.
#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.