OpenASIP
2.0
|
#include <SQLite.hh>
Public Member Functions | |
SQLite () | |
virtual | ~SQLite () |
virtual RelationalDBConnection & | connect (const std::string &database, const std::string &login="", const std::string &password="", bool readOnly=false) |
virtual void | close (const RelationalDBConnection &connection) |
Public Member Functions inherited from RelationalDB | |
virtual | ~RelationalDB () |
Private Attributes | |
SQLiteConnection * | activeConnection_ |
Only one simultaneous active connection per SQLite instance allowed currently. More... | |
Implementation of RelationalDB interface for SQLite library.
SQLite::SQLite | ( | ) |
|
virtual |
Destructor.
Definition at line 50 of file SQLite.cc.
References activeConnection_, and close().
|
virtual |
Closes a database connection.
Close should be idempotent, that is, it can be called arbitrary amount of times to a connection without an error.
connection | The database connection to close. |
RelationalDBException | Thrown if closing the connection failed. |
Implements RelationalDB.
Definition at line 100 of file SQLite.cc.
References activeConnection_.
Referenced by connect(), HDB::HDBManager::createNew(), DSDBManager::createNew(), DSDBManager::~DSDBManager(), HDB::HDBManager::~HDBManager(), and ~SQLite().
|
virtual |
Connects to a database.
Possible old connection is closed. SQLite implementation doesn't support multiple active connections currently. If database file is not found, creation of new database file with the given name is attempted.
database | The filename of the SQLite database. |
login | Login name to use for the database connection. |
password | Password to use for the database connection. |
readOnly | Should the database be opened in read-only mode only? |
RelationalDBException | Thrown if connection failed. |
Implements RelationalDB.
Definition at line 69 of file SQLite.cc.
References activeConnection_, and close().
Referenced by HDB::HDBManager::createNew(), DSDBManager::createNew(), DSDBManager::DSDBManager(), and HDB::HDBManager::HDBManager().
|
private |