kDB: Knowledge DataBase
|
#include <Store.h>
Public Member Functions | |
Store (const QDir &_storage, int _port=1242) | |
QDir | directory () const |
int | port () const |
knowCore::ReturnVoid | startIfNeeded () |
knowCore::ReturnVoid | start () |
knowCore::ReturnVoid | restart (bool _force=false) |
knowCore::ReturnVoid | stop (bool _force=false) |
knowCore::ReturnVoid | erase () |
Connection | createConnection () const |
bool | isControlling () const |
void | detach () |
bool | isRunning () const |
void | autoSelectPort () |
knowCore::ReturnVoid | setConfiguration (const QString &_key, const QString &_value, bool _restart_server=false) |
knowCore::ReturnVoid | setConfiguration (const QList< QPair< QString, QString > > &_value, bool _restart_server=false) |
Represent a postgresql server, allow it to start, stop and create connection to it.
void Store::autoSelectPort | ( | ) |
Attempt to guess the port, it only works if the store has already been started.
Connection Store::createConnection | ( | ) | const |
Create a connection to that store.
void Store::detach | ( | ) |
detach this instance of the store, and release control, i.e., the postgresql database will not be stopped automatically when this object is deleted.
knowCore::ReturnVoid Store::erase | ( | ) |
This will erase all the content of the database.
bool Store::isControlling | ( | ) | const |
knowCore::ReturnVoid Store::setConfiguration | ( | const QList< QPair< QString, QString > > & | _value, |
bool | _restart_server = false ) |
Set the configuration of the postgresql server.
This function start the server if needed (and then stop if it was started this way). Some changes to configuration require the server to be restarted, this can be done if _restart_server is set to true (default is false)
knowCore::ReturnVoid Store::setConfiguration | ( | const QString & | _key, |
const QString & | _value, | ||
bool | _restart_server = false ) |
Set the configuration of server, convenient overload.
knowCore::ReturnVoid Store::start | ( | ) |
Starts the store. And takes control of the server, when this object is deleted the server will be stopped.
knowCore::ReturnVoid Store::startIfNeeded | ( | ) |
Starts the store if needed (if the store is already started, the object does not take control of the instance, and it won't be stopped when the object is deleted)
knowCore::ReturnVoid Store::stop | ( | bool | _force = false | ) |
Stop the server (even if it is not controlled!).