The IDataSource class is an interface for the physycal storage.
More...
#include <idatasource.h>
|
| IDataSource ()=default |
|
virtual | ~IDataSource ()=default |
|
| IDataSource (const IDataSource &)=delete |
|
IDataSource & | operator= (const IDataSource &)=delete |
|
| IDataSource (IDataSource &&)=default |
|
IDataSource & | operator= (IDataSource &&)=default |
|
virtual Err | create_scheme () noexcept=0 |
| create_scheme create data storage persistence, e.g. schema for a relational database More...
|
|
virtual Err | add_variable (const Variable &variable) noexcept=0 |
| add_variable add a variable to be tracket for the system (by default the only supported variabe value type is double). More...
|
|
virtual Err | add_variable_value (const VarValue &var_value) noexcept=0 |
| add_variable_value add a new value for the variable. More...
|
|
virtual Err | fetch_variables (const std::function< void(const Variable &var, size_t index)> &send_vale) noexcept=0 |
| fetch_variables get all variables More...
|
|
virtual Err | fetch_variable_values (const std::string &var_name, const std::function< void(const VarValue &val, size_t index)> &send_vale) noexcept=0 |
| fetch_variable_values get all values of a given variable More...
|
|
virtual Err | count_variable_values (const std::string &var_name, const std::function< void(size_t count)> &send_count) noexcept=0 |
| count_variable_values count all values of a given variable More...
|
|
virtual Err | fetch_variable_values (const std::string &var_name, const std::chrono::system_clock::time_point &start_date, const std::chrono::system_clock::time_point &end_date, const std::function< void(const VarValue &val, size_t index)> &send_vale) noexcept=0 |
| fetch_variable_values get all values of a given variables in a date range More...
|
|
virtual Err | count_variable_values (const std::string &var_name, const std::chrono::system_clock::time_point &start_date, const std::chrono::system_clock::time_point &end_date, const std::function< void(size_t count)> &send_count) noexcept=0 |
| count_variable_values count all values of a given variable More...
|
|
The IDataSource class is an interface for the physycal storage.
A variable is related for example with sensors, like temperature, luminosity, ... A value is for example the numerica value for a temperature sensor.
- See also
- add_variable_value, add_variable_value
IDataSource::IDataSource |
( |
| ) |
|
|
default |
virtual IDataSource::~IDataSource |
( |
| ) |
|
|
virtualdefault |
virtual Err IDataSource::add_variable |
( |
const Variable & |
variable | ) |
|
|
pure virtualnoexcept |
add_variable add a variable to be tracket for the system (by default the only supported variabe value type is double).
- Parameters
-
variable | to be created in the physical storage. |
- Returns
- Err::Ok on succes.
- See also
- add_variable_value
Implemented in SQLiteWrapper, and MockIDataSource.
virtual Err IDataSource::add_variable_value |
( |
const VarValue & |
var_value | ) |
|
|
pure virtualnoexcept |
virtual Err IDataSource::count_variable_values |
( |
const std::string & |
var_name, |
|
|
const std::function< void(size_t count)> & |
send_count |
|
) |
| |
|
pure virtualnoexcept |
count_variable_values count all values of a given variable
- Parameters
-
var_name | variable name to count the values from |
send_count | in this callack you can receive the number of values for the given variable |
- Returns
- Err::Ok on success
Implemented in SQLiteWrapper, and MockIDataSource.
virtual Err IDataSource::count_variable_values |
( |
const std::string & |
var_name, |
|
|
const std::chrono::system_clock::time_point & |
start_date, |
|
|
const std::chrono::system_clock::time_point & |
end_date, |
|
|
const std::function< void(size_t count)> & |
send_count |
|
) |
| |
|
pure virtualnoexcept |
count_variable_values count all values of a given variable
- Parameters
-
var_name | variable name to count the values from |
start_date | begin of the date range |
end_date | end of the date range |
send_count | in this callack you can receive the number of values for the given variable |
- Returns
- Err::Ok on success.
Implemented in SQLiteWrapper, and MockIDataSource.
virtual Err IDataSource::create_scheme |
( |
| ) |
|
|
pure virtualnoexcept |
virtual Err IDataSource::fetch_variable_values |
( |
const std::string & |
var_name, |
|
|
const std::function< void(const VarValue &val, size_t index)> & |
send_vale |
|
) |
| |
|
pure virtualnoexcept |
fetch_variable_values get all values of a given variable
- Parameters
-
var_name | variable name to get the values from |
send_vale | the values will be send in this callback, one at a time, index is the current value index. |
- Returns
- Err::Ok on succes
Implemented in MockIDataSource.
virtual Err IDataSource::fetch_variable_values |
( |
const std::string & |
var_name, |
|
|
const std::chrono::system_clock::time_point & |
start_date, |
|
|
const std::chrono::system_clock::time_point & |
end_date, |
|
|
const std::function< void(const VarValue &val, size_t index)> & |
send_vale |
|
) |
| |
|
pure virtualnoexcept |
fetch_variable_values get all values of a given variables in a date range
- Parameters
-
var_name | variable name to get the values from |
start_date | begin of the date range |
end_date | end of the date range |
send_vale | the values will be send in this callback, one at a time, index is the current value index. |
- Returns
- Err::Ok on succes
Implemented in SQLiteWrapper, and MockIDataSource.
virtual Err IDataSource::fetch_variables |
( |
const std::function< void(const Variable &var, size_t index)> & |
send_vale | ) |
|
|
pure virtualnoexcept |
fetch_variables get all variables
- Parameters
-
send_vale | the variables will be send in this callback, one at a time, index is the current value index. |
- Returns
- Err::Ok on succes
Implemented in SQLiteWrapper, and MockIDataSource.
The documentation for this class was generated from the following file:
- /home/travis/build/denisacostaq/DAQs/src/database-server/data-source/idatasource.h