ecolab::cachedDBM_base< key, val > Class Template Reference

implementation of cacheDBM common to all specialisations More...

#include <cachedDBM.h>

Inheritance diagram for ecolab::cachedDBM_base< key, val >:
Inheritance graph
Collaboration diagram for ecolab::cachedDBM_base< key, val >:
Collaboration graph

Classes

class  KeyIterator
 
struct  Keys
 
class  KeyValueIterator
 iterator type for iterating over keys More...
 

Public Member Functions

void init (const char *fname, char mode='w')
 
void Init (TCL_args args)
 
void close ()
 
bool opened () const
 
bool load (const key &k)
 
bool key_exists (const key &k) const
 returns true if key is in data base or added with [] operator
 
val & operator[] (const key &k)
 
val elem (TCL_args args)
 
size_t cacheSize () const
 number of elements in cache
 
void clear ()
 clear the cache
 
void commit ()
 write any changes out to the file, and clear some of the cache
 
void del (key k)
 delete entry associated with key k
 
key firstkey () const
 obtain first key for iteration through database. More...
 
key nextkey () const
 advance to next key in database
 
bool eof () const
 true if no further keys remain when iterating
 
void pack (classdesc::pack_t &b)
 
void unpack (classdesc::pack_t &b)
 
KeyValueIterator begin () const
 
KeyValueIterator begin ()
 
KeyValueIterator end () const
 

Public Attributes

size_t max_elem
 
Keys keys
 access an iterator range of keys [keys.begin()...keys.end())
 

Additional Inherited Members

- Protected Member Functions inherited from ecolab::base_map< key, val >
void set (const key &k, Datum &v)
 
val & get (const key &k)
 

Detailed Description

template<class key, class val>
class ecolab::cachedDBM_base< key, val >

implementation of cacheDBM common to all specialisations

Member Function Documentation

◆ elem()

template<class key, class val>
val ecolab::cachedDBM_base< key, val >::elem ( TCL_args  args)
inline

TCL accessor version of [].

elem x

returns the value of

(*this)[x]

.

elem x y

does

return (*this)[x]=y

.

◆ firstkey()

template<class key, class val>
key ecolab::cachedDBM_base< key, val >::firstkey ( ) const
inline

obtain first key for iteration through database.

iterators are inherently not thread safe


The documentation for this class was generated from the following file: