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

PlaceTable Class Reference

Place database interaction. More...

#include <places.h>

Inheritance diagram for PlaceTable:

pqxxobject::table< Place > List of all members.

Public Types

typedef pqxxobject::table<
Place
table_base
 Underlying table type.

enum  sort_order { ORDER_ID, ORDER_NAME, ORDER_GRIDREF }
 Sort order. More...


Public Member Functions

 PlaceTable (pqxxobject::transaction &tran)
 The constructor.

virtual ~PlaceTable ()
 The destructor.

row_list_ptr get_list (sort_order order=ORDER_NAME)
 Get a list of all places.

row_ptr find (int place_id)
 Find a single place by its ID number.

row_ptr find_name (const std::string &name)
 Find a place by its name.

row_list_ptr find_gridref (const std::string &gridref)
 Find places by their grid reference.


Detailed Description

Place database interaction.

This class represents the places database table, and may be used to obtain information about places held in the place table. It may be used to add new places, update information about existing places, and remove places.

Definition at line 147 of file places.h.


Member Typedef Documentation

typedef pqxxobject::table<Place> PlaceTable::table_base
 

Underlying table type.

Definition at line 151 of file places.h.

Referenced by PlaceTable().


Member Enumeration Documentation

enum PlaceTable::sort_order
 

Sort order.

Enumeration values:
ORDER_ID  Order by ID number.
ORDER_NAME  Order by name.
ORDER_GRIDREF  Order by grid reference.

Definition at line 163 of file places.h.


Constructor & Destructor Documentation

PlaceTable::PlaceTable pqxxobject::transaction tran  ) 
 

The constructor.

Parameters:
tran a PostgreSQL transaction object.

Definition at line 210 of file places.cc.

References table_base.

PlaceTable::~PlaceTable  )  [virtual]
 

The destructor.

Definition at line 215 of file places.cc.


Member Function Documentation

PlaceTable::row_ptr PlaceTable::find int  place_id  ) 
 

Find a single place by its ID number.

Parameters:
place_id the place ID.
Returns:
a pointer to the place, or NULL if no place was found.

Definition at line 239 of file places.cc.

References pqxxobject::table< Place >::find_one().

PlaceTable::row_list_ptr PlaceTable::find_gridref const std::string &  gridref  ) 
 

Find places by their grid reference.

Because there is no garuantee that the grid reference is unique, this function may return zero, one or many places.

Parameters:
gridref the place grid reference.
Returns:
a pointer to a vector of places.

Definition at line 260 of file places.cc.

References pqxxobject::table< Place >::find_many().

PlaceTable::row_ptr PlaceTable::find_name const std::string &  name  ) 
 

Find a place by its name.

Parameters:
name the place name.
Returns:
a pointer to the place, or NULL if no place was found.

Definition at line 250 of file places.cc.

References pqxxobject::table< Place >::find_one().

PlaceTable::row_list_ptr PlaceTable::get_list sort_order  order = ORDER_NAME  ) 
 

Get a list of all places.

Parameters:
order the order to sort the list in.
Returns:
a pointer to a vector of places.

Definition at line 220 of file places.cc.

References pqxxobject::table< Place >::find_many(), ORDER_GRIDREF, ORDER_ID, and ORDER_NAME.


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