ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
Public Member Functions | List of all members
ocpp::v2::EvseManager Class Reference
Inheritance diagram for ocpp::v2::EvseManager:
ocpp::v2::EvseManagerInterface

Public Member Functions

 EvseManager (const std::map< int32_t, int32_t > &evse_connector_structure, DeviceModel &device_model, std::shared_ptr< DatabaseHandler > database_handler, std::shared_ptr< ComponentStateManagerInterface > component_state_manager, const std::function< void(const MeterValue &meter_value, EnhancedTransaction &transaction)> &transaction_meter_value_req, const std::function< void(int32_t evse_id)> &pause_charging_callback)
 
EvseInterfaceget_evse (int32_t id) override
 Get a reference to the evse with id. More...
 
const EvseInterfaceget_evse (const int32_t id) const override
 Get a const reference to the evse with id. More...
 
virtual bool does_connector_exist (const int32_t evse_id, const ConnectorEnum connector_type) const override
 Check if the connector exists on the given evse id. More...
 
bool does_evse_exist (const int32_t id) const override
 Check if an evse with id exists. More...
 
bool are_all_connectors_effectively_inoperative () const override
 Checks if all connectors are effectively inoperative. If this is the case, calls the all_connectors_unavailable_callback This is used e.g. to allow firmware updates once all transactions have finished. More...
 
size_t get_number_of_evses () const override
 Get the number of evses. More...
 
std::optional< int32_t > get_transaction_evseid (const CiString< 36 > &transaction_id) const override
 Get evseid for the given transaction id. More...
 
bool any_transaction_active (const std::optional< EVSE > &evse) const override
 Helper function to determine if there is any active transaction for the given evse. More...
 
bool is_valid_evse (const EVSE &evse) const override
 Check if the given evse is valid. More...
 
EvseIterator begin () override
 Gets an iterator pointing to the first evse. More...
 
EvseIterator end () override
 Gets an iterator pointing past the last evse. More...
 
- Public Member Functions inherited from ocpp::v2::EvseManagerInterface
virtual ~EvseManagerInterface ()=default
 Default destructor.
 
virtual EvseInterfaceget_evse (int32_t id)=0
 Get a reference to the evse with id. More...
 
virtual const EvseInterfaceget_evse (int32_t id) const =0
 Get a const reference to the evse with id. More...
 
virtual bool does_connector_exist (const int32_t evse_id, ConnectorEnum connector_type) const =0
 Check if the connector exists on the given evse id. More...
 
virtual bool does_evse_exist (int32_t id) const =0
 Check if an evse with id exists. More...
 
virtual bool are_all_connectors_effectively_inoperative () const =0
 Checks if all connectors are effectively inoperative. If this is the case, calls the all_connectors_unavailable_callback This is used e.g. to allow firmware updates once all transactions have finished. More...
 
virtual size_t get_number_of_evses () const =0
 Get the number of evses. More...
 
virtual std::optional< int32_t > get_transaction_evseid (const CiString< 36 > &transaction_id) const =0
 Get evseid for the given transaction id. More...
 
virtual bool any_transaction_active (const std::optional< EVSE > &evse) const =0
 Helper function to determine if there is any active transaction for the given evse. More...
 
virtual bool is_valid_evse (const EVSE &evse) const =0
 Check if the given evse is valid. More...
 
virtual EvseIterator begin ()=0
 Gets an iterator pointing to the first evse. More...
 
virtual EvseIterator end ()=0
 Gets an iterator pointing past the last evse. More...
 

Additional Inherited Members

- Public Types inherited from ocpp::v2::EvseManagerInterface
using EvseIterator = ForwardIterator< EvseInterface >
 

Member Function Documentation

◆ any_transaction_active()

bool ocpp::v2::EvseManager::any_transaction_active ( const std::optional< EVSE > &  evse) const
overridevirtual

Helper function to determine if there is any active transaction for the given evse.

Parameters
evseif optional is not set, this function will check if there is any transaction active for the whole charging station
Returns

Implements ocpp::v2::EvseManagerInterface.

◆ are_all_connectors_effectively_inoperative()

bool ocpp::v2::EvseManager::are_all_connectors_effectively_inoperative ( ) const
overridevirtual

Checks if all connectors are effectively inoperative. If this is the case, calls the all_connectors_unavailable_callback This is used e.g. to allow firmware updates once all transactions have finished.

Implements ocpp::v2::EvseManagerInterface.

◆ begin()

EvseManager::EvseIterator ocpp::v2::EvseManager::begin ( )
overridevirtual

Gets an iterator pointing to the first evse.

Implements ocpp::v2::EvseManagerInterface.

◆ does_connector_exist()

bool ocpp::v2::EvseManager::does_connector_exist ( const int32_t  evse_id,
const ConnectorEnum  connector_type 
) const
overridevirtual

Check if the connector exists on the given evse id.

Parameters
evse_idThe evse id to check for.
connector_typeThe connector type.
Returns
False if evse id does not exist or evse does not have the given connector type.

Implements ocpp::v2::EvseManagerInterface.

◆ does_evse_exist()

bool ocpp::v2::EvseManager::does_evse_exist ( const int32_t  id) const
overridevirtual

Check if an evse with id exists.

Implements ocpp::v2::EvseManagerInterface.

◆ end()

EvseManager::EvseIterator ocpp::v2::EvseManager::end ( )
overridevirtual

Gets an iterator pointing past the last evse.

Implements ocpp::v2::EvseManagerInterface.

◆ get_evse() [1/2]

const EvseInterface & ocpp::v2::EvseManager::get_evse ( const int32_t  id) const
overridevirtual

Get a const reference to the evse with id.

Note
If id is not present this could throw an EvseOutOfRangeException

Implements ocpp::v2::EvseManagerInterface.

◆ get_evse() [2/2]

EvseInterface & ocpp::v2::EvseManager::get_evse ( int32_t  id)
overridevirtual

Get a reference to the evse with id.

Note
If id is not present this could throw an EvseOutOfRangeException

Implements ocpp::v2::EvseManagerInterface.

◆ get_number_of_evses()

size_t ocpp::v2::EvseManager::get_number_of_evses ( ) const
overridevirtual

Get the number of evses.

Implements ocpp::v2::EvseManagerInterface.

◆ get_transaction_evseid()

std::optional< int32_t > ocpp::v2::EvseManager::get_transaction_evseid ( const CiString< 36 > &  transaction_id) const
overridevirtual

Get evseid for the given transaction id.

Parameters
transaction_idThe transactionid
Returns
The evse id belonging the the transaction id. std::nullopt if there is no transaction with the given transaction id.

Implements ocpp::v2::EvseManagerInterface.

◆ is_valid_evse()

bool ocpp::v2::EvseManager::is_valid_evse ( const EVSE evse) const
overridevirtual

Check if the given evse is valid.

Parameters
evseThe evse to check.
Returns
True when evse is valid.

Implements ocpp::v2::EvseManagerInterface.


The documentation for this class was generated from the following files: