19 #include "MemoryMapArray.h" 21 void MemoryMapArrayHeader::debugPrint(FILE *f)
23 time_t local = creationDate;
24 fprintf(f,
"typeCookie = %08x\n", typeCookie);
25 fprintf(f,
"typeVersion = %08x\n", typeVersion);
26 fprintf(f,
"contentCookie = %08x\n", contentCookie);
27 fprintf(f,
"contentVersion = %08x\n", contentVersion);
28 fprintf(f,
"Created on %s", asctime(localtime(&local)));
29 fprintf(f,
"Created by user %s on host %s for application '%s'.\n",
37 time_t local = h.creationDate;
38 stream <<
"typeCookie = " << h.typeCookie <<
"\n";
39 stream <<
"typeVersion = " << h.typeVersion <<
"\n";
40 stream <<
"contentCookie = " << h.contentCookie <<
"\n";
41 stream <<
"contentVersion = " << h.contentVersion <<
"\n";
42 stream <<
"headerSize = " << h.headerSize <<
"\n";
43 stream <<
"elementCount = " << h.elementCount <<
"\n";
45 stream <<
"Created on " << asctime(localtime(&local)) <<
"\n";
46 stream <<
"Created by user " << h.creationUser <<
" on host " << h.creationHost <<
" for application '" << h.application <<
"'.\n";
59 assert(test.
create(
"twinkypie", 11)==0);
74 assert(test.
open(
"twinkypie")==0);
86 assert(test.
create(
"twinkypie", 11)==0);
102 assert(test.
open(
"twinkypie")==0);
114 assert(test.
create(
"twinkypie", 11)==0);
126 test.setApplication(
"testing 2 bit values!");
139 assert(test.
open(
"twinkypie")==0);
140 test.debugPrint(stdout);
150 assert(test.
create(
"twinkypie", 11)==0);
162 test.setApplication(
"testing 4 bit values!");
166 assert(test[10]==10);
168 assert(test.
open(
"twinkypie")==0);
172 assert(test[10]==10);
173 test.debugPrint(stdout);
178 int main(
int argc,
char **argv)
int create(const char *file, indexT elementCount, int optionalHeaderCount=0)
Create a vector with elementCount memebers.
bool open(const char *file, int flags=O_RDONLY)
open a previously created mapped vector