Classes | Public Member Functions | Protected Member Functions | Friends

SimpleDB::Column Class Reference

The abstract base class for the SimpleDB types. More...

#include <Column.h>

Inheritance diagram for SimpleDB::Column:
Inheritance graph
[legend]

List of all members.

Classes

class  UnboundException
 Exception class. More...

Public Member Functions

virtual bool isNull () const
 Tests if the current value is NULL

Exceptions:
UnboundException if the column hasn't been bound.

virtual std::ostream & oStream (std::ostream &oStream)=0
 Function called to write a column value to the output stream.
virtual ~Column ()
 A virtual destructor that can be overridden if required.
 Column ()
 Constructor used to set initial value of columnBound variable.
void value () const
 This method is to be called by all derived classes to make sure the column was bound.

Protected Member Functions

PimplData & getPimplData ()
 Used for children to get the pimplData.
virtual void doBind (QueryPimplData &queryPimplData, int columnNumber)=0
 This abstract function is called by Query when the Query.bind function is invoked.

Friends

class Query
 Query is a friend so it can call the doBind function, but so that the doBind function can be hidden from outside (for encapsulation).

Detailed Description

The abstract base class for the SimpleDB types.

This type contains the actual data as well as meta-data.

Examples:

complete.cpp, and simple.cpp.


Constructor & Destructor Documentation

virtual SimpleDB::Column::~Column (  )  [virtual]

A virtual destructor that can be overridden if required.

This can be used, for example, to deallocate memory.


Member Function Documentation

virtual void SimpleDB::Column::doBind ( QueryPimplData &  queryPimplData,
int  columnNumber 
) [protected, pure virtual]

This abstract function is called by Query when the Query.bind function is invoked.

This function has an implementation that handles making sure columns are bound. This function should be called by any derived objects.

Parameters:
queryPimplData The implementation data from the query object
columnNumber The column number to bind this column to..

Implemented in SimpleDB::StringColumn, SimpleDB::BigintColumn, SimpleDB::IntColumn, SimpleDB::LongColumn, SimpleDB::DoubleColumn, and SimpleDB::BoolColumn.

PimplData& SimpleDB::Column::getPimplData (  )  [protected]

Used for children to get the pimplData.

Returns:
The pimpl data
virtual bool SimpleDB::Column::isNull (  )  const [virtual]

Tests if the current value is NULL

Exceptions:
UnboundException if the column hasn't been bound.

Returns:
True if the value is NULL.
virtual std::ostream& SimpleDB::Column::oStream ( std::ostream &  oStream  )  [pure virtual]

Function called to write a column value to the output stream.

This function is implemented by each column type to write the value in a suitable form to the output stream.

Parameters:
oStream Output stream object.
Returns:
Output stream object to which data was written.

Implemented in SimpleDB::StringColumn, SimpleDB::BigintColumn, SimpleDB::IntColumn, SimpleDB::LongColumn, SimpleDB::DoubleColumn, and SimpleDB::BoolColumn.

void SimpleDB::Column::value (  )  const

This method is to be called by all derived classes to make sure the column was bound.

It will cause an exception to be thrown if the column wasn't bound.

Reimplemented in SimpleDB::StringColumn, SimpleDB::BigintColumn, SimpleDB::IntColumn, SimpleDB::LongColumn, SimpleDB::DoubleColumn, and SimpleDB::BoolColumn.


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

Documentation pages generated by doxygen.
SourceForge.net Logo