ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
Public Member Functions | List of all members
ocpp::v2::DeviceModelStorageInterface Class Referenceabstract

Abstract base class for device model interface. This class provides an interface for accessing and modifying device model data. Implementations of this class should provide concrete implementations for the virtual methods declared here. More...

#include <device_model_storage_interface.hpp>

Inheritance diagram for ocpp::v2::DeviceModelStorageInterface:
ocpp::v2::DeviceModelStorageSqlite

Public Member Functions

virtual DeviceModelMap get_device_model ()=0
 Gets the device model from the device model interface. More...
 
virtual std::optional< VariableAttributeget_variable_attribute (const Component &component_id, const Variable &variable_id, const AttributeEnum &attribute_enum)=0
 Gets a VariableAttribute from the storage if present. More...
 
virtual std::vector< VariableAttributeget_variable_attributes (const Component &component_id, const Variable &variable_id, const std::optional< AttributeEnum > &attribute_enum=std::nullopt)=0
 Gets a std::vector<VariableAttribute> from the storage. More...
 
virtual bool set_variable_attribute_value (const Component &component_id, const Variable &variable_id, const AttributeEnum &attribute_enum, const std::string &value, const std::string &source)=0
 Sets the value of an VariableAttribute if present. More...
 
virtual std::optional< VariableMonitoringMetaset_monitoring_data (const SetMonitoringData &data, const VariableMonitorType type)=0
 Inserts or replaces a variable monitor in the database. More...
 
virtual bool update_monitoring_reference (const int32_t monitor_id, const std::string &reference_value)=0
 Updates the reference value for a monitor. The reference values is used for the delta monitors to detect a trigger, and must be updated when a trigger is detected. More...
 
virtual std::vector< VariableMonitoringMetaget_monitoring_data (const std::vector< MonitoringCriterionEnum > &criteria, const Component &component_id, const Variable &variable_id)=0
 Returns all the monitors currently in the database based on the provided filtering criteria. More...
 
virtual ClearMonitoringStatusEnum clear_variable_monitor (int monitor_id, bool allow_protected)=0
 Clears a single monitor based on the ID from the database. More...
 
virtual int32_t clear_custom_variable_monitors ()=0
 Clears all custom monitors (that were added by the CSMS) from the database. More...
 
virtual void check_integrity ()=0
 Check data integrity of the stored data: For "required" variables, assert values exist. Checks might be extended in the future. More...
 

Detailed Description

Abstract base class for device model interface. This class provides an interface for accessing and modifying device model data. Implementations of this class should provide concrete implementations for the virtual methods declared here.

Member Function Documentation

◆ check_integrity()

virtual void ocpp::v2::DeviceModelStorageInterface::check_integrity ( )
pure virtual

Check data integrity of the stored data: For "required" variables, assert values exist. Checks might be extended in the future.

Implemented in ocpp::v2::DeviceModelStorageSqlite.

◆ clear_custom_variable_monitors()

virtual int32_t ocpp::v2::DeviceModelStorageInterface::clear_custom_variable_monitors ( )
pure virtual

Clears all custom monitors (that were added by the CSMS) from the database.

Returns
count of monitors deleted, or 0 if none were deleted

Implemented in ocpp::v2::DeviceModelStorageSqlite.

◆ clear_variable_monitor()

virtual ClearMonitoringStatusEnum ocpp::v2::DeviceModelStorageInterface::clear_variable_monitor ( int  monitor_id,
bool  allow_protected 
)
pure virtual

Clears a single monitor based on the ID from the database.

Parameters
monitor_idMonitor ID
allow_protectedIf we are allowed to delete non-custom monitors
Returns
if not Accepted, NotFound if the monitor could not be found, or Rejected if it is a protected monitor

Implemented in ocpp::v2::DeviceModelStorageSqlite.

◆ get_device_model()

virtual DeviceModelMap ocpp::v2::DeviceModelStorageInterface::get_device_model ( )
pure virtual

Gets the device model from the device model interface.

Returns
std::map<Component, std::map<Variable, VariableMetaData>> that will contain a full representation of the device model except for the VariableAttribute(s) of each Variable.

Implemented in ocpp::v2::DeviceModelStorageSqlite.

◆ get_monitoring_data()

virtual std::vector< VariableMonitoringMeta > ocpp::v2::DeviceModelStorageInterface::get_monitoring_data ( const std::vector< MonitoringCriterionEnum > &  criteria,
const Component component_id,
const Variable variable_id 
)
pure virtual

Returns all the monitors currently in the database based on the provided filtering criteria.

Parameters
criteria
component_id
variable_id
Returns
the monitoring data if it could be found or an empty vector

Implemented in ocpp::v2::DeviceModelStorageSqlite.

◆ get_variable_attribute()

virtual std::optional< VariableAttribute > ocpp::v2::DeviceModelStorageInterface::get_variable_attribute ( const Component component_id,
const Variable variable_id,
const AttributeEnum &  attribute_enum 
)
pure virtual

Gets a VariableAttribute from the storage if present.

Parameters
component_id
variable_id
attribute_enum
Returns
VariableAttribute or std::nullopt if not present in the storage

Implemented in ocpp::v2::DeviceModelStorageSqlite.

◆ get_variable_attributes()

virtual std::vector< VariableAttribute > ocpp::v2::DeviceModelStorageInterface::get_variable_attributes ( const Component component_id,
const Variable variable_id,
const std::optional< AttributeEnum > &  attribute_enum = std::nullopt 
)
pure virtual

Gets a std::vector<VariableAttribute> from the storage.

Parameters
component_id
variable_id
attribute_enumoptionally specifies an AttributeEnum. In this case this std::vector will contain max. one element
Returns
std::vector<VariableAttribute> with maximum size of 4 elements (Actual, Target, MinSet, MaxSet) and minum size of 0 elements (if no VariableAttribute is present for the requested parameters)

Implemented in ocpp::v2::DeviceModelStorageSqlite.

◆ set_monitoring_data()

virtual std::optional< VariableMonitoringMeta > ocpp::v2::DeviceModelStorageInterface::set_monitoring_data ( const SetMonitoringData data,
const VariableMonitorType  type 
)
pure virtual

Inserts or replaces a variable monitor in the database.

Parameters
dataMonitor data to set
Returns
true if the value could be inserted, or valse otherwise

Implemented in ocpp::v2::DeviceModelStorageSqlite.

◆ set_variable_attribute_value()

virtual bool ocpp::v2::DeviceModelStorageInterface::set_variable_attribute_value ( const Component component_id,
const Variable variable_id,
const AttributeEnum &  attribute_enum,
const std::string &  value,
const std::string &  source 
)
pure virtual

Sets the value of an VariableAttribute if present.

Parameters
component_id
variable_id
attribute_enum
value
sourceThe source of the value.
Returns
true if the value could be set in the storage, else false

Implemented in ocpp::v2::DeviceModelStorageSqlite.

◆ update_monitoring_reference()

virtual bool ocpp::v2::DeviceModelStorageInterface::update_monitoring_reference ( const int32_t  monitor_id,
const std::string &  reference_value 
)
pure virtual

Updates the reference value for a monitor. The reference values is used for the delta monitors to detect a trigger, and must be updated when a trigger is detected.

Parameters
monitor_idId of the monitor that requires the reference changed
reference_valueValue to replace the reference with
Returns
true if the reference value could be updated, false otherwise

Implemented in ocpp::v2::DeviceModelStorageSqlite.


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