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

pqxxobject::row_base Class Reference

Database row base class. More...

#include <row_base.h>

Inheritance diagram for pqxxobject::row_base:

Object pqxxobject::row< Row > List of all members.

Public Types

enum  row_state { STATE_UNINITIALISED, STATE_INITIALISED, STATE_INCONSISTENT }
 The state of the row. More...


Public Member Functions

 row_base ()
 The constructor.

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

 row_base (const row_base &rhs)
 The copy constructor.

virtual ~row_base ()
 The destructor.

row_baseoperator= (const row_base &rhs)
 Overloaded assignment operator.

row_state get_state () const
 Get the row status.

bool is_modified () const
 Get the row modification status.

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

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

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

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

SigC::Signal0< void > & signal_changed ()
 Signal emitted on row change.

SigC::Signal0< void > & signal_refreshed ()
 Signal emitted on refresh.

SigC::Signal0< void > & signal_inserted ()
 Signal emitted on insertion.

SigC::Signal0< void > & signal_updated ()
 Signal emitted on update.

SigC::Signal0< void > & signal_erased ()
 Signal emitted on deletion.


Protected Member Functions

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

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.


Protected Attributes

row_state m_state
 The row state.

bool m_modified
 The row modification state.

SigC::Signal0< void > m_signal_changed
 The changed signal.

SigC::Signal0< void > m_signal_refreshed
 The refreshed signal.

SigC::Signal0< void > m_signal_inserted
 The inserted signal.

SigC::Signal0< void > m_signal_updated
 The updated signal.

SigC::Signal0< void > m_signal_erased
 The erased signal.


Detailed Description

Database row base class.

This class provides the functionality common to all database rows of all types. Because it derives from SigC::Object, signals may be connected to it, and all classes which derive from it.

Definition at line 56 of file row_base.h.


Member Enumeration Documentation

enum pqxxobject::row_base::row_state
 

The state of the row.

Enumeration values:
STATE_UNINITIALISED  The row is uninitialised (either new or deleted), not existing in the database.

STATE_INITIALISED  The row exists in the database.
STATE_INCONSISTENT  The row exists in the database, but is inconsistent due to an unsuccessful or partially competed transaction.

Definition at line 60 of file row_base.h.


Constructor & Destructor Documentation

row_base::row_base  ) 
 

The constructor.

Definition at line 66 of file row_base.cc.

row_base::row_base row_state  status,
bool  modified = false
 

The constructor.

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

Definition at line 72 of file row_base.cc.

row_base::row_base const row_base rhs  ) 
 

The copy constructor.

Parameters:
rhs the object to copy.

Definition at line 79 of file row_base.cc.

row_base::~row_base  )  [virtual]
 

The destructor.

Definition at line 86 of file row_base.cc.


Member Function Documentation

void row_base::erase pqxxobject::transaction tran  ) 
 

Remove a row from a table.

Parameters:
tran the transaction which will be used to execute queries.

Definition at line 163 of file row_base.cc.

References describe_status(), erase_impl(), m_signal_changed, m_signal_erased, m_state, STATE_INCONSISTENT, and STATE_INITIALISED.

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

Remove a row from a table.

This default method does nothing and should be overridden by derived classes.

Parameters:
tran the transaction which will be used to execute queries.

Definition at line 222 of file row_base.cc.

Referenced by erase().

row_base::row_state row_base::get_state  )  const
 

Get the row status.

Returns:
the row status.

Definition at line 99 of file row_base.cc.

References m_state.

void row_base::insert pqxxobject::transaction tran  ) 
 

Insert a row into a table.

Parameters:
tran the transaction which will be used to execute queries.

Definition at line 125 of file row_base.cc.

References describe_status(), insert_impl(), m_modified, m_signal_inserted, m_state, pqxxobject::transaction::signal_abort(), pqxxobject::transaction::signal_commit(), STATE_INCONSISTENT, and STATE_UNINITIALISED.

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

Insert a row into a table.

This default method does nothing and should be overridden by derived classes.

Parameters:
tran the transaction which will be used to execute queries.

Definition at line 212 of file row_base.cc.

Referenced by insert().

bool row_base::is_modified  )  const
 

Get the row modification status.

Returns:
true if the row has been modified, false otherwise.

Definition at line 105 of file row_base.cc.

References m_modified.

row_base & row_base::operator= const row_base rhs  ) 
 

Overloaded assignment operator.

Parameters:
rhs the object to assign.

Definition at line 91 of file row_base.cc.

References m_modified, and m_state.

void row_base::refresh pqxxobject::transaction tran  ) 
 

Refresh a row from a table.

Parameters:
tran the transaction which will be used to execute queries.

Definition at line 111 of file row_base.cc.

References describe_status(), m_signal_changed, m_signal_refreshed, m_state, refresh_impl(), STATE_INCONSISTENT, and STATE_UNINITIALISED.

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

Refresh a row from a table.

This default method does nothing and should be overridden by derived classes.

Parameters:
tran the transaction which will be used to execute queries.

Definition at line 207 of file row_base.cc.

Referenced by refresh().

SigC::Signal0< void > & row_base::signal_changed  ) 
 

Signal emitted on row change.

Returns:
the signal.

Definition at line 177 of file row_base.cc.

References m_signal_changed.

SigC::Signal0< void > & row_base::signal_erased  ) 
 

Signal emitted on deletion.

Returns:
the signal.

Definition at line 201 of file row_base.cc.

References m_signal_erased.

SigC::Signal0< void > & row_base::signal_inserted  ) 
 

Signal emitted on insertion.

Returns:
the signal.

Definition at line 189 of file row_base.cc.

References m_signal_inserted.

SigC::Signal0< void > & row_base::signal_refreshed  ) 
 

Signal emitted on refresh.

Returns:
the signal.

Definition at line 183 of file row_base.cc.

References m_signal_refreshed.

SigC::Signal0< void > & row_base::signal_updated  ) 
 

Signal emitted on update.

Returns:
the signal.

Definition at line 195 of file row_base.cc.

References m_signal_updated.

void row_base::update pqxxobject::transaction tran  ) 
 

Update a row from a table.

Parameters:
tran the transaction which will be used to execute queries.

Definition at line 144 of file row_base.cc.

References describe_status(), m_modified, m_signal_updated, m_state, pqxxobject::transaction::signal_abort(), pqxxobject::transaction::signal_commit(), STATE_INCONSISTENT, STATE_INITIALISED, and update_impl().

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

Update a row from a table.

This default method does nothing and should be overridden by derived classes.

Parameters:
tran the transaction which will be used to execute queries.

Definition at line 217 of file row_base.cc.

Referenced by update().


Member Data Documentation

bool pqxxobject::row_base::m_modified [protected]
 

The row modification state.

Definition at line 204 of file row_base.h.

Referenced by insert(), is_modified(), operator=(), and update().

SigC::Signal0<void> pqxxobject::row_base::m_signal_changed [protected]
 

The changed signal.

Definition at line 207 of file row_base.h.

Referenced by erase(), refresh(), and signal_changed().

SigC::Signal0<void> pqxxobject::row_base::m_signal_erased [protected]
 

The erased signal.

Definition at line 215 of file row_base.h.

Referenced by erase(), and signal_erased().

SigC::Signal0<void> pqxxobject::row_base::m_signal_inserted [protected]
 

The inserted signal.

Definition at line 211 of file row_base.h.

Referenced by insert(), and signal_inserted().

SigC::Signal0<void> pqxxobject::row_base::m_signal_refreshed [protected]
 

The refreshed signal.

Definition at line 209 of file row_base.h.

Referenced by refresh(), and signal_refreshed().

SigC::Signal0<void> pqxxobject::row_base::m_signal_updated [protected]
 

The updated signal.

Definition at line 213 of file row_base.h.

Referenced by signal_updated(), and update().

row_state pqxxobject::row_base::m_state [protected]
 

The row state.

Definition at line 202 of file row_base.h.

Referenced by erase(), get_state(), insert(), operator=(), refresh(), and update().


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