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);
49 void closeInFile() { inFile.close(); }
50 int inFilesLeft() { return inFiles.size(); }
54 infiledesc openFileDesc;
56 int getParIndex(const string& parid);
62 string getFileId(const bool& shortid=false);
67 stringstream outFileName;
71 boost::iostreams::filtering_istreambuf *inBuffer;
72 boost::iostreams::filtering_ostreambuf *outBuffer;
80 bool refetchDataFiles;
82 void fetchDataFiles();
84 bool isValidInFile(const string& infile, infiledesc *filedesc);
86 vector<infiledesc> inFiles;
88 vector<parameter> Paras;
90 int readDataToMem(char *tmpData, long unsigned int dataSize);
98 int readFullBlock(char *tmpData, long unsigned int dataSize);
100 vector< pair<unsigned long, void *> > headerStore;
102 void deleteHeaderStore();
104 bool readAllHeaders();
106 vector<infiledesc>::iterator getNextInfile(vector<unsigned long> *excludeFileHashes);