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

NVHashIter Class Reference

#include <NVHash.h>

List of all members.

Public Member Functions

 NVHashIter ()
 NVHashIter (NVHash &nvl)
 ~NVHashIter ()
void attach (NVHash &nvl)
void detach ()
void first ()
int valid ()
void next ()
void data (const char **data, unsigned int *szdata)

Private Attributes

NVHashht
NVHash::Record * pos
NVHash::Record * curtail
unsigned long curhashval


Detailed Description

Author:
Thomas Gschwind
Bug:
Documentation is missing.

Definition at line 64 of file NVHash.h.


Constructor & Destructor Documentation

NVHashIter::NVHashIter  )  [inline]
 

Definition at line 70 of file NVHash.h.

References ht.

00070                       {
00071                 ht = NULL;
00072                 pos = NULL;
00073         } NVHashIter(NVHash & nvl) {

NVHashIter::NVHashIter NVHash nvl  )  [inline]
 

Definition at line 73 of file NVHash.h.

00073                                    {
00074                 ht = &nvl;
00075                 ht->lock(NVHash::ShrdLock);
00076                 pos = NULL;
00077         }

NVHashIter::~NVHashIter  )  [inline]
 

Definition at line 78 of file NVHash.h.

References detach().

00078                       {
00079                 detach();
00080         }


Member Function Documentation

void NVHashIter::attach NVHash nvl  )  [inline]
 

Definition at line 82 of file NVHash.h.

References detach(), ht, and NVcontainer::lock().

00082                                   {
00083                 detach();
00084                 ht = &nvl;
00085                 ht->lock(NVHash::ShrdLock);
00086                 pos = NULL;
00087         }

void NVHashIter::data const char **  data,
unsigned int *  szdata
[inline]
 

Definition at line 133 of file NVHash.h.

References ht, NVcontainer::mem_p, and NVlist::r2o().

Referenced by NVActiveDB::write().

00133                                                            {
00134                 (*data) =
00135                     ht->mem_p + ht->r2o(pos) + sizeof(NVHash::Record);
00136                 (*szdata) = pos->szdata;
00137         }

void NVHashIter::detach  )  [inline]
 

Definition at line 88 of file NVHash.h.

References ht, and NVcontainer::lock().

Referenced by attach(), and ~NVHashIter().

00088                       {
00089                 if (ht) {
00090                         ht->lock(NVHash::UnLock);
00091                 }
00092                 ht = NULL;
00093         }

void NVHashIter::first  )  [inline]
 

Definition at line 95 of file NVHash.h.

References curhashval, curtail, NVHash::hashsz, NVHash::hashtab, ht, and NVlist::o2r().

Referenced by NVActiveDB::write().

00095                      {
00096                 pos = NULL;
00097                 curhashval = 0;
00098                 while (curhashval < ht->hashsz) {
00099                         if (ht->hashtab[curhashval]) {
00100                                 curtail = ht->o2r(ht->hashtab[curhashval]);
00101                                 pos = ht->o2r(curtail->next);
00102                                 break;
00103                         }
00104                         curhashval++;
00105                 }
00106         }

void NVHashIter::next  )  [inline]
 

Definition at line 110 of file NVHash.h.

References curhashval, curtail, NVHash::hashsz, NVHash::hashtab, ht, and NVlist::o2r().

Referenced by NVActiveDB::write().

00110                     {
00111                 if (pos) {
00112                         if (pos == curtail) {
00113                                 pos = NULL;
00114                                 curhashval++;
00115                                 while (curhashval < ht->hashsz) {
00116                                         if (ht->hashtab[curhashval]) {
00117                                                 curtail =
00118                                                     ht->o2r(ht->
00119                                                             hashtab
00120                                                             [curhashval]);
00121                                                 pos =
00122                                                     ht->o2r(curtail->next);
00123                                                 break;
00124                                         }
00125                                         curhashval++;
00126                                 }
00127                         } else {
00128                                 pos = ht->o2r(pos->next);
00129                         }
00130                 }
00131         }

int NVHashIter::valid  )  [inline]
 

Definition at line 107 of file NVHash.h.

Referenced by NVActiveDB::write().

00107                     {
00108                 return pos != NULL;
00109         }


Member Data Documentation

unsigned long NVHashIter::curhashval [private]
 

Definition at line 68 of file NVHash.h.

Referenced by first(), and next().

NVHash::Record* NVHashIter::curtail [private]
 

Definition at line 67 of file NVHash.h.

Referenced by first(), and next().

NVHash* NVHashIter::ht [private]
 

Definition at line 65 of file NVHash.h.

Referenced by attach(), data(), detach(), first(), next(), and NVHashIter().

NVHash::Record* NVHashIter::pos [private]
 

Definition at line 66 of file NVHash.h.


The documentation for this class was generated from the following file:
Generated on Sun Oct 24 21:08:24 2004 for NewsCache by doxygen 1.3.6-20040222