81 if ((*i)->GetInstanceTypeId () == tid)
97 if ((*i)->GetInstanceTypeId ().GetName ().compare (name) == 0)
154 double totalCurrentA = 0.0;
158 totalCurrentA += (*i)->GetCurrentA ();
160 return totalCurrentA;
171 (*i)->HandleEnergyDepletion ();
std::vector< Ptr< DeviceEnergyModel > >::const_iterator Iterator
#define NS_LOG_FUNCTION(parameters)
Ptr< Node > GetNode(void) const
#define NS_ASSERT(condition)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
NS_LOG_COMPONENT_DEFINE("EnergySource")
void Add(DeviceEnergyModelContainer container)
Holds a vector of ns3::DeviceEnergyModel pointers.
void BreakDeviceEnergyModelRefCycle(void)
This function is called to break reference cycle between EnergySource and DeviceEnergyModel.
virtual void DoDispose(void)
All child's implementation must call BreakDeviceEnergyModelRefCycle to ensure reference cycles to Dev...
static TypeId GetTypeId(void)
double CalculateTotalCurrent(void)
Iterator Begin(void) const
Get an iterator which refers to the first DeviceEnergyModel pointer in the container.
void InitializeDeviceModels(void)
Calls Start () method of the device energy models.
void AppendDeviceEnergyModel(Ptr< DeviceEnergyModel > deviceEnergyModelPtr)
Ptr< Node > m_node
Pointer to node containing this EnergySource.
void NotifyEnergyDrained(void)
This function notifies all DeviceEnergyModel of energy depletion event.
Iterator End(void) const
Get an iterator which refers to the last DeviceEnergyModel pointer in the container.
DeviceEnergyModelContainer m_models
List of device energy models installed on the same node.
void DisposeDeviceModels(void)
Calls Dispose () method of the device energy models.
DeviceEnergyModelContainer FindDeviceEnergyModels(TypeId tid)
a base class which provides memory management and object aggregation
void SetNode(Ptr< Node > node)
Sets pointer to node containing this EnergySource.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void Clear(void)
Removes all elements in the container.