10 #define CACHE_MODE_OO 0
11 #define CACHE_MODE_RO 1
12 #define CACHE_MODE_WO 2
13 #define CACHE_MODE_RW 3
33 configcache(const string& cacheid, const int& nequi, const int& nskip, const string& datadir, char **configmem, const int& configMemSize,
34 const int& cachemode=CACHE_MODE_RW, ostream *_log=NULL);
35 void readConfig(bool *readnewconfig, int *nequileft, vector<unsigned long> *excludeFileHashes=NULL);
36 void writeConfig(int actnequi);
37 void addPara(const string& parid, const double& val=0);
38 void setPara(const string& parid, const double& value);
39 void writeHeader(const string& headerid, const char *header, long unsigned int size, int actnequi);
40 void * getHeader(const string& headerid);
41 string getOutFileName() { return outFileName.str(); }
42 string getInFileName() { return DATADIR + "/" + openFileDesc.filename; }
43 static unsigned long hash(const string& str);
44 void closeInFile() { inFile.close(); }
45 int inFilesLeft() { return inFiles.size(); }
46 char* getConfigMem() { return configMem; }
47 int getConfigSize() { return configSize; }
48 bool isOutFileOpen () { return outFile.is_open(); }
56 infiledesc openFileDesc;
57 int getParIndex(const string& parid);
63 string getFileId(int actnequi, const bool& superextended=true, const bool& shortid=false);
68 stringstream outFileName;
78 bool refetchDataFiles;
80 void fetchDataFiles();
82 bool isValidInFile(const string& infile, infiledesc *filedesc);
84 vector<infiledesc> inFiles;
86 vector<parameter> Paras;
88 int readDataToMem(char *tmpData, long unsigned int dataSize);
90 void openOutFile(int actnequi);
96 int readFullBlock(char *tmpData, long unsigned int dataSize);
98 vector< pair<unsigned long, void *> > headerStore;
100 void deleteHeaderStore();
102 bool readAllHeaders();
104 vector<infiledesc>::iterator getNextInfile(vector<unsigned long> *excludeFileHashes);
106 int nequileft_internal;
108 bool doVirtualEquilibration, firstUsedConfig;