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

NVList.cc

Go to the documentation of this file.
00001 #include"NVList.h"
00002 #include"Error.h"
00003 
00004 #include<fcntl.h>
00005 #include<sys/mman.h>
00006 #include<sys/stat.h>
00007 #include<sys/types.h>
00008 
00009 using namespace std;
00010 
00011 int NVList::is_empty()
00012 {
00013         int r;
00014         lock(ShrdLock);
00015         r = sis_empty(getdatap());
00016         lock(UnLock);
00017         return r;
00018 }
00019 
00020 void NVList::prepend(const char *data, size_t szdata)
00021 {
00022         lock(ExclLock);
00023         sprepend(getdatap(), data, szdata);
00024         lock(UnLock);
00025 }
00026 
00027 void NVList::append(const char *data, size_t szdata)
00028 {
00029         lock(ExclLock);
00030         sappend(getdatap(), data, szdata);
00031         lock(UnLock);
00032 }
00033 
00034 void NVList::remove()
00035 {
00036         if (getdata()) {
00037                 lock(ExclLock);
00038                 sremove(getdatap());
00039                 lock(UnLock);
00040         }
00041 }
00042 
00043 void NVList::clear()
00044 {
00045         lock(ExclLock);
00046         sclear(getdatap());
00047         lock(UnLock);
00048 }
00049 
00050 void NVList::print(ostream & os)
00051 {
00052         lock(ShrdLock);
00053         sprint(getdatap(), os);
00054         lock(UnLock);
00055 }

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