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 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.


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.

virtual void convert_impl (pqxx::result::const_iterator row, pqxxobject::transaction &tran)

Private Attributes

pqxxobject::field< int > m_id
 ID number.

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

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


Friends

class pqxxobject::row< Place >

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 57 of file places.h.


Constructor & Destructor Documentation

Place::Place  ) 
 

The constructor.

Definition at line 54 of file places.cc.

References m_gridref, m_id, and m_name.

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 64 of file places.cc.

References m_gridref, m_id, and m_name.

Place::~Place  )  [virtual]
 

The destructor.

Definition at line 75 of file places.cc.


Member Function Documentation

void Place::convert_impl pqxx::result::const_iterator  row,
pqxxobject::transaction tran
[protected, virtual]
 

Definition at line 201 of file places.cc.

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

Referenced by refresh_impl().

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

Remove a row from a table.

Reimplemented from pqxxobject::row_base.

Definition at line 159 of file places.cc.

References pqxxobject::transaction::begin(), pqxxobject::transaction::commit(), get_id(), m_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 98 of file places.cc.

References m_gridref.

int Place::get_id  )  const
 

Get the place id number.

Returns:
the place id.

Definition at line 80 of file places.cc.

References m_id.

Referenced by erase_impl(), and refresh_impl().

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

Get the place name.

Returns:
a constant reference to the name.

Definition at line 86 of file places.cc.

References m_name.

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

Insert a row into a table.

Reimplemented from pqxxobject::row_base.

Definition at line 110 of file places.cc.

References pqxxobject::transaction::begin(), pqxxobject::transaction::commit(), pqxxobject::transaction::exec(), pqxxobject::field< int >::get_value(), m_gridref, m_id, m_name, and pqxxobject::transaction::perform().

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

Refresh a row from a table.

Reimplemented from pqxxobject::row_base.

Definition at line 176 of file places.cc.

References pqxxobject::transaction::begin(), pqxxobject::transaction::commit(), convert_impl(), pqxxobject::transaction::exec(), get_id(), and m_id.

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

Set the place grid reference.

Parameters:
gridref the grid reference

Definition at line 104 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 92 of file places.cc.

References m_name.

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

Update a row from a table.

Reimplemented from pqxxobject::row_base.

Definition at line 138 of file places.cc.

References pqxxobject::transaction::begin(), pqxxobject::transaction::commit(), m_gridref, m_id, m_name, and pqxxobject::transaction::perform().


Friends And Related Function Documentation

friend class pqxxobject::row< Place > [friend]
 

Definition at line 136 of file places.h.


Member Data Documentation

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

Grid Reference.

Definition at line 134 of file places.h.

Referenced by convert_impl(), get_gridref(), insert_impl(), Place(), set_gridref(), and update_impl().

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

ID number.

Definition at line 130 of file places.h.

Referenced by convert_impl(), erase_impl(), get_id(), insert_impl(), Place(), refresh_impl(), and update_impl().

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

Name.

Definition at line 132 of file places.h.

Referenced by convert_impl(), get_name(), insert_impl(), Place(), set_name(), and update_impl().


The documentation for this class was generated from the following files:
Generated on Thu Apr 1 10:37:48 2004 for places API Reference by doxygen 1.3.5