ModbusSMA  v1.0.0
modbusSMA::DataBase Class Reference

Reads the modbusSMA register definitions from a sqlite3 database. More...

#include <DataBase.hpp>

Classes

struct  DevEnum
 Information for one supported device. More...
 

Public Member Functions

 DataBase (std::string _path=SMA_MODBUS_DEFAULT_DB)
 Constructor. More...
 
 DataBase (DataBase const &)=delete
 
void operator= (DataBase const &)=delete
 
ErrorCode connect ()
 Connect to the databes.
 
bool validate ()
 Validates the register database.
 
void disconnect ()
 Closes an open databese connection.
 
std::vector< std::string > getTableList ()
 Returns a vector of all tables. More...
 
std::vector< DevEnumgetDeviceEnums ()
 Returns a vector of all supported devices. More...
 
std::vector< RegistergetRegisters (std::string _table)
 Returns a vector of all registers supported by the device. More...
 
bool isConnected () const
 Returns whether the DB is loaded. More...
 

Detailed Description

Reads the modbusSMA register definitions from a sqlite3 database.

Definition at line 52 of file DataBase.hpp.

Constructor & Destructor Documentation

◆ DataBase()

DataBase::DataBase ( std::string  _path = SMA_MODBUS_DEFAULT_DB)

Constructor.

Only sets the DB path.

Definition at line 49 of file DataBase.cpp.

Member Function Documentation

◆ getDeviceEnums()

vector< DataBase::DevEnum > DataBase::getDeviceEnums ( )

Returns a vector of all supported devices.

An empty vector is returned on error.

Definition at line 205 of file DataBase.cpp.

◆ getRegisters()

vector< Register > DataBase::getRegisters ( std::string  _table)

Returns a vector of all registers supported by the device.

An empty vector is returned on error.

Parameters
_tableThe device table from the DevEnum

Definition at line 247 of file DataBase.cpp.

◆ getTableList()

vector< string > DataBase::getTableList ( )

Returns a vector of all tables.

An empty vector is returned on error.

Definition at line 166 of file DataBase.cpp.

◆ isConnected()

bool modbusSMA::DataBase::isConnected ( ) const
inline

Returns whether the DB is loaded.

Definition at line 81 of file DataBase.hpp.


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