#include <MetaDB.hxx>
Public Member Functions | |
ResultSet () | |
ResultSet (const ResultSet &other) | |
~ResultSet () | |
int | setElements (PGresult *res) |
Set query results as data elements of the class. | |
int | getNumberOfRows () |
Get number of rows of returned query results. | |
int | getNumberOfColumns () |
Get number of columns of return query results. | |
int | getElement (int row, int column, long *res) |
Get an element of long type at a specified location. | |
int | getElement (int row, int column, double *res) |
Get an element of double type at a specified location. | |
int | getElement (int row, int column, string *res) |
Get an element of string type at a specified location. | |
int | getElement (int row, int column, void *res) |
int | getElement (int row, string name, double *res) |
Get an element of double type at a specified location. | |
int | getElement (int row, string name, long *res) |
Get an element of long type at a specified location. | |
int | getElement (int row, string name, string *res) |
Get an element of string type at a specified location. | |
int | getElement (int row, string name, void *res) |
ColumnData | getARow (int row) |
void | addARow (ColumnData aRow) |
map< string, int > | getColumnName () |
Get column names of the query results. | |
int * | getParameterTypes () |
Get parameter types of the query results. | |
void | setColumnName (map< string, int > colName) |
Set column names of the query results. | |
void | setParamTypes (int *paramType, int colCount) |
Set parameter types of the query results. | |
void | clear () |
Clear up internal data before filled in new result data. | |
int | setParameterName (PGresult *res) |
Set parameter names from returned query results. | |
int | setParameterType (PGresult *res) |
Set parameter types from returned query results. | |
ResultSet & | operator= (ResultSet const &other) |
Public Attributes | |
vector< ColumnData > | QueryData |
Store query data in a vector of ColumnData. | |
int * | parameter_type |
store returned query data types | |
int | reserved |
map< string, int > | column_name |
a map of column name to index | |
int | rows |
number of rows | |
int | columns |
number of columns |
cqosdb::ResultSet::ResultSet | ( | ) |
cqosdb::ResultSet::ResultSet | ( | const ResultSet & | other | ) |
cqosdb::ResultSet::~ResultSet | ( | ) |
int cqosdb::ResultSet::setElements | ( | PGresult * | res | ) | [virtual] |
Set query results as data elements of the class.
res | is the results returned from a query. Its type is decided by the DBMS, e.g., PGresult in PostgreSQL. |
Implements cqosdb::Outcome.
int cqosdb::ResultSet::getNumberOfRows | ( | ) | [virtual] |
int cqosdb::ResultSet::getNumberOfColumns | ( | ) | [virtual] |
int cqosdb::ResultSet::getElement | ( | int | row, | |
int | column, | |||
long * | res | |||
) | [virtual] |
Get an element of long type at a specified location.
row | No. of row | |
column | No. of column | |
res | return value of the element at the location |
Implements cqosdb::Outcome.
int cqosdb::ResultSet::getElement | ( | int | row, | |
int | column, | |||
double * | res | |||
) | [virtual] |
Get an element of double type at a specified location.
row | No. of row | |
column | No. of column | |
res | return value of the element at the location |
Implements cqosdb::Outcome.
int cqosdb::ResultSet::getElement | ( | int | row, | |
int | column, | |||
string * | res | |||
) | [virtual] |
Get an element of string type at a specified location.
row | No. of row | |
column | No. of column | |
res | return value of the element at the location |
Implements cqosdb::Outcome.
int cqosdb::ResultSet::getElement | ( | int | row, | |
int | column, | |||
void * | res | |||
) |
int cqosdb::ResultSet::getElement | ( | int | row, | |
string | name, | |||
double * | res | |||
) | [virtual] |
Get an element of double type at a specified location.
row | No. of row | |
name | column name | |
res | return value of the element at the location |
Implements cqosdb::Outcome.
int cqosdb::ResultSet::getElement | ( | int | row, | |
string | name, | |||
long * | res | |||
) | [virtual] |
Get an element of long type at a specified location.
row | No. of row | |
name | column name | |
res | return value of the element at the location |
Implements cqosdb::Outcome.
int cqosdb::ResultSet::getElement | ( | int | row, | |
string | name, | |||
string * | res | |||
) | [virtual] |
Get an element of string type at a specified location.
row | No. of row | |
name | column name | |
res | return value of the element at the location |
Implements cqosdb::Outcome.
int cqosdb::ResultSet::getElement | ( | int | row, | |
string | name, | |||
void * | res | |||
) |
ColumnData cqosdb::ResultSet::getARow | ( | int | row | ) |
void cqosdb::ResultSet::addARow | ( | ColumnData | aRow | ) |
map<string, int> cqosdb::ResultSet::getColumnName | ( | ) | [inline] |
Get column names of the query results.
int* cqosdb::ResultSet::getParameterTypes | ( | ) | [inline] |
Get parameter types of the query results.
void cqosdb::ResultSet::setColumnName | ( | map< string, int > | colName | ) |
Set column names of the query results.
void cqosdb::ResultSet::setParamTypes | ( | int * | paramType, | |
int | colCount | |||
) |
Set parameter types of the query results.
void cqosdb::ResultSet::clear | ( | ) | [virtual] |
Clear up internal data before filled in new result data.
Must call before using the object.
Implements cqosdb::Outcome.
int cqosdb::ResultSet::setParameterName | ( | PGresult * | res | ) |
Set parameter names from returned query results.
int cqosdb::ResultSet::setParameterType | ( | PGresult * | res | ) |
Set parameter types from returned query results.
Store query data in a vector of ColumnData.
store returned query data types
map<string,int> cqosdb::ResultSet::column_name |
a map of column name to index
number of rows
number of columns