Agroeye  1.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
agroeye::handlers::GeneralStatement Class Reference

Class encapsulating the general insert statement into database. More...

#include <DatabaseStatements.h>

Inheritance diagram for agroeye::handlers::GeneralStatement:
Collaboration diagram for agroeye::handlers::GeneralStatement:

Public Member Functions

void setId (const uint32_t &id)
 Sets id value of inserting row. More...
 
void process ()
 
void flush ()
 

Protected Member Functions

 GeneralStatement ()
 
 GeneralStatement (std::shared_ptr< sqlite3 > aPtrSql3)
 
 GeneralStatement (GeneralStatement &&)=default
 
GeneralStatementoperator= (GeneralStatement &&)=default
 
void prepare ()
 

Protected Attributes

std::shared_ptr< sqlite3 > ptrSql3 {nullptr}
 
std::unique_ptr< sqlite3_stmt, int(*)(sqlite3_stmt *)> ptrStmt {nullptr, [](sqlite3_stmt* pStmt) {return sqlite3_finalize(pStmt);}}
 
std::string buffer
 
size_t id_position {0}
 

Detailed Description

Class encapsulating the general insert statement into database.

Constructor & Destructor Documentation

§ GeneralStatement() [1/3]

agroeye::handlers::GeneralStatement::GeneralStatement ( )
inlineprotected
Here is the caller graph for this function:

§ GeneralStatement() [2/3]

agroeye::handlers::GeneralStatement::GeneralStatement ( std::shared_ptr< sqlite3 >  aPtrSql3)
inlineprotected
Here is the call graph for this function:

§ GeneralStatement() [3/3]

agroeye::handlers::GeneralStatement::GeneralStatement ( GeneralStatement &&  )
protecteddefault

Member Function Documentation

§ flush()

void agroeye::handlers::GeneralStatement::flush ( )

Performs flush by destroying insert statement and creates a new one

Here is the call graph for this function:
Here is the caller graph for this function:

§ operator=()

GeneralStatement& agroeye::handlers::GeneralStatement::operator= ( GeneralStatement &&  )
protecteddefault
Here is the caller graph for this function:

§ prepare()

void agroeye::handlers::GeneralStatement::prepare ( )
protected

Prepares SQL statemnt to bind data with binary statement

Here is the caller graph for this function:

§ process()

void agroeye::handlers::GeneralStatement::process ( )

Proceeds with already bind values

Here is the caller graph for this function:

§ setId()

void agroeye::handlers::GeneralStatement::setId ( const uint32_t &  id)

Sets id value of inserting row.

Parameters
idThe id value
Here is the caller graph for this function:

Member Data Documentation

§ buffer

std::string agroeye::handlers::GeneralStatement::buffer
protected

The buffer containing SQL string used for binding for fast insertions

§ id_position

size_t agroeye::handlers::GeneralStatement::id_position {0}
protected

Position of primary key in binding SQL statement

§ ptrSql3

std::shared_ptr<sqlite3> agroeye::handlers::GeneralStatement::ptrSql3 {nullptr}
protected

Pointer to the location of SQLite3 database

§ ptrStmt

std::unique_ptr<sqlite3_stmt, int(*)(sqlite3_stmt*)> agroeye::handlers::GeneralStatement::ptrStmt {nullptr, [](sqlite3_stmt* pStmt) {return sqlite3_finalize(pStmt);}}
protected

Binded statement, only one copy allowed


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