#include <DB.hxx>
Public Member Functions | |
virtual | ~DB () |
virtual bool | connect ()=0 |
Connect to a database server. | |
virtual void | disconnect ()=0 |
Disconnect to a database server. | |
virtual bool | isClosed ()=0 |
Test if connected to a database. | |
virtual void | setConnectionInfo (string info)=0 |
Set up connection information, which typically includes database server name, port number, user authorization etc. | |
virtual string | getConnectionInfo ()=0 |
Get the connection setup information. | |
virtual int | bindParameters (int param, int argument)=0 |
Pass an integer parameter to SQL command text. | |
virtual int | bindParameters (int param, long argument)=0 |
Pass a long parameter to SQL command text. | |
virtual int | bindParameters (int param, double argument)=0 |
Pass a double parameter to SQL command text. | |
virtual int | bindParameters (int param, string argument)=0 |
Pass a string parameter to SQL command text. | |
virtual void | bindCommand ()=0 |
Bind parameters to SQL command text, the function is usually called immediately before executing a SQL command. | |
virtual void | resetQuery ()=0 |
Reset query statement. | |
virtual int | executeQuery_bindParam (string &commd, Outcome *res)=0 |
Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text. | |
virtual int | executeQuery (string &commd, Outcome *res)=0 |
Submits a command to the server and waits for the result, without passing parameters separately. | |
virtual int | executeInsert (string &commd)=0 |
Submits a 'insert' command to the server. | |
virtual void | storeParameter (int trialID, string interEvt, Parameter &aParam)=0 |
Store a parameter into database. | |
virtual void | storeParameterSet (int trialID, string interEvt, ParameterSet &aParamSet)=0 |
Store a set of parameters into database. | |
virtual int | getMatchingTrialsBetween (ParameterSet &lower, ParameterSet &upper, Outcome *trialIDs)=0 |
Retrieve trials from database, which satisfies that its parameter set value is within [lower, upper]. | |
virtual int | getMatchingTrials (ParameterSet &lower, vector< double > epsilons, Outcome *trialIDs)=0 |
Retrieve trials from database, which satisfies that its parameter set value is within [lower-epsilons, lower+epsilons]. | |
virtual void | getParameter (int trialID, string interEvt, Parameter *aParam)=0 |
Retrieve parameter value from database. | |
virtual void | getParameterSet (int trialID, string interEvt, ParameterSet *aParamSet)=0 |
Retrieve parameter set values from database. |
virtual cqosdb::DB::~DB | ( | ) | [inline, virtual] |
virtual bool cqosdb::DB::connect | ( | ) | [pure virtual] |
virtual void cqosdb::DB::disconnect | ( | ) | [pure virtual] |
virtual bool cqosdb::DB::isClosed | ( | ) | [pure virtual] |
virtual void cqosdb::DB::setConnectionInfo | ( | string | info | ) | [pure virtual] |
Set up connection information, which typically includes database server name, port number, user authorization etc.
Implemented in cqosdb::MetaDB.
virtual string cqosdb::DB::getConnectionInfo | ( | ) | [pure virtual] |
virtual int cqosdb::DB::bindParameters | ( | int | param, | |
int | argument | |||
) | [pure virtual] |
Pass an integer parameter to SQL command text.
param | Index of parameter | |
argument | Value of the parameter |
Implemented in cqosdb::MetaDB.
virtual int cqosdb::DB::bindParameters | ( | int | param, | |
long | argument | |||
) | [pure virtual] |
Pass a long parameter to SQL command text.
param | Index of parameter | |
argument | Value of the parameter |
Implemented in cqosdb::MetaDB.
virtual int cqosdb::DB::bindParameters | ( | int | param, | |
double | argument | |||
) | [pure virtual] |
Pass a double parameter to SQL command text.
param | Index of parameter | |
argument | Value of the parameter |
Implemented in cqosdb::MetaDB.
virtual int cqosdb::DB::bindParameters | ( | int | param, | |
string | argument | |||
) | [pure virtual] |
Pass a string parameter to SQL command text.
param | Index of parameter | |
argument | Value of the parameter |
Implemented in cqosdb::MetaDB.
virtual void cqosdb::DB::bindCommand | ( | ) | [pure virtual] |
Bind parameters to SQL command text, the function is usually called immediately before executing a SQL command.
Implemented in cqosdb::MetaDB.
virtual void cqosdb::DB::resetQuery | ( | ) | [pure virtual] |
virtual int cqosdb::DB::executeQuery_bindParam | ( | string & | commd, | |
Outcome * | res | |||
) | [pure virtual] |
Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text.
commd | The SQL command string to be executed. If parameters are used, they are referred to in the command string as $1, $2, etc. | |
res | Returned query result set |
Implemented in cqosdb::MetaDB.
virtual int cqosdb::DB::executeQuery | ( | string & | commd, | |
Outcome * | res | |||
) | [pure virtual] |
Submits a command to the server and waits for the result, without passing parameters separately.
commd | The SQL command string to be executed. | |
res | Returned query result set |
Implemented in cqosdb::MetaDB.
virtual int cqosdb::DB::executeInsert | ( | string & | commd | ) | [pure virtual] |
Submits a 'insert' command to the server.
commd | The insert SQL command string to be executed. |
Implemented in cqosdb::MetaDB.
virtual void cqosdb::DB::storeParameter | ( | int | trialID, | |
string | interEvt, | |||
Parameter & | aParam | |||
) | [pure virtual] |
Store a parameter into database.
Implementation of the function is dependent on the database schema used.
trialID | The trial associated with the parameter | |
interEvt | The interval_event associated with the parameter | |
aParam | The parameter to be stored |
Implemented in cqosdb::MetaDB.
virtual void cqosdb::DB::storeParameterSet | ( | int | trialID, | |
string | interEvt, | |||
ParameterSet & | aParamSet | |||
) | [pure virtual] |
Store a set of parameters into database.
Implementation of the function is dependent on the database schema used.
trialID | The trial associated with the parameter set | |
interEvt | The interval_event associated with the parameter set | |
aParamSet | The parameter set to be stored |
Implemented in cqosdb::MetaDB.
virtual int cqosdb::DB::getMatchingTrialsBetween | ( | ParameterSet & | lower, | |
ParameterSet & | upper, | |||
Outcome * | trialIDs | |||
) | [pure virtual] |
Retrieve trials from database, which satisfies that its parameter set value is within [lower, upper].
Implementation of the function is dependent on the database schema used.
lower | Lower bounds of the parameter set, | |
upper | Upper bounds of the parameter set, | |
trialIDs | Returned trial ids that meet the conditions |
Implemented in cqosdb::MetaDB.
virtual int cqosdb::DB::getMatchingTrials | ( | ParameterSet & | lower, | |
vector< double > | epsilons, | |||
Outcome * | trialIDs | |||
) | [pure virtual] |
Retrieve trials from database, which satisfies that its parameter set value is within [lower-epsilons, lower+epsilons].
Implementation of the function is dependent on the database schema used.
lower | Pivort values of the parameter set, | |
epsilons | Offset values | |
trialIDs | Returned trial ids that meet the conditions |
Implemented in cqosdb::MetaDB.
virtual void cqosdb::DB::getParameter | ( | int | trialID, | |
string | interEvt, | |||
Parameter * | aParam | |||
) | [pure virtual] |
Retrieve parameter value from database.
Implementation of the function is dependent on the database schema used.
trialID | The trial associated with the parameter | |
interEvt | The interval_event associated with the parameter | |
aParam | in - set parameter name and type; out - fill in value from database |
Implemented in cqosdb::MetaDB.
virtual void cqosdb::DB::getParameterSet | ( | int | trialID, | |
string | interEvt, | |||
ParameterSet * | aParamSet | |||
) | [pure virtual] |
Retrieve parameter set values from database.
Implementation of the function is dependent on the database schema used.
trialID | The trial associated with the parameter set | |
interEvt | The interval_event associated with the parameter set | |
aParamSet | in - set parameter set name and type; out - fill in values from database |
Implemented in cqosdb::MetaDB.