Classes | Functions

Simple Hash Database API
[Datahash Libraries]

Quick API for atomically storing and retrieving collections of objects. More...

Collaboration diagram for Simple Hash Database API:

Classes

class  hash_db::Database
 hash_db::Database More...

Functions

virtual void hash_db::Database::getIds (SetString &ids)=0
 get IDs for all objects in database
virtual bool hash_db::Database::addObject (const char *id, smart_ptr< Datahash > obj)=0
 add the given object (hash) to the database with the given ID
virtual smart_ptr< Datahashhash_db::Database::getObject (const char *id)=0
 retrieve the object with the specified ID
virtual bool hash_db::Database::deleteObject (const char *id)=0
 delete the object with the specified ID
virtual bool hash_db::Database::commit (void)=0
 commit all outstanding changes
static smart_ptr< Database > hash_db::Database::create (const char *db_file)
 create Database object from specified file

Detailed Description

Quick API for atomically storing and retrieving collections of objects.

This is NOT scalable! Do not use for storage of lots of objects, or high performance, etc. This is a quick-and-dirty implementation for atomic storage of a small number of small objects.

Similar to BerkelyDB model: you can get and put objects based on a client- defined ID.


Function Documentation

virtual void hash_db::Database::getIds ( SetString ids  )  [pure virtual, inherited]

get IDs for all objects in database

virtual bool hash_db::Database::addObject ( const char *  id,
smart_ptr< Datahash obj 
) [pure virtual, inherited]

add the given object (hash) to the database with the given ID

virtual smart_ptr<Datahash> hash_db::Database::getObject ( const char *  id  )  [pure virtual, inherited]

retrieve the object with the specified ID

virtual bool hash_db::Database::deleteObject ( const char *  id  )  [pure virtual, inherited]

delete the object with the specified ID

virtual bool hash_db::Database::commit ( void   )  [pure virtual, inherited]

commit all outstanding changes

smart_ptr< Database > hash_db::Database::create ( const char *  db_file  )  [static, inherited]

create Database object from specified file

Definition at line 245 of file hash_db.cpp.