12 #define CACHE_MODE_OO 0
 
  13 #define CACHE_MODE_RO 1
 
  14 #define CACHE_MODE_WO 2
 
  15 #define CACHE_MODE_RW 3
 
  35   configcache(const string& cacheid, const int& nequi, const int& nskip, const string& datadir, char **configmem, const int& configMemSize, 
 
  36               const int& cachemode=CACHE_MODE_RW, ostream *_log=NULL);
 
  37   void readConfig(bool *readnewconfig, int *nequileft, vector<unsigned long> *excludeFileHashes=NULL);
 
  38   void writeConfig(int actnequi);
 
  39   void addPara(const string& parid, const double& val=0);
 
  40   void setPara(const string& parid, const double& value);
 
  41   void writeHeader(const string& headerid, const char *header, long unsigned int size, int actnequi);
 
  42   void * getHeader(const string& headerid);
 
  43   string getOutFileName() { return outFileName.str(); }
 
  44   string getInFileName() { return DATADIR + "/" + openFileDesc.filename; }
 
  45   static unsigned long hash(const string& str);
 
  46   void closeInFile() { dataReader->closeFile(); }
 
  47   int inFilesLeft() { return inFiles.size(); }
 
  48   char* getConfigMem() { return configMem; }
 
  49   int getConfigSize() { return configSize; }
 
  50   bool isOutFileOpen () { return outFile.is_open(); }
 
  58   infiledesc openFileDesc;
 
  59   int getParIndex(const string& parid);
 
  65   string getFileId(int actnequi, const bool& superextended=true, const bool& shortid=false);
 
  69   stringstream outFileName;
 
  79   bool refetchDataFiles;
 
  81   void fetchDataFiles();
 
  83   bool isValidInFile(const string& infile, infiledesc *filedesc);
 
  85   vector<infiledesc> inFiles;
 
  87   vector<parameter> Paras;
 
  89   void openOutFile(int actnequi);
 
  95   bool readAllHeaders();
 
  97   vector<infiledesc>::iterator getNextInfile(vector<unsigned long> *excludeFileHashes);
 
  99   int nequileft_internal;
 
 101   bool doVirtualEquilibration, firstUsedConfig;