INET Framework for OMNeT++/OMNEST
|
This class is a base interface that must be implemented by energy sink models to integrate with other parts of the power model. More...
#include <IEnergySink.h>
Public Member Functions | |
virtual | ~IEnergySink () |
virtual int | getNumEnergyGenerators () const =0 |
Returns the number of energy generators in the range [0, +infinity). More... | |
virtual const IEnergyGenerator * | getEnergyGenerator (int index) const =0 |
Returns the energy generator for the provided index. More... | |
virtual void | addEnergyGenerator (const IEnergyGenerator *energyGenerator)=0 |
Adds a new energy generator to the energy sink. More... | |
virtual void | removeEnergyGenerator (const IEnergyGenerator *energyGenerator)=0 |
Removes a previously added energy generator from this energy sink. More... | |
This class is a base interface that must be implemented by energy sink models to integrate with other parts of the power model.
Energy generators connect to an energy sink, and they notify the energy sink when their energy generation changes. This interface is extended by various energy sink interfaces. Actual energy sink implementations should implement one of the derived interfaces.
See the corresponding NED file for more details.
|
pure virtual |
Adds a new energy generator to the energy sink.
The energyGenerator parameter must not be nullptr.
Implemented in inet::power::CcEnergySinkBase, inet::power::CcEnergyStorageBase, inet::power::EpEnergySinkBase, inet::power::EpEnergyStorageBase, and inet::power::EnergySinkBase.
Referenced by inet::power::AlternatingEpEnergyGenerator::initialize().
|
pure virtual |
Returns the energy generator 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::EnergySinkBase.
|
pure virtual |
Returns the number of energy generators in the range [0, +infinity).
Implemented in inet::power::EnergySinkBase.
|
pure virtual |
Removes a previously added energy generator from this energy sink.
This functions throws an exception if the generator is not found.
Implemented in inet::power::CcEnergySinkBase, inet::power::CcEnergyStorageBase, inet::power::EpEnergySinkBase, inet::power::EpEnergyStorageBase, and inet::power::EnergySinkBase.