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.


Static Public Member Functions

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


Protected Member Functions

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

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

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

virtual void refresh_impl (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

Place::row_ptr Place::create pqxx::result::const_iterator  row,
pqxxobject::transaction tran
[static]
 

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.
tran a PostgreSQL transaction object.
Returns:
a Place.

Definition at line 83 of file places.cc.

void Place::erase_impl pqxxobject::transaction tran  )  [protected, virtual]
 

Remove a row from a table.

Definition at line 119 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_impl(), and update_impl().

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_impl(), and update_impl().

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_impl(), and update_impl().

void Place::insert_impl pqxxobject::transaction tran  )  [protected, virtual]
 

Insert a row into a table.

Definition at line 94 of file places.cc.

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

void Place::refresh_impl pqxxobject::transaction tran  )  [protected, virtual]
 

Refresh a row from a table.

Definition at line 130 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_impl pqxxobject::transaction tran  )  [protected, virtual]
 

Update a row from a table.

Definition at line 106 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 122 of file places.h.

Referenced by get_gridref(), and set_gridref().

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

ID number.

Definition at line 118 of file places.h.

Referenced by get_id().

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

Name.

Definition at line 120 of file places.h.

Referenced by get_name(), and set_name().


The documentation for this class was generated from the following files:
Generated on Sun Jan 18 12:35:50 2004 for places API Reference by doxygen 1.3.4