Quick API for atomically storing and retrieving collections of objects. More...
![]() |
Classes | |
class | hash_db::Database |
hash_db::Database More... | |
Functions | |
virtual void | hash_db::Database::getIds (OUT SetString &ids)=0 |
get IDs for all objects in database | |
virtual bool | hash_db::Database::addObject (IN const char *id, IN smart_ptr< Datahash > obj)=0 |
add the given object (hash) to the database with the given ID | |
virtual smart_ptr< Datahash > | hash_db::Database::getObject (IN const char *id)=0 |
retrieve the object with the specified ID | |
virtual bool | hash_db::Database::deleteObject (IN 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 (IN const char *db_file) |
create Database object from specified file |
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.
virtual void hash_db::Database::getIds | ( | OUT SetString & | ids | ) | [pure virtual, inherited] |
get IDs for all objects in database
virtual bool hash_db::Database::addObject | ( | IN const char * | id, | |
IN 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 | ( | IN const char * | id | ) | [pure virtual, inherited] |
retrieve the object with the specified ID
virtual bool hash_db::Database::deleteObject | ( | IN 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 | ( | IN const char * | db_file | ) | [static, inherited] |
create Database object from specified file
Definition at line 247 of file hash_db.cpp.