DAQ  1.0.0
Data Acquisition System (basic demo)
Public Member Functions | List of all members
MockIDataSource Class Reference

#include <mocksqlitewrapper.h>

Inheritance diagram for MockIDataSource:
Inheritance graph
[legend]
Collaboration diagram for MockIDataSource:
Collaboration graph
[legend]

Public Member Functions

Err create_scheme () noexceptoverride
 create_scheme create data storage persistence, e.g. schema for a relational database More...
 
 MOCK_METHOD1 (mock_add_variable, Err(const Variable &variable))
 
Err add_variable (const Variable &variable) noexceptoverride
 add_variable add a variable to be tracket for the system (by default the only supported variabe value type is double). More...
 
 MOCK_METHOD1 (mock_add_variable_value, Err(const VarValue &var_value))
 
Err add_variable_value (const VarValue &var_value) noexceptoverride
 add_variable_value add a new value for the variable. More...
 
 MOCK_METHOD1 (mock_fetch_variables, Err(const std::function< void(const Variable &var, size_t index)> &send_vale))
 
Err fetch_variables (const std::function< void(const Variable &var, size_t index)> &send_vale) noexceptoverride
 fetch_variables get all variables More...
 
 MOCK_METHOD2 (mock_fetch_variable_values, Err(const std::string &var_name, const std::function< void(const VarValue &val, size_t index)> &send_vale))
 
Err fetch_variable_values (const std::string &var_name, const std::function< void(const VarValue &val, size_t index)> &send_vale) noexceptoverride
 fetch_variable_values get all values of a given variable More...
 
Err count_variable_values (const std::string &, const std::function< void(size_t count)> &) noexceptoverride
 count_variable_values count all values of a given variable More...
 
 MOCK_METHOD4 (mock_fetch_variable_values, Err(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))
 
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) noexceptoverride
 fetch_variable_values get all values of a given variables in a date range More...
 
Err count_variable_values (const std::string &, const std::chrono::system_clock::time_point &, const std::chrono::system_clock::time_point &, const std::function< void(size_t count)> &) noexceptoverride
 count_variable_values count all values of a given variable More...
 
- Public Member Functions inherited from IDataSource
 IDataSource ()=default
 
virtual ~IDataSource ()=default
 
 IDataSource (const IDataSource &)=delete
 
IDataSourceoperator= (const IDataSource &)=delete
 
 IDataSource (IDataSource &&)=default
 
IDataSourceoperator= (IDataSource &&)=default
 

Additional Inherited Members

- Public Types inherited from IDataSource
enum  Err { Err::Ok, Err::Failed }
 

Member Function Documentation

Err MockIDataSource::add_variable ( const Variable variable)
inlineoverridevirtualnoexcept

add_variable add a variable to be tracket for the system (by default the only supported variabe value type is double).

Parameters
variableto be created in the physical storage.
Returns
Err::Ok on succes.
See also
add_variable_value

Implements IDataSource.

Here is the call graph for this function:

Err MockIDataSource::add_variable_value ( const VarValue var_value)
inlineoverridevirtualnoexcept

add_variable_value add a new value for the variable.

Parameters
var_valuevariable value to be inserted in the storage.
Returns
Err::Ok on succes
See also
add_variable

Implements IDataSource.

Here is the call graph for this function:

Err MockIDataSource::count_variable_values ( const std::string &  var_name,
const std::function< void(size_t count)> &  send_count 
)
inlineoverridevirtualnoexcept

count_variable_values count all values of a given variable

Parameters
var_namevariable name to count the values from
send_countin this callack you can receive the number of values for the given variable
Returns
Err::Ok on success

Implements IDataSource.

Here is the call graph for this function:

Err MockIDataSource::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 
)
inlineoverridevirtualnoexcept

count_variable_values count all values of a given variable

Parameters
var_namevariable name to count the values from
start_datebegin of the date range
end_dateend of the date range
send_countin this callack you can receive the number of values for the given variable
Returns
Err::Ok on success.

Implements IDataSource.

Here is the call graph for this function:

Here is the caller graph for this function:

Err MockIDataSource::create_scheme ( )
inlineoverridevirtualnoexcept

create_scheme create data storage persistence, e.g. schema for a relational database

Returns
Err::Ok on succes

Implements IDataSource.

Here is the call graph for this function:

Err MockIDataSource::fetch_variable_values ( const std::string &  var_name,
const std::function< void(const VarValue &val, size_t index)> &  send_vale 
)
inlineoverridevirtualnoexcept

fetch_variable_values get all values of a given variable

Parameters
var_namevariable name to get the values from
send_valethe values will be send in this callback, one at a time, index is the current value index.
Returns
Err::Ok on succes

Implements IDataSource.

Here is the call graph for this function:

Err MockIDataSource::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 
)
inlineoverridevirtualnoexcept

fetch_variable_values get all values of a given variables in a date range

Parameters
var_namevariable name to get the values from
start_datebegin of the date range
end_dateend of the date range
send_valethe values will be send in this callback, one at a time, index is the current value index.
Returns
Err::Ok on succes

Implements IDataSource.

Here is the call graph for this function:

Err MockIDataSource::fetch_variables ( const std::function< void(const Variable &var, size_t index)> &  send_vale)
inlineoverridevirtualnoexcept

fetch_variables get all variables

Parameters
send_valethe variables will be send in this callback, one at a time, index is the current value index.
Returns
Err::Ok on succes

Implements IDataSource.

Here is the call graph for this function:

MockIDataSource::MOCK_METHOD1 ( mock_add_variable  ,
Err(const Variable &variable)   
)
MockIDataSource::MOCK_METHOD1 ( mock_add_variable_value  ,
Err(const VarValue &var_value)   
)
MockIDataSource::MOCK_METHOD1 ( mock_fetch_variables  ,
Err(const std::function< void(const Variable &var, size_t index)> &send_vale)   
)
MockIDataSource::MOCK_METHOD2 ( mock_fetch_variable_values  ,
Err(const std::string &var_name, const std::function< void(const VarValue &val, size_t index)> &send_vale)   
)
MockIDataSource::MOCK_METHOD4 ( mock_fetch_variable_values  ,
Err(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)   
)

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