stldb::TransactionalOperation
// In header: </Users/bobw/workspace/stldb_lib/stldb/transaction.h> class TransactionalOperation : public boost::intrusive::list_base_hook< optimize_size< false > > { public: // construct/copy/destruct ~TransactionalOperation(); // public member functions const char * get_container_name() const; int get_op_code() const; int add_to_log(boost_oarchive_t &) ; void commit(Transaction &) ; void rollback(Transaction &) ; void recover(boost_iarchive_t &) ; template<typename boost_archive_out> void serialize_header(boost_archive_out &) ; // public static functions template<typename boost_archive_in> static std::pair< std::string, int > deserialize_header(boost_archive_in &) ; };
A transaction accumulates a set of TransactionalOperations, and a TransactionalOperation is any object implementing this interface. This polymorphic approach is used so that when the transaction is committed, the transaction commit or rollback can be done by a generic bit of code which uses that polymorphism.
TransactionalOperation
public member functionsconst char * get_container_name() const;
int get_op_code() const;
int add_to_log(boost_oarchive_t & buffer) ;
void commit(Transaction & trans) ;
void rollback(Transaction & trans) ;
void recover(boost_iarchive_t & stream) ;
template<typename boost_archive_out> void serialize_header(boost_archive_out & s) ;