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