DAQ  1.0.0
Data Acquisition System (basic demo)
Public Types | Public Member Functions | List of all members
IDataAccess Class Referenceabstract

The IDataAccess interface is like a proxy for the data layer. More...

#include <idataaccess.h>

Inheritance diagram for IDataAccess:
Inheritance graph
[legend]

Public Types

enum  Err { Err::Ok, Err::Failed, Err::InvalidArgument }
 

Public Member Functions

 IDataAccess () noexcept=default
 
virtual ~IDataAccess ()=default
 
 IDataAccess (const IDataAccess &)=delete
 
IDataAccessoperator= (const IDataAccess &)=delete
 
 IDataAccess (IDataAccess &&)=default
 
IDataAccessoperator= (IDataAccess &&)=default
 
virtual Err add_variable (const Variable &var) noexcept=0
 add_variable add a new variable. More...
 
virtual Err add_variable_value (const VarValue &var) noexcept=0
 add_variable_value add a new variable value related to a variable. More...
 
virtual std::tuple< std::vector< Variable >, Errfetch_variables () noexcept=0
 fetch_variables get all variables. More...
 
virtual std::tuple< std::vector< VarValue >, Errfetch_variable_values (const std::string &var_name, size_t max_len=std::numeric_limits< size_t >::infinity()) noexcept=0
 fetch_variable_values get values for a variable. More...
 
virtual 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=std::numeric_limits< size_t >::infinity()) noexcept=0
 fetch_variable_values get values for a variable in a date range. More...
 

Detailed Description

The IDataAccess interface is like a proxy for the data layer.

This class can filter request or data, for example check for authorization or data compression.

Member Enumeration Documentation

enum IDataAccess::Err
strong
Enumerator
Ok 
Failed 
InvalidArgument 

Constructor & Destructor Documentation

IDataAccess::IDataAccess ( )
defaultnoexcept
virtual IDataAccess::~IDataAccess ( )
virtualdefault
IDataAccess::IDataAccess ( const IDataAccess )
delete
IDataAccess::IDataAccess ( IDataAccess &&  )
default

Member Function Documentation

virtual Err IDataAccess::add_variable ( const Variable var)
pure virtualnoexcept

add_variable add a new variable.

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

Implemented in DataAccess.

virtual Err IDataAccess::add_variable_value ( const VarValue var)
pure virtualnoexcept

add_variable_value add a new variable value related to a variable.

Parameters
varadd a variable value.
Returns
Ok on success.
See also
IDataSource::add_variable_value

Implemented in DataAccess.

virtual std::tuple<std::vector<VarValue>, Err> IDataAccess::fetch_variable_values ( const std::string &  var_name,
size_t  max_len = std::numeric_limits< size_t >::infinity() 
)
pure virtualnoexcept

fetch_variable_values get values for a variable.

Parameters
var_namevariable name.
max_lenmax result len (for data compression for example).
Returns
a vector with the variable values.
See also
IDataSource::fetch_variable_values

Implemented in DataAccess.

virtual std::tuple<std::vector<VarValue>, Err> IDataAccess::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 = std::numeric_limits< size_t >::infinity() 
)
pure virtualnoexcept

fetch_variable_values get values for a variable in a date range.

Parameters
var_namevariable name.
start_datestart date of the period.
end_dateend date of the period.
max_lenmax result len (for data compression for example).
Returns
a vector with the variable values.
See also
IDataSource::fetch_variable_values

Implemented in DataAccess.

virtual std::tuple<std::vector<Variable>, Err> IDataAccess::fetch_variables ( )
pure virtualnoexcept

fetch_variables get all variables.

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

Implemented in DataAccess.

IDataAccess& IDataAccess::operator= ( const IDataAccess )
delete
IDataAccess& IDataAccess::operator= ( IDataAccess &&  )
default

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