21 #include "energy-source.h"
28 NS_OBJECT_ENSURE_REGISTERED (EnergySource);
31 EnergySource::GetTypeId (
void)
33 static TypeId tid = TypeId (
"ns3::EnergySource")
39 EnergySource::EnergySource ()
44 EnergySource::~EnergySource ()
77 DeviceEnergyModelContainer::Iterator i;
80 if ((*i)->GetInstanceTypeId () == tid)
93 DeviceEnergyModelContainer::Iterator i;
96 if ((*i)->GetInstanceTypeId ().GetName ().compare (name) == 0)
112 DeviceEnergyModelContainer::Iterator i;
127 DeviceEnergyModelContainer::Iterator i;
153 double totalCurrentA = 0.0;
154 DeviceEnergyModelContainer::Iterator i;
157 totalCurrentA += (*i)->GetCurrentA ();
159 return totalCurrentA;
167 DeviceEnergyModelContainer::Iterator i;
170 (*i)->HandleEnergyDepletion ();
#define NS_LOG_FUNCTION(parameters)
Ptr< Node > GetNode(void) const
#define NS_ASSERT(condition)
#define NS_LOG_COMPONENT_DEFINE(name)
void Add(DeviceEnergyModelContainer container)
Holds a vector of ns3::DeviceEnergyModel pointers.
void BreakDeviceEnergyModelRefCycle(void)
virtual void DoDispose(void)
double CalculateTotalCurrent(void)
Iterator Begin(void) const
Get an iterator which refers to the first DeviceEnergyModel pointer in the container.
void InitializeDeviceModels(void)
void AppendDeviceEnergyModel(Ptr< DeviceEnergyModel > deviceEnergyModelPtr)
void NotifyEnergyDrained(void)
Iterator End(void) const
Get an iterator which refers to the last DeviceEnergyModel pointer in the container.
DeviceEnergyModelContainer m_models
void DisposeDeviceModels(void)
DeviceEnergyModelContainer FindDeviceEnergyModels(TypeId tid)
void SetNode(Ptr< Node > node)
Sets pointer to node containing this EnergySource.
a unique identifier for an interface.
void Clear(void)
Removes all elements in the container.