ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
Public Member Functions | List of all members
ocpp::common::DatabaseConnectionInterface Class Referenceabstract
Inheritance diagram for ocpp::common::DatabaseConnectionInterface:
ocpp::common::DatabaseConnection

Public Member Functions

virtual bool open_connection ()=0
 Opens the database connection. Returns true if succeeded. More...
 
virtual bool close_connection ()=0
 Closes the database connection. Returns true if succeeded. More...
 
virtual std::unique_ptr< DatabaseTransactionInterfacebegin_transaction ()=0
 Start a transaction on the database. Returns an object holding the transaction. More...
 
virtual bool execute_statement (const std::string &statement)=0
 Immediately executes statement. Returns true if succeeded. More...
 
virtual std::unique_ptr< SQLiteStatementInterfacenew_statement (const std::string &sql)=0
 Returns a new SQLiteStatementInterface to be used to perform more advanced sql statements. More...
 
virtual const char * get_error_message ()=0
 Returns the latest error message from sqlite3. More...
 
virtual bool clear_table (const std::string &table)=0
 Clears the table with name table. Returns true if succeeded. More...
 
virtual int64_t get_last_inserted_rowid ()=0
 Gets the last inserted rowid. More...
 
virtual void set_user_version (uint32_t version)=0
 Helper function to set the user version of the database to version. More...
 
virtual uint32_t get_user_version ()=0
 Helper function to get the user version of the database. More...
 

Member Function Documentation

◆ begin_transaction()

virtual std::unique_ptr< DatabaseTransactionInterface > ocpp::common::DatabaseConnectionInterface::begin_transaction ( )
pure virtual

Start a transaction on the database. Returns an object holding the transaction.

Note
This function can block until the previous transaction is finished.

Implemented in ocpp::common::DatabaseConnection.

◆ clear_table()

virtual bool ocpp::common::DatabaseConnectionInterface::clear_table ( const std::string &  table)
pure virtual

Clears the table with name table. Returns true if succeeded.

Implemented in ocpp::common::DatabaseConnection.

◆ close_connection()

virtual bool ocpp::common::DatabaseConnectionInterface::close_connection ( )
pure virtual

Closes the database connection. Returns true if succeeded.

Implemented in ocpp::common::DatabaseConnection.

◆ execute_statement()

virtual bool ocpp::common::DatabaseConnectionInterface::execute_statement ( const std::string &  statement)
pure virtual

Immediately executes statement. Returns true if succeeded.

Implemented in ocpp::common::DatabaseConnection.

◆ get_error_message()

virtual const char * ocpp::common::DatabaseConnectionInterface::get_error_message ( )
pure virtual

Returns the latest error message from sqlite3.

Implemented in ocpp::common::DatabaseConnection.

◆ get_last_inserted_rowid()

virtual int64_t ocpp::common::DatabaseConnectionInterface::get_last_inserted_rowid ( )
pure virtual

Gets the last inserted rowid.

Implemented in ocpp::common::DatabaseConnection.

◆ get_user_version()

virtual uint32_t ocpp::common::DatabaseConnectionInterface::get_user_version ( )
pure virtual

Helper function to get the user version of the database.

Implemented in ocpp::common::DatabaseConnection.

◆ new_statement()

virtual std::unique_ptr< SQLiteStatementInterface > ocpp::common::DatabaseConnectionInterface::new_statement ( const std::string &  sql)
pure virtual

Returns a new SQLiteStatementInterface to be used to perform more advanced sql statements.

Note
Will throw an std::runtime_error if the statement can't be prepared

Implemented in ocpp::common::DatabaseConnection.

◆ open_connection()

virtual bool ocpp::common::DatabaseConnectionInterface::open_connection ( )
pure virtual

Opens the database connection. Returns true if succeeded.

Implemented in ocpp::common::DatabaseConnection.

◆ set_user_version()

virtual void ocpp::common::DatabaseConnectionInterface::set_user_version ( uint32_t  version)
pure virtual

Helper function to set the user version of the database to version.

Implemented in ocpp::common::DatabaseConnection.


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