Interface of database abstraction. More...
#include <kcdb.h>
Classes | |
| class | Cursor |
| Interface of cursor to indicate a record. More... | |
| class | Visitor |
| Interface to access a record. More... | |
Public Member Functions | |
| virtual | ~DB () |
| Destructor. | |
| virtual bool | accept (const char *kbuf, size_t ksiz, Visitor *visitor, bool writable=true)=0 |
| Accept a visitor to a record. | |
| virtual bool | set (const char *kbuf, size_t ksiz, const char *vbuf, size_t vsiz)=0 |
| Set the value of a record. | |
| virtual bool | set (const std::string &key, const std::string &value)=0 |
| Set the value of a record. | |
| virtual bool | add (const char *kbuf, size_t ksiz, const char *vbuf, size_t vsiz)=0 |
| Add a record. | |
| virtual bool | add (const std::string &key, const std::string &value)=0 |
| Set the value of a record. | |
| virtual bool | replace (const char *kbuf, size_t ksiz, const char *vbuf, size_t vsiz)=0 |
| Replace the value of a record. | |
| virtual bool | replace (const std::string &key, const std::string &value)=0 |
| Replace the value of a record. | |
| virtual bool | append (const char *kbuf, size_t ksiz, const char *vbuf, size_t vsiz)=0 |
| Append the value of a record. | |
| virtual bool | append (const std::string &key, const std::string &value)=0 |
| Set the value of a record. | |
| virtual int64_t | increment (const char *kbuf, size_t ksiz, int64_t num)=0 |
| Add a number to the numeric integer value of a record. | |
| virtual int64_t | increment (const std::string &key, int64_t num)=0 |
| Add a number to the numeric integer value of a record. | |
| virtual double | increment_double (const char *kbuf, size_t ksiz, double num)=0 |
| Add a number to the numeric double value of a record. | |
| virtual double | increment_double (const std::string &key, double num)=0 |
| Add a number to the numeric double value of a record. | |
| virtual bool | cas (const char *kbuf, size_t ksiz, const char *ovbuf, size_t ovsiz, const char *nvbuf, size_t nvsiz)=0 |
| Perform compare-and-swap. | |
| virtual bool | cas (const std::string &key, const std::string &ovalue, const std::string &nvalue)=0 |
| Perform compare-and-swap. | |
| virtual bool | remove (const char *kbuf, size_t ksiz)=0 |
| Remove a record. | |
| virtual bool | remove (const std::string &key)=0 |
| Remove a record. | |
| virtual char * | get (const char *kbuf, size_t ksiz, size_t *sp)=0 |
| Retrieve the value of a record. | |
| virtual std::string * | get (const std::string &key)=0 |
| Retrieve the value of a record. | |
| virtual int32_t | get (const char *kbuf, size_t ksiz, char *vbuf, size_t max)=0 |
| Retrieve the value of a record. | |
| virtual bool | clear ()=0 |
| Remove all records. | |
| virtual int64_t | count ()=0 |
| Get the number of records. | |
| virtual Cursor * | cursor ()=0 |
| Create a cursor object. | |
Interface of database abstraction.
| virtual kyotocabinet::DB::~DB | ( | ) | [virtual] |
Destructor.
| virtual bool kyotocabinet::DB::accept | ( | const char * | kbuf, | |
| size_t | ksiz, | |||
| Visitor * | visitor, | |||
| bool | writable = true | |||
| ) | [pure virtual] |
Accept a visitor to a record.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. | |
| visitor | a visitor object. | |
| writable | true for writable operation, or false for read-only operation. |
Implemented in kyotocabinet::CacheDB, kyotocabinet::DirDB, kyotocabinet::HashDB, kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::PolyDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, and kyotocabinet::StashDB.
| virtual bool kyotocabinet::DB::set | ( | const char * | kbuf, | |
| size_t | ksiz, | |||
| const char * | vbuf, | |||
| size_t | vsiz | |||
| ) | [pure virtual] |
Set the value of a record.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. | |
| vbuf | the pointer to the value region. | |
| vsiz | the size of the value region. |
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::set | ( | const std::string & | key, | |
| const std::string & | value | |||
| ) | [pure virtual] |
Set the value of a record.
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::add | ( | const char * | kbuf, | |
| size_t | ksiz, | |||
| const char * | vbuf, | |||
| size_t | vsiz | |||
| ) | [pure virtual] |
Add a record.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. | |
| vbuf | the pointer to the value region. | |
| vsiz | the size of the value region. |
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::add | ( | const std::string & | key, | |
| const std::string & | value | |||
| ) | [pure virtual] |
Set the value of a record.
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::replace | ( | const char * | kbuf, | |
| size_t | ksiz, | |||
| const char * | vbuf, | |||
| size_t | vsiz | |||
| ) | [pure virtual] |
Replace the value of a record.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. | |
| vbuf | the pointer to the value region. | |
| vsiz | the size of the value region. |
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::replace | ( | const std::string & | key, | |
| const std::string & | value | |||
| ) | [pure virtual] |
Replace the value of a record.
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::append | ( | const char * | kbuf, | |
| size_t | ksiz, | |||
| const char * | vbuf, | |||
| size_t | vsiz | |||
| ) | [pure virtual] |
Append the value of a record.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. | |
| vbuf | the pointer to the value region. | |
| vsiz | the size of the value region. |
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::append | ( | const std::string & | key, | |
| const std::string & | value | |||
| ) | [pure virtual] |
Set the value of a record.
Implemented in kyotocabinet::BasicDB.
| virtual int64_t kyotocabinet::DB::increment | ( | const char * | kbuf, | |
| size_t | ksiz, | |||
| int64_t | num | |||
| ) | [pure virtual] |
Add a number to the numeric integer value of a record.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. | |
| num | the additional number. |
Implemented in kyotocabinet::BasicDB.
| virtual int64_t kyotocabinet::DB::increment | ( | const std::string & | key, | |
| int64_t | num | |||
| ) | [pure virtual] |
Add a number to the numeric integer value of a record.
Implemented in kyotocabinet::BasicDB.
| virtual double kyotocabinet::DB::increment_double | ( | const char * | kbuf, | |
| size_t | ksiz, | |||
| double | num | |||
| ) | [pure virtual] |
Add a number to the numeric double value of a record.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. | |
| num | the additional number. |
Implemented in kyotocabinet::BasicDB.
| virtual double kyotocabinet::DB::increment_double | ( | const std::string & | key, | |
| double | num | |||
| ) | [pure virtual] |
Add a number to the numeric double value of a record.
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::cas | ( | const char * | kbuf, | |
| size_t | ksiz, | |||
| const char * | ovbuf, | |||
| size_t | ovsiz, | |||
| const char * | nvbuf, | |||
| size_t | nvsiz | |||
| ) | [pure virtual] |
Perform compare-and-swap.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. | |
| ovbuf | the pointer to the old value region. NULL means that no record corresponds. | |
| ovsiz | the size of the old value region. | |
| nvbuf | the pointer to the new value region. NULL means that the record is removed. | |
| nvsiz | the size of new old value region. |
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::cas | ( | const std::string & | key, | |
| const std::string & | ovalue, | |||
| const std::string & | nvalue | |||
| ) | [pure virtual] |
Perform compare-and-swap.
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::remove | ( | const char * | kbuf, | |
| size_t | ksiz | |||
| ) | [pure virtual] |
Remove a record.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. |
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::remove | ( | const std::string & | key | ) | [pure virtual] |
Remove a record.
Implemented in kyotocabinet::BasicDB.
| virtual char* kyotocabinet::DB::get | ( | const char * | kbuf, | |
| size_t | ksiz, | |||
| size_t * | sp | |||
| ) | [pure virtual] |
Retrieve the value of a record.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. | |
| sp | the pointer to the variable into which the size of the region of the return value is assigned. |
Implemented in kyotocabinet::BasicDB.
| virtual std::string* kyotocabinet::DB::get | ( | const std::string & | key | ) | [pure virtual] |
Retrieve the value of a record.
Implemented in kyotocabinet::BasicDB.
| virtual int32_t kyotocabinet::DB::get | ( | const char * | kbuf, | |
| size_t | ksiz, | |||
| char * | vbuf, | |||
| size_t | max | |||
| ) | [pure virtual] |
Retrieve the value of a record.
| kbuf | the pointer to the key region. | |
| ksiz | the size of the key region. | |
| vbuf | the pointer to the buffer into which the value of the corresponding record is written. | |
| max | the size of the buffer. |
Implemented in kyotocabinet::BasicDB.
| virtual bool kyotocabinet::DB::clear | ( | ) | [pure virtual] |
Remove all records.
Implemented in kyotocabinet::CacheDB, kyotocabinet::DirDB, kyotocabinet::HashDB, kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::PolyDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, and kyotocabinet::StashDB.
| virtual int64_t kyotocabinet::DB::count | ( | ) | [pure virtual] |
Get the number of records.
Implemented in kyotocabinet::CacheDB, kyotocabinet::DirDB, kyotocabinet::HashDB, kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::PolyDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, and kyotocabinet::StashDB.
| virtual Cursor* kyotocabinet::DB::cursor | ( | ) | [pure virtual] |
Create a cursor object.
Implemented in kyotocabinet::CacheDB, kyotocabinet::BasicDB, kyotocabinet::DirDB, kyotocabinet::HashDB, kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::PolyDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, and kyotocabinet::StashDB.
1.6.3