Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | 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


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 WvGdbmList< T >::init(), and 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(), WvGdbmList< T >::Link::data(), WvGdbmList< T >::HEAD, WvGdbmList< T >::retrieve(), WvGdbmList< T >::save(), WvGdbmList< T >::saved, and WvGdbmList< T >::TAIL.

Referenced by WvGdbmList< T >::append(), and WvGdbmList< T >::prepend().

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.

References WvGdbmList< T >::add_after(), WvGdbmList< T >::retrieve(), and WvGdbmList< T >::TAIL.

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.

References WvGdbmList< T >::add_after(), WvGdbmList< T >::retrieve(), and WvGdbmList< T >::TAIL.

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

Definition at line 179 of file wvgdbmlist.h.

References WvGdbmList< T >::HEAD, and WvGdbmList< T >::retrieve().

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

Definition at line 192 of file wvgdbmlist.h.

References WvGdbmList< T >::Link::data(), WvGdbmList< T >::HEAD, WvGdbmList< T >::retrieve(), and WvGdbmList< T >::saved.

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

Definition at line 162 of file wvgdbmlist.h.

References WvGdbmHash< K, D >::exists(), WvGdbmList< T >::HEAD, WvGdbmList< T >::TAIL, and WvGdbmList< T >::zap().

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

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

Definition at line 187 of file wvgdbmlist.h.

References WvGdbmList< T >::HEAD, and WvGdbmList< T >::retrieve().

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

Definition at line 199 of file wvgdbmlist.h.

References WvGdbmList< T >::Link::data(), WvGdbmList< T >::retrieve(), WvGdbmList< T >::saved, and WvGdbmList< T >::TAIL.

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.

References WvGdbmList< T >::add_after(), and WvGdbmList< T >::HEAD.

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.

References WvGdbmList< T >::add_after(), and WvGdbmList< T >::HEAD.

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

Definition at line 137 of file wvgdbmlist.h.

References WvGdbmList< T >::Link::buf, WvGdbmList< T >::Link::next, WvGdbmList< T >::saved, and WvGdbmList< T >::Link::zap().

Referenced by WvGdbmList< T >::add_after(), WvGdbmList< T >::append(), WvGdbmList< T >::count(), WvGdbmList< T >::first(), WvGdbmList< T >::isempty(), WvGdbmList< T >::last(), WvGdbmList< T >::Iter::next(), WvGdbmList< T >::Iter::rewind(), WvGdbmList< T >::Iter::unlink(), and WvGdbmList< T >::unlink_after().

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.

Referenced by WvGdbmList< T >::add_after(), WvGdbmList< T >::unlink_after(), and WvGdbmList< T >::zap().

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

Definition at line 241 of file wvgdbmlist.h.

References WvGdbmList< T >::Link::data(), WvGdbmList< T >::HEAD, WvGdbmList< T >::retrieve(), WvGdbmList< T >::save(), WvGdbmList< T >::saved, WvGdbmList< T >::TAIL, and WvGdbmAlloc::unalloc().

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

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

Definition at line 238 of file wvgdbmlist.h.

References WvGdbmList< T >::HEAD, and WvGdbmList< T >::unlink_after().

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

Definition at line 171 of file wvgdbmlist.h.

References WvGdbmHash< K, D >::exists(), WvGdbmList< T >::HEAD, WvGdbmList< T >::save(), WvGdbmList< T >::TAIL, and WvGdbmAlloc::zap().

Referenced by WvGdbmList< T >::init().


Member Data Documentation

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

Referenced by WvGdbmList< T >::add_after(), WvGdbmList< T >::first(), WvGdbmList< T >::last(), WvGdbmList< T >::Iter::ptr(), WvGdbmList< T >::retrieve(), and WvGdbmList< T >::unlink_after().


The documentation for this class was generated from the following file:
Generated on Sat Mar 13 14:57:52 2004 for WvStreams by doxygen 1.3.6-20040222