INET Framework for OMNeT++/OMNEST
|
This class is a base interface that must be implemented by energy source models to integrate with other parts of the power model. More...
#include <IEnergySource.h>
Public Member Functions | |
virtual | ~IEnergySource () |
virtual int | getNumEnergyConsumers () const =0 |
Returns the number of energy consumers in the range [0, +infinity). More... | |
virtual const IEnergyConsumer * | getEnergyConsumer (int index) const =0 |
Returns the energy consumer for the provided index. More... | |
virtual void | addEnergyConsumer (const IEnergyConsumer *energyConsumer)=0 |
Adds a new energy consumer to the energy source. More... | |
virtual void | removeEnergyConsumer (const IEnergyConsumer *energyConsumer)=0 |
Removes a previously added energy consumer from this energy source. More... | |
This class is a base interface that must be implemented by energy source models to integrate with other parts of the power model.
This interface is extended by various energy source interfaces. Actual energy source implementations should implement one of the derived interfaces.
See the corresponding NED file for more details.
|
pure virtual |
Adds a new energy consumer to the energy source.
The energyConsumer parameter must not be nullptr.
Implemented in inet::power::CcEnergySourceBase, inet::power::EpEnergySourceBase, inet::power::CcEnergyStorageBase, inet::power::EpEnergyStorageBase, and inet::power::EnergySourceBase.
Referenced by inet::power::AlternatingEpEnergyConsumer::initialize(), inet::physicallayer::StateBasedEpEnergyConsumer::initialize(), and inet::physicallayer::StateBasedCcEnergyConsumer::initialize().
|
pure virtual |
Returns the energy consumer for the provided index.
This functions throws an exception if the index is out of range, and it never returns nullptr.
Implemented in inet::power::EnergySourceBase.
|
pure virtual |
Returns the number of energy consumers in the range [0, +infinity).
Implemented in inet::power::EnergySourceBase.
|
pure virtual |
Removes a previously added energy consumer from this energy source.
This functions throws an exception if the consumer is not found.
Implemented in inet::power::CcEnergySourceBase, inet::power::EpEnergySourceBase, inet::power::CcEnergyStorageBase, inet::power::EpEnergyStorageBase, and inet::power::EnergySourceBase.