strus  0.17
Public Member Functions | List of all members
strus::DatabaseTransactionInterface Class Referenceabstract

Interface for transactions for writing on the strus key value storage database. More...

#include <databaseTransactionInterface.hpp>

Public Member Functions

virtual ~DatabaseTransactionInterface ()
 Destructor. More...
 
virtual DatabaseCursorInterfacecreateCursor (const DatabaseOptions &options) const =0
 Get an interface for reading values in the context of this transaction. More...
 
virtual void write (const char *key, std::size_t keysize, const char *value, std::size_t valuesize)=0
 Define a key/value pair to be written to the database as part of this transaction. More...
 
virtual void remove (const char *key, std::size_t keysize)=0
 Define a key to be deleted in the database as part of this transaction. More...
 
virtual void removeSubTree (const char *domainkey, std::size_t domainkeysize)=0
 Define a set of nodes defined by a key prefix to be deleted in the database as part of this transaction. More...
 
virtual bool commit ()=0
 Executes all commands defined in the transaction or none if one operation fails. More...
 
virtual void rollback ()=0
 Rollback of the transaction, no changes made. More...
 

Detailed Description

Interface for transactions for writing on the strus key value storage database.

Constructor & Destructor Documentation

virtual strus::DatabaseTransactionInterface::~DatabaseTransactionInterface ( )
inlinevirtual

Destructor.

Remarks
Expected to do an implicit rollback, if neither 'commit()' or 'rollback' was called

Member Function Documentation

virtual bool strus::DatabaseTransactionInterface::commit ( )
pure virtual

Executes all commands defined in the transaction or none if one operation fails.

virtual DatabaseCursorInterface* strus::DatabaseTransactionInterface::createCursor ( const DatabaseOptions options) const
pure virtual

Get an interface for reading values in the context of this transaction.

Parameters
[in]optionssome hints how to access the key/value elements or blocks (e.g. fill LRU cache of not)
Returns
the created cursor interface to be disposed with delete by the caller
virtual void strus::DatabaseTransactionInterface::remove ( const char *  key,
std::size_t  keysize 
)
pure virtual

Define a key to be deleted in the database as part of this transaction.

Parameters
[in]keypointer to the key to delete
[in]keysizesize of 'key' in bytes
virtual void strus::DatabaseTransactionInterface::removeSubTree ( const char *  domainkey,
std::size_t  domainkeysize 
)
pure virtual

Define a set of nodes defined by a key prefix to be deleted in the database as part of this transaction.

Parameters
[in]domainkeypointer to the key prefix to delete
[in]domainkeysizesize of 'domainkey' in bytes
virtual void strus::DatabaseTransactionInterface::rollback ( )
pure virtual

Rollback of the transaction, no changes made.

virtual void strus::DatabaseTransactionInterface::write ( const char *  key,
std::size_t  keysize,
const char *  value,
std::size_t  valuesize 
)
pure virtual

Define a key/value pair to be written to the database as part of this transaction.

Parameters
[in]keypointer to the key to write
[in]keysizesize of 'key' in bytes
[in]valuepointer to the value to write
[in]valuesizesize of 'value' in bytes
Note
Will replace existing duplicate entry in the database (not issuing an error)

The documentation for this class was generated from the following file: