INET Framework for OMNeT++/OMNEST
|
#include <EnergySourceBase.h>
Public Member Functions | |
virtual int | getNumEnergyConsumers () const override |
Returns the number of energy consumers in the range [0, +infinity). More... | |
virtual const IEnergyConsumer * | getEnergyConsumer (int index) const override |
Returns the energy consumer for the provided index. More... | |
virtual void | addEnergyConsumer (const IEnergyConsumer *energyConsumer) override |
Adds a new energy consumer to the energy source. More... | |
virtual void | removeEnergyConsumer (const IEnergyConsumer *energyConsumer) override |
Removes a previously added energy consumer from this energy source. More... | |
Public Member Functions inherited from inet::power::IEnergySource | |
virtual | ~IEnergySource () |
Protected Attributes | |
std::vector< const IEnergyConsumer * > | energyConsumers |
|
overridevirtual |
Adds a new energy consumer to the energy source.
The energyConsumer parameter must not be nullptr.
Implements inet::power::IEnergySource.
Reimplemented in inet::power::CcEnergySourceBase, inet::power::EpEnergySourceBase, inet::power::CcEnergyStorageBase, and inet::power::EpEnergyStorageBase.
Referenced by inet::power::CcEnergySourceBase::addEnergyConsumer(), and inet::power::EpEnergySourceBase::addEnergyConsumer().
|
overridevirtual |
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.
Implements inet::power::IEnergySource.
|
inlineoverridevirtual |
Returns the number of energy consumers in the range [0, +infinity).
Implements inet::power::IEnergySource.
|
overridevirtual |
Removes a previously added energy consumer from this energy source.
This functions throws an exception if the consumer is not found.
Implements inet::power::IEnergySource.
Reimplemented in inet::power::CcEnergySourceBase, inet::power::EpEnergySourceBase, inet::power::CcEnergyStorageBase, and inet::power::EpEnergyStorageBase.
Referenced by inet::power::CcEnergySourceBase::removeEnergyConsumer(), and inet::power::EpEnergySourceBase::removeEnergyConsumer().
|
protected |