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>
|
| virtual DeviceModelMap | get_device_model ()=0 |
| | Gets the device model from the device model interface. More...
|
| |
| virtual std::optional< VariableAttribute > | get_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< VariableAttribute > | get_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< VariableMonitoringMeta > | set_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< VariableMonitoringMeta > | get_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...
|
| |
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.
◆ 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_id | Monitor ID |
| allow_protected | If 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 |
◆ 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_enum | optionally 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()
Inserts or replaces a variable monitor in the database.
- Parameters
-
- 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 |
◆ 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_id | Id of the monitor that requires the reference changed |
| reference_value | Value 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: