Data Structures | |
class | cdbpp::murmurhash2 |
MurmurHash2. More... | |
class | cdbpp::builder_exception |
Exception class for the CDB++ builder. More... | |
class | cdbpp::builder_base< hash_function > |
CDB++ builder. More... | |
class | cdbpp::cdbpp_exception |
Exception class for the CDB++ reader. More... | |
class | cdbpp::cdbpp_base< hash_function > |
CDB++ reader. More... | |
Typedefs | |
typedef builder_base< murmurhash2 > | cdbpp::builder |
CDB++ builder with MurmurHash2. | |
typedef cdbpp_base< murmurhash2 > | cdbpp::cdbpp |
CDB++ reader with MurmurHash2. | |
Functions | |
cdbpp::builder_base::builder_base (std::ofstream &os) | |
Constructs an object. | |
virtual | cdbpp::builder_base::~builder_base () |
Destructs an object. | |
template<class key_t, class value_t> | |
void | cdbpp::builder_base::put (const key_t *key, size_t ksize, const value_t *value, size_t vsize) |
Inserts a pair of key and value to the database. | |
cdbpp::cdbpp_base::cdbpp_base () | |
Constructs an object. | |
cdbpp::cdbpp_base::cdbpp_base (const void *buffer, size_t size, bool own) | |
Constructs an object by opening a database on memory. | |
cdbpp::cdbpp_base::cdbpp_base (std::ifstream &ifs) | |
Constructs an object by opening a database from an input stream. | |
virtual | cdbpp::cdbpp_base::~cdbpp_base () |
Destructs the object. | |
bool | cdbpp::cdbpp_base::is_open () const |
Tests if the database is opened. | |
size_t | cdbpp::cdbpp_base::size () const |
Obtains the number of elements in the database. | |
bool | cdbpp::cdbpp_base::empty () const |
Tests if the database is empty. | |
size_t | cdbpp::cdbpp_base::open (std::ifstream &ifs) |
Opens the database from an input stream. | |
size_t | cdbpp::cdbpp_base::open (const void *buffer, size_t size, bool own=false) |
Opens the database from a memory image. | |
void | cdbpp::cdbpp_base::close () |
Closes the database. | |
const void * | cdbpp::cdbpp_base::get (const void *key, size_t ksize, size_t *vsize) const |
Finds the key in the database. |
cdbpp::builder_base< hash_function >::builder_base | ( | std::ofstream & | os | ) | [inline, inherited] |
Constructs an object.
os | The output stream to which this class write the database. This stream must be opened in the binary mode (std::ios_base::binary ). |
cdbpp::cdbpp_base< hash_function >::cdbpp_base | ( | std::ifstream & | ifs | ) | [inline, inherited] |
Constructs an object by opening a database from an input stream.
ifs | The input stream from which this library reads a database. |
cdbpp::cdbpp_base< hash_function >::cdbpp_base | ( | const void * | buffer, | |
size_t | size, | |||
bool | own | |||
) | [inline, inherited] |
Constructs an object by opening a database on memory.
buffer | The pointer to the memory image of the database. | |
size | The size of the memory image. | |
own | If this is set to true , this library will call delete[] when the database is closed. |
bool cdbpp::cdbpp_base< hash_function >::empty | ( | ) | const [inline, inherited] |
Tests if the database is empty.
true
if the number of records is zero, false
otherwise. const void* cdbpp::cdbpp_base< hash_function >::get | ( | const void * | key, | |
size_t | ksize, | |||
size_t * | vsize | |||
) | const [inline, inherited] |
Finds the key in the database.
key | The pointer to the key. | |
ksize | The size of the key. | |
vsize | The pointer of a variable to which the size of the value returned. This parameter can be NULL . |
bool cdbpp::cdbpp_base< hash_function >::is_open | ( | ) | const [inline, inherited] |
Tests if the database is opened.
true
if the database is opened, false
otherwise. size_t cdbpp::cdbpp_base< hash_function >::open | ( | const void * | buffer, | |
size_t | size, | |||
bool | own = false | |||
) | [inline, inherited] |
Opens the database from a memory image.
buffer | The pointer to the memory image of the database. | |
size | The size of the memory image. | |
own | If this is set to true , this library will call delete[] when the database is closed. |
size_t cdbpp::cdbpp_base< hash_function >::open | ( | std::ifstream & | ifs | ) | [inline, inherited] |
Opens the database from an input stream.
ifs | The input stream from which this library reads a database. |
void cdbpp::builder_base< hash_function >::put | ( | const key_t * | key, | |
size_t | ksize, | |||
const value_t * | value, | |||
size_t | vsize | |||
) | [inline, inherited] |
Inserts a pair of key and value to the database.
Any key in the database should be unique, but this library does not check duplicated keys.
key | The pointer to the key. | |
ksize | The size of the key. | |
value | The pointer to the value. | |
vsize | The size of the value. |
size_t cdbpp::cdbpp_base< hash_function >::size | ( | ) | const [inline, inherited] |
Obtains the number of elements in the database.