7 #include "configcache.h"
15 int lastWrittenObsEquis;
18 static int initO(const string& cacheid, const int& nequi, const int& nskip, const string& datadir,
19 char **configmem, const int& configMemSize, const int& cachemode=CACHE_MODE_RW, ostream *_log=NULL) {
23 newobs.lastWrittenObsEquis = 0;
26 initCache(&Os.back().c, cacheid, nequi, nskip, datadir, configmem, configMemSize, cachemode, _log);
29 static void initC(const string& cacheid, const int& nequi, const int& nskip, const string& datadir,
30 char **configmem, const int& configMemSize, const int& cachemode=CACHE_MODE_RW, ostream *_log=NULL) {
31 initCache(&C, cacheid, nequi, nskip, datadir, configmem, configMemSize, cachemode, _log);
32 mostEquilibratedConfig.second = new char[configMemSize];
35 static int getNEquiLeft() { return nequileft; }
37 static void addPara(const string& parid, const double& val=0);
38 static void setPara(const string& parid, const double& value);
39 static void readO(int obsid, bool *readNewObsConfig, int *nequiObsLeft);
41 static void writeO(int obsid);
43 static void writeHeaderO(int obsid, const string& headerid, char *header, long unsigned int size, int actnequi) { Os[obsid].c->writeHeader(headerid, header, size, actnequi); }
44 static void *getHeaderO(int obsid, const string& headerid) { Os[obsid].c->getHeader(headerid); }
45 static void writeHeaderC(const string& headerid, char *header, long unsigned int size, int actnequi) { C->writeHeader(headerid, header, size, actnequi); }
46 static void *getHeaderC(const string& headerid) { C->getHeader(headerid); }
48 static void finalize();
50 static int CFilesLeft() { return C->inFilesLeft(); }
58 static void initCache(configcache **cache,
59 const string& cacheid, const int& nequi, const int& nskip, const string& datadir,
60 char **configmem, const int& configMemSize, const int& cachemode=CACHE_MODE_RW, ostream* _log=NULL);
62 static void initCache( configcache **cache,
63 const string& cacheid, char **configmem, const int& configMemSize, const int& cachemode=CACHE_MODE_RW);
65 static configcache *C;
66 static vector<observable> Os;
67 static vector<para> delayedParaAdd;
68 static vector<para> delayedParaSet;
70 static string fileOfPath(const string& dressedfile);
71 static string activeCFile;
72 static vector<unsigned long> parentConfigs;
73 static void addParentConfig(const unsigned long *parentconfig);
80 static pair<int, char*> mostEquilibratedConfig;