X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/ad54f29de351976a096b4991fe426ffc30332df2..71e93c2cca7c6f967c3c77c3e26c037ad4f4f555:/o815/o815.h diff --git a/o815/o815.h b/o815/o815.h index 510e799..ac192cf 100644 --- a/o815/o815.h +++ b/o815/o815.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "latlib/paraq.h" #include "latlib/writeout.h" @@ -35,7 +36,6 @@ class o815 { char *obsMem; string simid, datadesc; ostream *out, *log; - void printParas(); paraq* paraQ; }; @@ -43,11 +43,11 @@ class o815 { public: sim(o815 *_O815, const int& _confmemSize); void nextConfig(); - bool toEquilibrate; char *confMem; + virtual void _newParas() {}; private: virtual void _reset()=0; - virtual void _makeSweep(int nsweep)=0; + virtual void _makeSweep()=0; protected: o815 *O815; ostream *log; @@ -62,11 +62,20 @@ class o815 { pair obscache; pair confcache; string outdir; - bool idonly; - bool showjobnum; + int idonly; + int showjobnum; } comargs; - o815(int argc, char **argv, const string& programid); + struct comoption { + string name; + int has_arg; + int *flag; + int val; + string optdesc; + string argdesc; + }; + + o815(int argc, char **argv, const string& _programid, comoption specOps[]=NULL, void (*helpHeader)()=NULL); ~o815(); paraq *paraQ; writeout *out; @@ -75,14 +84,19 @@ class o815 { void mainLoop(); string headMaster(); void addPara(const string& paraid, const double& paraDefault); + void addComOption(const char* name, int has_arg, int *flag, int val, const char* optdesc, const char* argdesc); + vector< pair > parsedSpecOps; + vector lonelyArgs; private: + vector comOptions; MPI_Status mpiStatus; int numprocs, rank; static void listArg(int *target, int tlen, char *listarg); - void parseArgs(int argc, char **argv); + void parseArgs(int argc, char **argv, comoption specOps[]); string programid; int nextParas(); + comoption* getOptionByVal(int val); }; #endif