10 #include <boost/iostreams/filtering_streambuf.hpp>
11 #include <boost/iostreams/stream.hpp>
12 #include <boost/iostreams/filter/bzip2.hpp>
13 #include <boost/iostreams/device/array.hpp>
14 #include <boost/iostreams/copy.hpp>
16 #define CACHE_MODE_DISABLED 0
17 #define CACHE_MODE_READ 1
18 #define CACHE_MODE_FULL 2
31 bool doVirtualEquilibration;
38 configcache(const string& cacheid, const int& nequi, const int& nskip, const string& datadir, char **configmem, const int& configMemSize,
39 const int& cachemode=CACHE_MODE_FULL, ostream *_log=NULL);
40 int readConfig(vector<unsigned long> *excludeFileHashes=NULL);
42 void addPara(const string& parid, const double& val=0);
43 void setPara(const string& parid, const double& value);
44 void writeHeader(const string& headerid, const char *header, long unsigned int size);
45 void * getHeader(const string& headerid);
46 string getOutFileName() { return outFileName.str(); }
47 string getInFileName() { return DATADIR + "/" + openFileDesc.filename; }
48 static unsigned long hash(const string& str);
52 infiledesc openFileDesc;
54 int getParIndex(const string& parid);
60 string getFileId(const bool& shortid=false);
65 stringstream outFileName;
69 boost::iostreams::filtering_istreambuf *inBuffer;
70 boost::iostreams::filtering_ostreambuf *outBuffer;
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);
96 int readFullBlock(char *tmpData, long unsigned int dataSize);
98 vector< pair<unsigned long, void *> > headerStore;
100 void deleteHeaderStore();
102 bool readAllHeaders();