Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

WvGdbmList< T > Class Template Reference

#include <wvgdbmlist.h>

Collaboration diagram for WvGdbmList< T >:

[legend]
List of all members.

Detailed Description

template<typename T>
class WvGdbmList< T >

A class similar to WvList, but storing its values on disk in a WvGdbmHash.

FIXME: I have no idea if this is fast, slow, stupid, or ingenious. I suspect it's probably quite inefficient - doing it entirely without gdbm and writing our own space allocator would probably make more sense.

FIXME: we should use a common non-templated base class rather than implementing everything inline.

FIXME: if HEAD and TAIL weren't hardcoded, we could put more than one list in the same WvGdbmHash. This would probably be pretty useful.

Definition at line 95 of file wvgdbmlist.h.

Public Types

enum  { HEAD = 0, TAIL = -1000 }

Public Member Functions

Index retrieve (Index i)
void save (Index i, Index next, const T *data)
 WvGdbmList (WvStringParm filename)
void init ()
void zap ()
size_t count ()
bool isempty ()
Tfirst ()
Tlast ()
void add_after (Index after, const T *data, bool auto_free=false, void *id=NULL)
void append (const T &data, bool auto_free=false, void *id=NULL)
void prepend (const T &data, bool auto_free=false, void *id=NULL)
void append (const T *data, bool auto_free=false, void *id=NULL)
void prepend (const T *data, bool auto_free=false, void *id=NULL)
void unlink_first ()
void unlink_after (Index prev)

Public Attributes

WvGdbmList::Link saved

Friends

class WvGdbmList::Iter


Member Enumeration Documentation

template<typename T>
anonymous enum
 

Enumeration values:
HEAD 
TAIL 

Definition at line 105 of file wvgdbmlist.h.


Constructor & Destructor Documentation

template<typename T>
WvGdbmList< T >::WvGdbmList WvStringParm  filename  )  [inline]
 

Definition at line 157 of file wvgdbmlist.h.

References WvStringParm.


Member Function Documentation

template<typename T>
void WvGdbmList< T >::add_after Index  after,
const T data,
bool  auto_free = false,
void *  id = NULL
[inline]
 

Definition at line 207 of file wvgdbmlist.h.

References WvGdbmAlloc::alloc().

template<typename T>
void WvGdbmList< T >::append const T data,
bool  auto_free = false,
void *  id = NULL
[inline]
 

Definition at line 227 of file wvgdbmlist.h.

template<typename T>
void WvGdbmList< T >::append const T data,
bool  auto_free = false,
void *  id = NULL
[inline]
 

Definition at line 222 of file wvgdbmlist.h.

template<typename T>
size_t WvGdbmList< T >::count  )  [inline]
 

Definition at line 179 of file wvgdbmlist.h.

template<typename T>
T* WvGdbmList< T >::first  )  [inline]
 

Definition at line 192 of file wvgdbmlist.h.

template<typename T>
void WvGdbmList< T >::init  )  [inline]
 

Definition at line 162 of file wvgdbmlist.h.

References WvGdbmHash< K, D >::exists().

template<typename T>
bool WvGdbmList< T >::isempty  )  [inline]
 

Definition at line 187 of file wvgdbmlist.h.

template<typename T>
T* WvGdbmList< T >::last  )  [inline]
 

Definition at line 199 of file wvgdbmlist.h.

template<typename T>
void WvGdbmList< T >::prepend const T data,
bool  auto_free = false,
void *  id = NULL
[inline]
 

Definition at line 229 of file wvgdbmlist.h.

template<typename T>
void WvGdbmList< T >::prepend const T data,
bool  auto_free = false,
void *  id = NULL
[inline]
 

Definition at line 224 of file wvgdbmlist.h.

template<typename T>
Index WvGdbmList< T >::retrieve Index  i  )  [inline]
 

Definition at line 137 of file wvgdbmlist.h.

Referenced by WvGdbmList< T >::Iter::next(), WvGdbmList< T >::Iter::rewind(), and WvGdbmList< T >::Iter::unlink().

template<typename T>
void WvGdbmList< T >::save Index  i,
Index  next,
const T data
[inline]
 

Definition at line 146 of file wvgdbmlist.h.

References WvGdbmHash< K, D >::add(), wv_serialize(), and WvDynBuf.

template<typename T>
void WvGdbmList< T >::unlink_after Index  prev  )  [inline]
 

Definition at line 241 of file wvgdbmlist.h.

References WvGdbmAlloc::unalloc().

Referenced by WvGdbmList< T >::Iter::unlink(), and WvGdbmList< T >::Iter::xunlink().

template<typename T>
void WvGdbmList< T >::unlink_first  )  [inline]
 

Definition at line 238 of file wvgdbmlist.h.

template<typename T>
void WvGdbmList< T >::zap  )  [inline]
 

Definition at line 171 of file wvgdbmlist.h.

References WvGdbmHash< K, D >::exists(), and WvGdbmAlloc::zap().


Friends And Related Function Documentation

template<typename T>
friend class WvGdbmList::Iter [friend]
 

Definition at line 103 of file wvgdbmlist.h.


Member Data Documentation

template<typename T>
struct WvGdbmList::Link WvGdbmList< T >::saved
 

Referenced by WvGdbmList< T >::Iter::ptr().


The documentation for this class was generated from the following file:
Generated on Wed Dec 15 15:08:18 2004 for WvStreams by  doxygen 1.3.9.1