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

Place Class Reference

Place details. More...

#include <places.h>

Inheritance diagram for Place:

pqxxobject::row< Place > pqxxobject::row_base pqxxobject::rowconvert SigC::Object List of all members.

Public Member Functions

 Place ()
 The constructor.

 Place (const std::string &name, const std::string &gridref)
 The constructor.

virtual ~Place ()
 The destructor.

int get_id () const
 Get the place id number.

const std::string & get_name () const
 Get the place name.

void set_name (const std::string &name)
 Set the place name.

const std::string & get_gridref () const
 Get the place grid reference.

void set_gridref (const std::string &gridref)
 Set the place grid reference.

virtual void initialise (pqxx::result::const_iterator row, pqxxobject::transaction &tran)
 Convert a row of an SQL result set into a Place object.

virtual void insert (pqxxobject::transaction &tran)
 Insert a row into a table.

virtual void update (pqxxobject::transaction &tran)
 Update a row from a table.

virtual void erase (pqxxobject::transaction &tran)
 Remove a row from a table.

virtual void refresh (pqxxobject::transaction &tran)
 Refresh a row from a table.


Private Attributes

pqxxobject::column< int > m_id
 ID number.

pqxxobject::column< std::string > m_name
 Name.

pqxxobject::column< std::string > m_gridref
 Grid Reference.


Detailed Description

Place details.

This class stores the details of a single place. It represents a single row in the places database table. The place id number, name and OS grid reference are known. Each may be accessed and changed using the class methods, with the exception of setting the id number (which is set by the backend database).

Definition at line 39 of file places.h.


Constructor & Destructor Documentation

Place::Place  ) 
 

The constructor.

Definition at line 33 of file places.cc.

Place::Place const std::string &  name,
const std::string &  gridref
 

The constructor.

Parameters:
name the place name.
gridref the place grid reference.

Definition at line 40 of file places.cc.

Place::~Place  )  [virtual]
 

The destructor.

Definition at line 48 of file places.cc.


Member Function Documentation

void Place::erase pqxxobject::transaction tran  )  [virtual]
 

Remove a row from a table.

Implements pqxxobject::rowconvert.

Definition at line 117 of file places.cc.

References get_id(), and pqxxobject::transaction::perform().

const std::string & Place::get_gridref  )  const
 

Get the place grid reference.

Returns:
a constant reference to the grid reference.

Definition at line 71 of file places.cc.

References m_gridref.

Referenced by insert(), and update().

int Place::get_id  )  const
 

Get the place id number.

Returns:
the place id.

Definition at line 53 of file places.cc.

References m_id.

Referenced by erase(), and update().

const std::string & Place::get_name  )  const
 

Get the place name.

Returns:
a constant reference to the name.

Definition at line 59 of file places.cc.

References m_name.

Referenced by insert(), and update().

void Place::initialise pqxx::result::const_iterator  row,
pqxxobject::transaction tran
[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.

Definition at line 83 of file places.cc.

References pqxxobject::column< int >::get_value(), m_gridref, m_id, and m_name.

void Place::insert pqxxobject::transaction tran  )  [virtual]
 

Insert a row into a table.

Implements pqxxobject::rowconvert.

Definition at line 92 of file places.cc.

References get_gridref(), get_name(), and pqxxobject::transaction::perform().

void Place::refresh pqxxobject::transaction tran  )  [virtual]
 

Refresh a row from a table.

Implements pqxxobject::rowconvert.

Definition at line 128 of file places.cc.

void Place::set_gridref const std::string &  gridref  ) 
 

Set the place grid reference.

Parameters:
gridref the grid reference

Definition at line 77 of file places.cc.

References m_gridref.

void Place::set_name const std::string &  name  ) 
 

Set the place name.

Parameters:
name the place name.

Definition at line 65 of file places.cc.

References m_name.

void Place::update pqxxobject::transaction tran  )  [virtual]
 

Update a row from a table.

Implements pqxxobject::rowconvert.

Definition at line 104 of file places.cc.

References get_gridref(), get_id(), get_name(), and pqxxobject::transaction::perform().


Member Data Documentation

pqxxobject::column<std::string> Place::m_gridref [private]
 

Grid Reference.

Definition at line 121 of file places.h.

Referenced by get_gridref(), initialise(), and set_gridref().

pqxxobject::column<int> Place::m_id [private]
 

ID number.

Definition at line 117 of file places.h.

Referenced by get_id(), and initialise().

pqxxobject::column<std::string> Place::m_name [private]
 

Name.

Definition at line 119 of file places.h.

Referenced by get_name(), initialise(), and set_name().


The documentation for this class was generated from the following files:
Generated on Sat Jan 17 20:15:59 2004 for places API Reference by doxygen 1.3.4