Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

PlaceConvert Class Reference

Convert SQL into a Place object. More...

#include <places.h>

Inheritance diagram for PlaceConvert:

pqxxobject::rowconvert< Place > pqxxobject::transaction List of all members.

Public Types

typedef pqxxobject::rowconvert<
Place
row_base
 Underlying row conversion type.


Public Member Functions

 PlaceConvert (pqxx::connection &connection, pqxx::transaction<> *&transaction)
 The constructor.

Placeoperator() (pqxx::result::const_iterator row)
 Convert a row of an SQL result set into a Place object.

void operator() (Place &place, row_base::operation_type operation)
 Convert a Place object into an SQL query.


Detailed Description

Convert SQL into a Place object.

This class is a function object (functor) for use either as a standalone object or as a class template parameter.

Definition at line 102 of file places.h.


Member Typedef Documentation

typedef pqxxobject::rowconvert<Place> PlaceConvert::row_base
 

Underlying row conversion type.

Definition at line 106 of file places.h.

Referenced by PlaceConvert().


Constructor & Destructor Documentation

PlaceConvert::PlaceConvert pqxx::connection &  connection,
pqxx::transaction<> *&  transaction
 

The constructor.

Parameters:
connection a reference to a PostgreSQL database connection object.
transaction a pointer to a PostgreSQL transaction object. This must have been previously created from connection. If set to NULL, PlaceConvert will run in auto-commit mode, and will create a new transaction for each database operation.

Definition at line 83 of file places.cc.

References row_base.


Member Function Documentation

void PlaceConvert::operator() Place place,
row_base::operation_type  operation
 

Convert a Place object into an SQL query.

This allows insertion, updating and deletion of rows.

Parameters:
place the Place to operate on.
operation the database operation to perform.

Definition at line 100 of file places.cc.

References Place::get_gridref(), Place::get_id(), Place::get_name(), pqxxobject::rowconvert< Place >::OPERATION_DELETE, pqxxobject::rowconvert< Place >::OPERATION_INSERT, pqxxobject::rowconvert< Place >::OPERATION_UPDATE, and pqxxobject::transaction::perform().

Place * PlaceConvert::operator() pqxx::result::const_iterator  row  )  [virtual]
 

Convert a row of an SQL result set into a Place object.

Parameters:
row an interator pointing to a row of an SQL result set.
Returns:
a pointer to a Place. The object is allocated with new, and so it must be deleted when no longer required.

Implements pqxxobject::rowconvert< Place >.

Definition at line 90 of file places.cc.

References Place::m_gridref, Place::m_id, and Place::m_name.


The documentation for this class was generated from the following files:
Generated on Wed Jan 7 16:05:12 2004 for places API Reference by doxygen 1.3.4