#include <NVActiveDB.h>
Inheritance diagram for NVActiveDB_Iter:

Public Member Functions | |
| _Iter< GroupInfo > * | clone () |
| GroupInfo * | get () |
| void | next () |
| bool | equals (_Iter< GroupInfo > *iter) |
Private Member Functions | |
| void | _skip_nulls () |
| NVActiveDB_Iter (NVActiveDB *db, bool begin) | |
Private Attributes | |
| NVActiveDB * | active_database |
| unsigned long | hash_val |
| NVActiveDB::Record * | pos |
| NVActiveDB::Record * | tail |
| GroupInfo | newsgroup |
|
||||||||||||
|
Definition at line 170 of file NVActiveDB.h. References _skip_nulls(), active_database, hash_val, NVHash::hashsz, and pos. Referenced by clone().
00170 :active_database(db) 00171 { 00172 _type = 1; 00173 00174 pos = NULL; 00175 hash_val = begin ? 0 : active_database->hashsz; 00176 _skip_nulls(); 00177 } |
|
|
Definition at line 156 of file NVActiveDB.h. References active_database, hash_val, NVHash::hashsz, NVHash::hashtab, NVlist::o2r(), pos, and tail. Referenced by NVActiveDB_Iter().
00156 {
00157 while (hash_val < active_database->hashsz) {
00158 if (active_database->hashtab[hash_val]) {
00159 tail =
00160 active_database->o2r(active_database->
00161 hashtab
00162 [hash_val]);
00163 pos = active_database->o2r(tail->next);
00164 break;
00165 }
00166 hash_val++;
00167 }
00168 }
|
|
|
Implements _Iter< GroupInfo >. Definition at line 180 of file NVActiveDB.h. References NVActiveDB_Iter().
00180 {
00181 return new NVActiveDB_Iter(*this);
00182 }
|
|
|
Definition at line 211 of file NVActiveDB.h. References _Iter< GroupInfo >::_type, active_database, and pos.
00211 {
00212 NVActiveDB_Iter *active_iter = (NVActiveDB_Iter *) iter;
00213
00214 return active_iter->_type == 1 &&
00215 active_iter->active_database == this->active_database
00216 && active_iter->pos == this->pos;
00217 }
|
|
|
Implements _Iter< GroupInfo >. Definition at line 184 of file NVActiveDB.h. References active_database, NVcontainer::mem_p, newsgroup, pos, NVlist::r2o(), and GroupInfo::setraw().
00184 {
00185 char *data;
00186 int datasz;
00187
00188 data = active_database->mem_p +
00189 active_database->r2o(pos) + sizeof(NVActiveDB::Record);
00190 datasz = pos->szdata;
00191
00192 newsgroup.setraw(data, datasz);
00193 return &newsgroup;
00194 }
|
|
|
Implements _Iter< GroupInfo >. Definition at line 196 of file NVActiveDB.h. References active_database, ASSERT, hash_val, NVHash::hashsz, Logger::p(), and slog.
00196 {
00197 ASSERT(if (hash_val == active_database->hashsz) {
00198 slog.p(Logger::Critical) << "iterator past end\n";
00199 return;}
00200 );
00201
00202 if (pos == tail) {
00203 pos = NULL;
00204 hash_val++;
00205 _skip_nulls();
00206 } else {
00207 pos = active_database->o2r(pos->next);
00208 }
00209 }
|
|
|
Definition at line 147 of file NVActiveDB.h. Referenced by _skip_nulls(), equals(), get(), next(), and NVActiveDB_Iter(). |
|
|
Definition at line 149 of file NVActiveDB.h. Referenced by _skip_nulls(), next(), and NVActiveDB_Iter(). |
|
|
Definition at line 153 of file NVActiveDB.h. Referenced by get(). |
|
|
Definition at line 150 of file NVActiveDB.h. Referenced by _skip_nulls(), equals(), get(), and NVActiveDB_Iter(). |
|
|
Definition at line 151 of file NVActiveDB.h. Referenced by _skip_nulls(). |
1.3.6-20040222