cqosdb::ResultSet Class Reference

An implementation of Outcome interfaces. More...

#include <MetaDB.hxx>

Inheritance diagram for cqosdb::ResultSet:

cqosdb::Outcome

List of all members.

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.
ResultSetoperator= (ResultSet const &other)

Public Attributes

vector< ColumnDataQueryData
 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


Detailed Description

An implementation of Outcome interfaces.

Constructor & Destructor Documentation

cqosdb::ResultSet::ResultSet (  ) 

cqosdb::ResultSet::ResultSet ( const ResultSet other  ) 

cqosdb::ResultSet::~ResultSet (  ) 


Member Function Documentation

int cqosdb::ResultSet::setElements ( PGresult *  res  )  [virtual]

Set query results as data elements of the class.

Parameters:
res is the results returned from a query. Its type is decided by the DBMS, e.g., PGresult in PostgreSQL.
Returns:
Return a success flag.

Implements cqosdb::Outcome.

int cqosdb::ResultSet::getNumberOfRows (  )  [virtual]

Get number of rows of returned query results.

Implements cqosdb::Outcome.

int cqosdb::ResultSet::getNumberOfColumns (  )  [virtual]

Get number of columns of return query results.

Implements cqosdb::Outcome.

int cqosdb::ResultSet::getElement ( int  row,
int  column,
long *  res 
) [virtual]

Get an element of long type at a specified location.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

ResultSet & cqosdb::ResultSet::operator= ( ResultSet const &  other  ) 


Member Data Documentation

Store query data in a vector of ColumnData.

store returned query data types

a map of column name to index

number of rows

number of columns


The documentation for this class was generated from the following files:

Generated on Tue Sep 23 19:59:06 2008 for CQoS Database Library by  doxygen 1.5.5