interreality.org [VOS]
[Home] [About]
[Screenshots]
[Download]
[News]
[Community]
[Documentation] [Manual]
[Bugs & Requests] [Wiki]

VOS::Persistance Class Reference
[libvos]

#include <vos/vos/persistance.hh>

Inheritance diagram for VOS::Persistance:

VOS::FileSystemPersistance VOS::SQLPersistance VOS::RevisionControlPersistance List of all members.

Detailed Description

An abstract interface for saving and loading blocks of data keyed by Vobject and a key string.

Generally added as a site extension, if you need to persist some data in your code do something like:

        if(Persistance* persist = site->queryExtension<Persistance>()) {
          // To save some data
          persist->saveBlock(myVobject, "my:key", myData);

          // To get it back
          persist->getBlock(myVobject, "my:key", myData);
        }

Definition at line 26 of file persistance.hh.

Public Member Functions

Protected Member Functions


Constructor & Destructor Documentation

virtual VOS::Persistance::~Persistance (  )  [inline, virtual]

Definition at line 33 of file persistance.hh.


Member Function Documentation

virtual void VOS::Persistance::beginTransaction (  )  [inline, virtual]

Indicate that you want the blocks saved between this call and endTransaction() to be be atomically committed or not at all.

Not actually implemented with all persistance extensions!

Reimplemented in VOS::FileSystemPersistance, and VOS::SQLPersistance.

Definition at line 39 of file persistance.hh.

virtual bool VOS::Persistance::blockExists ( Vobject from,
const std::string &  key 
) [pure virtual]

Test for the existance of a block.

Parameters:
from the Vobject associated with this data
key a key used to retrieve this data
Returns:
true if key was found, false if not

Implemented in VOS::FileSystemPersistance, and VOS::SQLPersistance.

virtual void VOS::Persistance::endTransaction (  )  [inline, virtual]

Commit any blocks saved since the last call to beginTransaction().

Not actually implementsed with all persistance extensions!

Reimplemented in VOS::FileSystemPersistance, and VOS::SQLPersistance.

Definition at line 44 of file persistance.hh.

virtual bool VOS::Persistance::getBlock ( Vobject from,
const std::string &  key,
std::string &  data 
) [pure virtual]

Retrieve a block to the persistance layer.

Parameters:
from the Vobject associated with this data
key a key used to retrieve this data
data the data will be stored in this string
Returns:
true if key was found and data retrieved, false if not

Implemented in VOS::FileSystemPersistance, VOS::RevisionControlPersistance, and VOS::SQLPersistance.

virtual bool VOS::Persistance::isLoadingDB (  )  [pure virtual]

Returns:
True if the persistance database is currently being loaded; generally during application startup. Code which saves blocks to the database in response to changes should check this flag to ensure that it does not try and save a blocks that was just read in from the database!

Implemented in VOS::FileSystemPersistance, and VOS::SQLPersistance.

virtual void VOS::Persistance::post_saveBlockNotifies ( Vobject from,
const std::string &  key,
const std::string &  data 
) [protected, virtual]

virtual bool VOS::Persistance::pre_saveBlockNotifies ( Vobject from,
const std::string &  key,
const std::string &  data 
) [protected, virtual]

virtual bool VOS::Persistance::removeBlock ( Vobject from,
const std::string &  key 
) [pure virtual]

Delete a block from the persistance layer.

Parameters:
from the Vobject associated with this data
key a key used to retrieve this data
Returns:
true if key was found and deleted, false if not

Implemented in VOS::FileSystemPersistance, and VOS::SQLPersistance.

virtual bool VOS::Persistance::saveBlock ( Vobject from,
const std::string &  key,
const std::string &  data 
) [virtual]

Save a block to the persistance layer.

Parameters:
from the Vobject associated with this data
key a key used to retrieve this data
data the data to be saved
Returns:
true if the save was successful, false if something went wrong

virtual bool VOS::Persistance::storeBlock ( Vobject from,
const std::string &  key,
const std::string &  data 
) [protected, pure virtual]


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