#include <row_base.h>
Inheritance diagram for pqxxobject::row_base:
Public Types | |
enum | row_state { STATE_UNINITIALISED, STATE_INITIALISED, STATE_INCONSISTENT } |
The state of the row. More... | |
Public Member Functions | |
virtual | ~row_base () |
The destructor. | |
row_base & | operator= (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. | |
void | abort (pqxxobject::transaction &tran) |
Recover from transaction abort. | |
void | commit (pqxxobject::transaction &tran) |
Recover from transaction commit. | |
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. | |
void | raise_changed () |
Raise the changed signal. | |
void | raise_refreshed () |
Raise the refreshed signal. | |
void | raise_inserted () |
Raise the inserted signal. | |
void | raise_updated () |
Raise the updated signal. | |
void | raise_erased () |
Raise the erased signal. | |
Protected 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. | |
void | begin (pqxxobject::transaction &tran) |
Begin a database operation. | |
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. | |
virtual void | begin_impl (pqxxobject::transaction &tran)=0 |
Begin a transaction (checkpoint). | |
virtual void | abort_impl (pqxxobject::transaction &tran)=0 |
Recover from transaction abort (roll back to checkpoint). | |
virtual void | commit_impl (pqxxobject::transaction &tran)=0 |
Recover from transaction commit (refresh or roll back to checkpoint). | |
virtual bool | get_checkpoint () const=0 |
Find if a checkpoint object exists for this row. | |
void | unset_checkpoint (pqxxobject::transaction &tran) |
Check if the checkpoint status (in the transaction object) needs resetting. | |
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. | |
Private Member Functions | |
void | connect_signal_handlers (pqxxobject::transaction &tran) |
Connect default signal handlers with the transaction. | |
void | connect_safe_signal_handlers (pqxxobject::transaction &tran) |
Connect default signal handlers with the transaction. |
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.
|
The state of the row.
Definition at line 60 of file row_base.h. |
|
The constructor.
Definition at line 66 of file row_base.cc. |
|
The constructor.
Definition at line 72 of file row_base.cc. |
|
The copy constructor.
Definition at line 79 of file row_base.cc. |
|
The destructor.
Definition at line 86 of file row_base.cc. |
|
Recover from transaction abort.
Definition at line 221 of file row_base.cc. References abort_impl(). |
|
Recover from transaction abort (roll back to checkpoint). This default method does nothing and should be overridden by derived classes.
Implemented in pqxxobject::row< Row >. Referenced by abort(). |
|
Begin a database operation. This method is responsible for setting row state and checkpoint objects. Definition at line 293 of file row_base.cc. References begin_impl(), m_state, and STATE_INCONSISTENT. |
|
Begin a transaction (checkpoint). This default method does nothing and should be overridden by derived classes.
Implemented in pqxxobject::row< Row >. Referenced by begin(). |
|
Recover from transaction commit.
Definition at line 227 of file row_base.cc. References commit_impl(). |
|
Recover from transaction commit (refresh or roll back to checkpoint). This default method does nothing and should be overridden by derived classes.
Implemented in pqxxobject::row< Row >. Referenced by commit(). |
|
Connect default signal handlers with the transaction. Only "safe" signal handlers are connected (not signal_refresh) to prevent infinite loops during object refresh.
Definition at line 338 of file row_base.cc. References pqxxobject::transaction::signal_abort(), and pqxxobject::transaction::signal_commit(). |
|
Connect default signal handlers with the transaction.
Definition at line 327 of file row_base.cc. References pqxxobject::transaction::signal_abort(), pqxxobject::transaction::signal_commit(), and pqxxobject::transaction::signal_refresh(). |
|
Remove a row from a table.
Definition at line 195 of file row_base.cc. References abort(), begin(), connect_safe_signal_handlers(), describe_status(), erase_impl(), m_signal_erased, m_state, STATE_INITIALISED, and unset_checkpoint(). |
|
Remove a row from a table. This default method does nothing and should be overridden by derived classes.
Definition at line 315 of file row_base.cc. Referenced by erase(). |
|
Find if a checkpoint object exists for this row.
Implemented in pqxxobject::row< Row >. Referenced by unset_checkpoint(). |
|
Get the row status.
Definition at line 102 of file row_base.cc. References m_state. |
|
Insert a row into a table.
Definition at line 141 of file row_base.cc. References abort(), begin(), connect_signal_handlers(), describe_status(), insert_impl(), m_modified, m_signal_inserted, m_state, STATE_UNINITIALISED, and unset_checkpoint(). |
|
Insert a row into a table. This default method does nothing and should be overridden by derived classes.
Definition at line 305 of file row_base.cc. Referenced by insert(). |
|
Get the row modification status.
Definition at line 108 of file row_base.cc. References m_modified. |
|
Overloaded assignment operator.
Definition at line 91 of file row_base.cc. References m_modified, and m_state. |
|
Raise the changed signal.
Definition at line 263 of file row_base.cc. References m_signal_changed. |
|
Raise the erased signal.
Definition at line 287 of file row_base.cc. References m_signal_erased. |
|
Raise the inserted signal.
Definition at line 275 of file row_base.cc. References m_signal_inserted. |
|
Raise the refreshed signal.
Definition at line 269 of file row_base.cc. References m_signal_refreshed. |
|
Raise the updated signal.
Definition at line 281 of file row_base.cc. References m_signal_updated. |
|
Refresh a row from a table.
Definition at line 114 of file row_base.cc. References abort(), begin(), connect_safe_signal_handlers(), describe_status(), m_signal_refreshed, m_state, refresh_impl(), STATE_UNINITIALISED, and unset_checkpoint(). |
|
Refresh a row from a table. This default method does nothing and should be overridden by derived classes.
Definition at line 300 of file row_base.cc. Referenced by refresh(). |
|
Signal emitted on row change.
Definition at line 233 of file row_base.cc. References m_signal_changed. |
|
Signal emitted on deletion.
Definition at line 257 of file row_base.cc. References m_signal_erased. |
|
Signal emitted on insertion.
Definition at line 245 of file row_base.cc. References m_signal_inserted. |
|
Signal emitted on refresh.
Definition at line 239 of file row_base.cc. References m_signal_refreshed. |
|
Signal emitted on update.
Definition at line 251 of file row_base.cc. References m_signal_updated. |
|
Check if the checkpoint status (in the transaction object) needs resetting.
Definition at line 320 of file row_base.cc. References get_checkpoint(), pqxxobject::transaction::get_checkpoint(), and pqxxobject::transaction::set_checkpoint(). |
|
Update a row from a table.
Definition at line 168 of file row_base.cc. References abort(), begin(), connect_signal_handlers(), describe_status(), m_modified, m_signal_updated, m_state, STATE_INITIALISED, unset_checkpoint(), and update_impl(). |
|
Update a row from a table. This default method does nothing and should be overridden by derived classes.
Definition at line 310 of file row_base.cc. Referenced by update(). |
|
The row modification state.
Definition at line 80 of file row_base.h. Referenced by insert(), is_modified(), operator=(), and update(). |
|
The changed signal.
Definition at line 83 of file row_base.h. Referenced by raise_changed(), and signal_changed(). |
|
The erased signal.
Definition at line 91 of file row_base.h. Referenced by erase(), raise_erased(), and signal_erased(). |
|
The inserted signal.
Definition at line 87 of file row_base.h. Referenced by insert(), raise_inserted(), and signal_inserted(). |
|
The refreshed signal.
Definition at line 85 of file row_base.h. Referenced by raise_refreshed(), refresh(), and signal_refreshed(). |
|
The updated signal.
Definition at line 89 of file row_base.h. Referenced by raise_updated(), signal_updated(), and update(). |
|
The row state.
Definition at line 78 of file row_base.h. Referenced by begin(), erase(), get_state(), insert(), operator=(), refresh(), and update(). |