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

#include <dataaccess.h>

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

Public Member Functions

 DataAccess (IDataSource *ds) noexcept
 
Err add_variable (const Variable &var) noexceptoverride
 add_variable add a new variable. More...
 
Err add_variable_value (const VarValue &var) noexceptoverride
 add_variable_value add a new value for a given variable. More...
 
std::tuple< std::vector< Variable >, Errfetch_variables () noexceptoverride
 fetch_variables get all variables. More...
 
std::tuple< std::vector< VarValue >, Errfetch_variable_values (const std::string &var_name, size_t max_len) noexceptoverride
 fetch_variable_values get values for a given variable. More...
 
std::tuple< std::vector< VarValue >, Errfetch_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, size_t max_len) noexceptoverride
 fetch_variable_values get values for a given variable in a period. More...
 
Err compress (const std::vector< VarValue > &in_vals, std::vector< VarValue > *out_vals, size_t max_len) noexcept
 compress a dumy compression algorithm More...
 
- Public Member Functions inherited from IDataAccess
 IDataAccess () noexcept=default
 
virtual ~IDataAccess ()=default
 
 IDataAccess (const IDataAccess &)=delete
 
IDataAccessoperator= (const IDataAccess &)=delete
 
 IDataAccess (IDataAccess &&)=default
 
IDataAccessoperator= (IDataAccess &&)=default
 

Private Attributes

IDataSourceds_
 

Additional Inherited Members

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

Constructor & Destructor Documentation

DataAccess::DataAccess ( IDataSource ds)
explicitnoexcept

Member Function Documentation

IDataAccess::Err DataAccess::add_variable ( const Variable var)
overridevirtualnoexcept

add_variable add a new variable.

Parameters
varvariable info.
Returns
Ok on success.
See also
IDataAccess::add_variable

Implements IDataAccess.

IDataAccess::Err DataAccess::add_variable_value ( const VarValue var)
overridevirtualnoexcept

add_variable_value add a new value for a given variable.

Parameters
varvariable value.
Returns
Ok on success.
See also
IDataAccess::add_variable_value

Implements IDataAccess.

IDataAccess::Err DataAccess::compress ( const std::vector< VarValue > &  in_vals,
std::vector< VarValue > *  out_vals,
size_t  max_len 
)
noexcept

compress a dumy compression algorithm

Parameters
in_valsinput values.
out_valsoutput(compressed) values.
max_lenlen of the compressed values.
Returns
Err::Ok on success.
std::tuple< std::vector< VarValue >, IDataAccess::Err > DataAccess::fetch_variable_values ( const std::string &  var_name,
size_t  max_len 
)
overridevirtualnoexcept

fetch_variable_values get values for a given variable.

Parameters
var_namevariable name.
max_lenTODO(denis.nosp@m.acos.nosp@m.taq@g.nosp@m.mail.nosp@m..com): not implemented yet
Returns
a vector of values if any and an error code.
See also
IDataAccess::fetch_variable_values

Implements IDataAccess.

std::tuple< std::vector< VarValue >, IDataAccess::Err > DataAccess::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,
size_t  max_len 
)
overridevirtualnoexcept

fetch_variable_values get values for a given variable in a period.

Parameters
varvariable value.
start_datestart date.
end_dateend date
max_lenTODO(denis.nosp@m.acos.nosp@m.taq@g.nosp@m.mail.nosp@m..com): not implemented yet
Returns
a vector of values if any and an error code.
See also
IDataAccess::fetch_variable_values

Implements IDataAccess.

Here is the caller graph for this function:

std::tuple< std::vector< Variable >, IDataAccess::Err > DataAccess::fetch_variables ( )
overridevirtualnoexcept

fetch_variables get all variables.

Returns
a vector with the variables.
See also
IDataSource::add_variable

Implements IDataAccess.

Member Data Documentation

IDataSource* DataAccess::ds_
private

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