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

pqxxobject::row< Row > Class Template Reference

Database row template class. More...

#include <row.h>

Inheritance diagram for pqxxobject::row< Row >:

pqxxobject::row_base Object List of all members.

Public Types

typedef std::auto_ptr< Row > row_ptr
 Row object pointer.


Public Member Functions

 row ()
 The constructor.

 row (row_state status, bool modified=false)
 The constructor.

virtual ~row ()
 The destructor.


Static Public Member Functions

row_ptr create (pqxx::result::const_iterator row, pqxxobject::transaction &tran)
 Create a new row object from an SQL result set.


Detailed Description

template<typename Row>
class pqxxobject::row< Row >

Database row template class.

The class represents a single row in a database table (or result set). This class should be derived from by your own row class. For example:

 class Address : public libpqxxobject::row<Address>
 {
 private:
   libpqxx::column<int> m_id; // Primary key
   libpqxx::column<std::string> name; // Name
   libpqxx::column<std::string> street; // Street
 [...]
 }
Your class should provide:

Definition at line 80 of file row.h.


Member Typedef Documentation

template<typename Row>
typedef std::auto_ptr<Row> pqxxobject::row< Row >::row_ptr
 

Row object pointer.

Definition at line 84 of file row.h.

Referenced by pqxxobject::row< Row >::create().


Constructor & Destructor Documentation

template<typename Row>
pqxxobject::row< Row >::row  )  [inline]
 

The constructor.

Definition at line 87 of file row.h.

template<typename Row>
pqxxobject::row< Row >::row row_state  status,
bool  modified = false
[inline]
 

The constructor.

Parameters:
status the row status.
modified true if the row is modified, otherwise false.

Definition at line 96 of file row.h.

template<typename Row>
virtual pqxxobject::row< Row >::~row  )  [inline, virtual]
 

The destructor.

Definition at line 102 of file row.h.


Member Function Documentation

template<typename Row>
row_ptr pqxxobject::row< Row >::create pqxx::result::const_iterator  row,
pqxxobject::transaction tran
[inline, static]
 

Create a new row object from an SQL result set.

Parameters:
row an interator pointing to a row of an SQL result set.
tran a PostgreSQL transaction object.
Returns:
a Place.

Definition at line 111 of file row.h.

References pqxxobject::row< Row >::row_ptr, and pqxxobject::row_base::STATE_INITIALISED.


The documentation for this class was generated from the following file:
Generated on Wed Jan 28 21:22:49 2004 for pqxx-object API Reference by doxygen 1.3.4