lestes::lang::cplus::syn::transaction Class Reference

Inheritance diagram for lestes::lang::cplus::syn::transaction:

lestes::std::object lestes::std::mem::keystone List of all members.

Public Member Functions

const token_list_iterator start_pos_get () const
ulint undo ()
 runs all the undo actions in LIFO (reverse) order, returns number of them
void submit_undo (ptr< transaction > enclosing_tx)
 just hand over own undo list to the enclosing transaction
void add_undo_action (ptr< action > action)

Static Public Member Functions

static ptr< transactioncreate (const token_list_iterator &spos)

Protected Member Functions

 transaction (const token_list_iterator &spos)
void gc_mark ()
 Marks the keystone.

Protected Attributes

srp< action_list_typeundo_list
 list of actions that need to be done when this transaction is rolled back
const token_list_iterator start_pos

Detailed Description

Definition at line 146 of file manager.cc.


Constructor & Destructor Documentation

lestes::lang::cplus::syn::transaction::transaction ( const token_list_iterator spos  )  [inline, protected]

Definition at line 152 of file manager.cc.

00152                                                         : start_pos(spos)
00153         {
00154                 undo_list = action_list_type::create();
00155         }


Member Function Documentation

void lestes::lang::cplus::syn::transaction::gc_mark ( void   )  [inline, protected, virtual]

Marks the keystone.

Marks all directly reachable parts of the class. The method must be overriden for each inherited class. It should contain abc.gc_mark() for each field abc of the inherited class and call to gc_mark() of the direct ancestor of the class. Does nothing for keystone, only stops processing of ancestors.

Reimplemented from lestes::std::mem::keystone.

Definition at line 156 of file manager.cc.

00157         {
00158                 undo_list.gc_mark();
00159                 object::gc_mark();
00160         }

static ptr<transaction> lestes::lang::cplus::syn::transaction::create ( const token_list_iterator spos  )  [inline, static]

Definition at line 162 of file manager.cc.

Referenced by lestes::lang::cplus::syn::one_manager::start().

00163         {
00164                 return new transaction(spos);
00165         }

const token_list_iterator lestes::lang::cplus::syn::transaction::start_pos_get (  )  const [inline]

Definition at line 166 of file manager.cc.

00167         {
00168                 return start_pos;
00169         }

ulint lestes::lang::cplus::syn::transaction::undo (  )  [inline]

runs all the undo actions in LIFO (reverse) order, returns number of them

Definition at line 171 of file manager.cc.

00172         {
00173                 ulint result = 0;
00174                 for (action_list_type::reverse_iterator it = undo_list->rbegin();
00175                                 it != undo_list->rend();
00176                                 ++it, ++result )
00177                         (*it)->run();
00178                 return result;
00179         }

void lestes::lang::cplus::syn::transaction::submit_undo ( ptr< transaction enclosing_tx  )  [inline]

just hand over own undo list to the enclosing transaction

Definition at line 181 of file manager.cc.

References lassert.

00182         {
00183                 lassert( enclosing_tx );
00184                 enclosing_tx->undo_list->splice( enclosing_tx->undo_list->end(), *undo_list );
00185         }

void lestes::lang::cplus::syn::transaction::add_undo_action ( ptr< action action  )  [inline]

Definition at line 187 of file manager.cc.

References lassert.

00188         {
00189                 lassert( action );
00190                 undo_list->push_back( action );
00191         }


Member Data Documentation

srp<action_list_type> lestes::lang::cplus::syn::transaction::undo_list [protected]

list of actions that need to be done when this transaction is rolled back

Definition at line 149 of file manager.cc.

const token_list_iterator lestes::lang::cplus::syn::transaction::start_pos [protected]

Definition at line 150 of file manager.cc.


The documentation for this class was generated from the following file:
Generated on Mon Feb 12 18:25:38 2007 for lestes by doxygen 1.5.1-20070107