10 #define CACHE_MODE_OO 0
11 #define CACHE_MODE_RO 1
12 #define CACHE_MODE_WO 2
13 #define CACHE_MODE_RW 3
32 configcache(const string& cacheid, const int& nequi, const int& nskip, const string& datadir, char **configmem, const int& configMemSize,
33 const int& cachemode=CACHE_MODE_RW, ostream *_log=NULL);
34 void readConfig(bool *readnewconfig, int *nequileft, vector<unsigned long> *excludeFileHashes=NULL);
35 void writeConfig(int actnequi);
36 void addPara(const string& parid, const double& val=0);
37 void setPara(const string& parid, const double& value);
38 void writeHeader(const string& headerid, const char *header, long unsigned int size, int actnequi);
39 void * getHeader(const string& headerid);
40 string getOutFileName() { return outFileName.str(); }
41 string getInFileName() { return DATADIR + "/" + openFileDesc.filename; }
42 static unsigned long hash(const string& str);
43 void closeInFile() { inFile.close(); }
44 int inFilesLeft() { return inFiles.size(); }
45 char* getConfigMem() { return configMem; }
46 int getConfigSize() { return configSize; }
47 bool isOutFileOpen () { return outFile.is_open(); }
55 infiledesc openFileDesc;
56 int getParIndex(const string& parid);
62 string getFileId(int actnequi, const bool& shortid=false);
67 stringstream outFileName;
77 bool refetchDataFiles;
79 void fetchDataFiles();
81 bool isValidInFile(const string& infile, infiledesc *filedesc);
83 vector<infiledesc> inFiles;
85 vector<parameter> Paras;
87 int readDataToMem(char *tmpData, long unsigned int dataSize);
89 void openOutFile(int actnequi);
95 int readFullBlock(char *tmpData, long unsigned int dataSize);
97 vector< pair<unsigned long, void *> > headerStore;
99 void deleteHeaderStore();
101 bool readAllHeaders();
103 vector<infiledesc>::iterator getNextInfile(vector<unsigned long> *excludeFileHashes);
105 int nequileft_internal;
107 bool doVirtualEquilibration, firstUsedConfig;