KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SQLITE_DB Struct Reference

Owns one connection, which a worker thread opens and uses. More...

Public Member Functions

 SQLITE_DB (std::string aPath, std::string aUri, int aTimeout)
 
 ~SQLITE_DB ()
 
 SQLITE_DB (const SQLITE_DB &)=delete
 
SQLITE_DB & operator= (const SQLITE_DB &)=delete
 
void Close ()
 
CALL_RESULT Open ()
 
CALL_RESULT Connect ()
 Opens the file and proves it is a database.
 
CALL_RESULT Refresh ()
 Reopens the connection if the path now names a different file than the one opened.
 

Static Public Member Functions

static void closeHandle (sqlite3 *aHandle)
 

Public Attributes

sqlite3 * handle = nullptr
 
std::string path
 
std::string uri
 
int timeout
 
FILE_ID id
 
bool closeWhenIdle = false
 

Detailed Description

Owns one connection, which a worker thread opens and uses.

Definition at line 241 of file sqlite_backend.cpp.

Constructor & Destructor Documentation

◆ SQLITE_DB() [1/2]

SQLITE_DB::SQLITE_DB ( std::string aPath,
std::string aUri,
int aTimeout )
inline

Definition at line 243 of file sqlite_backend.cpp.

References move, path, timeout, and uri.

Referenced by operator=(), and SQLITE_DB().

◆ ~SQLITE_DB()

SQLITE_DB::~SQLITE_DB ( )
inline

Definition at line 251 of file sqlite_backend.cpp.

References Close(), closeHandle(), handle, and DB_WORKER_THREAD::OnWorkerThread().

◆ SQLITE_DB() [2/2]

SQLITE_DB::SQLITE_DB ( const SQLITE_DB & )
delete

References SQLITE_DB().

Member Function Documentation

◆ Close()

void SQLITE_DB::Close ( )
inline

Definition at line 276 of file sqlite_backend.cpp.

References closeHandle(), and handle.

Referenced by Connect(), Open(), Refresh(), and ~SQLITE_DB().

◆ closeHandle()

static void SQLITE_DB::closeHandle ( sqlite3 * aHandle)
inlinestatic

Definition at line 292 of file sqlite_backend.cpp.

Referenced by Close(), and ~SQLITE_DB().

◆ Connect()

CALL_RESULT SQLITE_DB::Connect ( )

Opens the file and proves it is a database.

Definition at line 453 of file sqlite_backend.cpp.

References Close(), Open(), and result.

◆ Open()

CALL_RESULT SQLITE_DB::Open ( )

◆ operator=()

SQLITE_DB & SQLITE_DB::operator= ( const SQLITE_DB & )
delete

References SQLITE_DB().

◆ Refresh()

CALL_RESULT SQLITE_DB::Refresh ( )

Reopens the connection if the path now names a different file than the one opened.

Definition at line 477 of file sqlite_backend.cpp.

References Close(), handle, Open(), and path.

Member Data Documentation

◆ closeWhenIdle

bool SQLITE_DB::closeWhenIdle = false

Definition at line 299 of file sqlite_backend.cpp.

Referenced by Open().

◆ handle

sqlite3* SQLITE_DB::handle = nullptr

Definition at line 294 of file sqlite_backend.cpp.

Referenced by Close(), Open(), Refresh(), and ~SQLITE_DB().

◆ id

FILE_ID SQLITE_DB::id

Definition at line 298 of file sqlite_backend.cpp.

◆ path

std::string SQLITE_DB::path

Definition at line 295 of file sqlite_backend.cpp.

Referenced by Open(), Refresh(), and SQLITE_DB().

◆ timeout

int SQLITE_DB::timeout

Definition at line 297 of file sqlite_backend.cpp.

Referenced by Open(), and SQLITE_DB().

◆ uri

std::string SQLITE_DB::uri

Definition at line 296 of file sqlite_backend.cpp.

Referenced by Open(), and SQLITE_DB().


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