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

NVlist.h

Go to the documentation of this file.
00001 #ifndef _NVlist_h_
00002 #define _NVlist_h_
00003 
00004 #include"NVcontainer.h"
00005 
00006 #include<iostream>
00007 
00014 class NVlist:public NVcontainer {
00015       protected:
00016         NVlist(void):NVcontainer() {
00017         } NVlist(const char *dbname, int flags =
00018                  0):NVcontainer(dbname, flags) {
00019         }
00020         struct Record {
00021                 unsigned long next;     /* 64 */
00022                 unsigned long szdata;   /* 64 */
00023                 // Data follows here
00024                 char *datap() {
00025                         return ((char *) this) + sizeof(Record);
00026         }};
00027 
00028         Record *o2r(nvoff_t o) {
00029                 return (Record *) (o ? mem_p + o : NULL);
00030         }
00031         nvoff_t r2o(Record * r) {
00032                 return r ? (char *) r - mem_p : 0;
00033         }
00034 
00035         int sis_empty(nvoff_t proot) {
00036                 return *(nvoff_t *) (mem_p + proot) == 0;
00037         }
00038         void sprepend(nvoff_t proot, const char *data, size_t szdata);
00039         void sappend(nvoff_t proot, const char *data, size_t szdata);
00040         void sremove(nvoff_t proot);
00041         void sclear(nvoff_t proot);
00042         void sprint(nvoff_t proot, std::ostream & os);
00043 };
00044 
00045 #endif

Generated on Sun Oct 24 21:08:19 2004 for NewsCache by doxygen 1.3.6-20040222