Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Keyfile Class Reference

#include <Keyfile.hpp>

List of all members.

Public Types

enum  access_mode { random, sequential }
 Random or sequential access b-tree. More...


Public Methods

void put (const char *key, const void *value, int valueSize)
void put (int key, const void *value, int valueSize)
bool get (const char *key, void *value, int &actualSize, int maxSize)
bool get (const char *key, char **value, int &actualSize)
bool get (int key, void *value, int &actualSize, int maxSize)
bool get (int key, char **value, int &actualSize)
int getSize (const char *key)
int getSize (int key)
void remove (const char *key)
 Remove the entry in the b-tree for the given key.

void remove (int key)
 Remove the entry in the b-tree for the given key.

void open (const std::string &filename, access_mode mode, int cacheSize=1024 *1024)
void open (const char *filename, access_mode mode, int cacheSize=1024 *1024)
void create (const std::string &filename, access_mode mode, int cacheSize=1024 *1024)
void create (const char *filename, access_mode mode, int cacheSize=1024 *1024)
void close ()
 Close a keyfile.


Private Methods

void _buildHandle (int cacheSize)
void _createKey (char *keyBuf, int number)
int _decodeKey (char *keyBuf)

Private Attributes

std::auto_ptr< char > _handle
int _handleSize


Detailed Description

Provides C++ interface to the keyfile b-tree package. Arbitrary data can be stored using either int or char * keys.


Member Enumeration Documentation

enum Keyfile::access_mode
 

Random or sequential access b-tree.

Enumeration values:
random 
sequential 


Member Function Documentation

void Keyfile::_buildHandle int    cacheSize [private]
 

void Keyfile::_createKey char *    keyBuf,
int    number
[inline, private]
 

int Keyfile::_decodeKey char *    keyBuf [inline, private]
 

void Keyfile::close  
 

Close a keyfile.

void Keyfile::create const char *    filename,
access_mode    mode,
int    cacheSize = 1024 *1024
 

Create a keyfile with the given filename, with access_mode of random or sequential, and cacheSize (default 1MB).

void Keyfile::create const std::string &    filename,
access_mode    mode,
int    cacheSize = 1024 *1024
 

Createa keyfile with the given filename, with access_mode of random or sequential, and cacheSize (default 1MB).

bool Keyfile::get int    key,
char **    value,
int &    actualSize
 

Retrieve the value in the b-tree for the given key. Returns false if key does not exist in the b-tree.

bool Keyfile::get int    key,
void *    value,
int &    actualSize,
int    maxSize
 

Retrieve the value in the b-tree for the given key. Returns false if key does not exist in the b-tree.

bool Keyfile::get const char *    key,
char **    value,
int &    actualSize
 

Retrieve the value in the b-tree for the given key. Returns false if key does not exist in the b-tree.

bool Keyfile::get const char *    key,
void *    value,
int &    actualSize,
int    maxSize
 

Retrieve the value in the b-tree for the given key. Returns false if key does not exist in the b-tree.

int Keyfile::getSize int    key
 

Return the size of the data in the b-tree for the given key. Returns -1 if key does not exist in the b-tree.

int Keyfile::getSize const char *    key
 

Return the size of the data in the b-tree for the given key. Returns -1 if key does not exist in the b-tree.

void Keyfile::open const char *    filename,
access_mode    mode,
int    cacheSize = 1024 *1024
 

Open a keyfile with the given filename, with access_mode of random or sequential, and cacheSize (default 1MB).

void Keyfile::open const std::string &    filename,
access_mode    mode,
int    cacheSize = 1024 *1024
 

Open a keyfile with the given filename, with access_mode of random or sequential, and cacheSize (default 1MB).

void Keyfile::put int    key,
const void *    value,
int    valueSize
 

Insert value into b-tree for the given key. Throws an Exception if the operation fails.

void Keyfile::put const char *    key,
const void *    value,
int    valueSize
 

Insert value into b-tree for the given key. Throws an Exception if the operation fails.

void Keyfile::remove int    key
 

Remove the entry in the b-tree for the given key.

void Keyfile::remove const char *    key
 

Remove the entry in the b-tree for the given key.


Member Data Documentation

std::auto_ptr<char> Keyfile::_handle [private]
 

int Keyfile::_handleSize [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Feb 6 07:12:03 2004 for LEMUR by doxygen1.2.16