C++ mpi module for stochmagnet_main Package
CORE_Options.h
1 #ifndef CORE_Options_H
2 #define CORE_Options_H
3 
4 //inherits header
5 #include "CORE_Object.h"
6 
7 
8 //core options reader
9 #include "CORE_OptionsList.h"
10 
11 //core IO
12 #include "CORE_IO.h"
13 
21 class CORE_Options : public CORE_Object {
22 
23  //attributes
24 private :
25 
26 
27 
28 public:
29  // CONSTRUCTORS
32  CORE_Options(void) {
33  }
34 
35  // DESTRUCTORS
38  virtual ~CORE_Options(void) {
39  }
40 
41 
42 
43 public :
44  //MEMORY
45 
59  virtual tMemSize getMemorySize() const {
60  return sizeof(*this)+getContentsMemorySize();
61  }
62 
63 
64  //New shared pointer Methods
65  //===========================
66 
70  static inline CORE_UniquePointer<CORE_Options> New() {
71  return CORE_UniquePointer<CORE_Options>(new CORE_Options(),
73  }
74 
75  // MAIN Method
76 
77 public:
78 
79 public:
83  virtual void initManOptions(CORE_OptionsList& options) const {
84 
85 
86  //args parameter
87  options.setManOption("args","command","command of the program by loading the default option file 'input'");
88  options.setManOption("args","options","name of the file of the arguments");
89  options.setManOption("args","is-options-name-case-sensitive",",name of the options is case sensitive");
90 
91  //inut/output parameters
92  options.setManOption("io","current-path","the current path");
93  options.setManOption("io","prefix","the default prefix for reading/writing file");
94 
95  options.setManOption("io","output-path","the path to generate outputs");
96  options.setManOption("io","output-prefix","the prefix of the output files");
97  options.setManOption("io","output-file","the output file to test the results");
98 
99  options.setManOption("io","input-path","the path to read the inputs ");
100  options.setManOption("io","input-prefix","the prefix of the input files");
101 
102  //log parameters
103  options.setManOption("log","log","{no,screen,file,string,all} output for message");
104  options.setManOption("log","log-file","the name of the log file");
105  options.setManOption("log","log-file-mode","{create|append} create or append to a new file for log printing");
106 
107 
108 
109  //debug parameters
110  options.setManOption("debug","check-memory","{true|false} print the object not destroyed at exit");
111  options.setManOption("debug","reference-path","the path to store reference file for code validation");
112  options.setManOption("debug","eps","admissive error for code validation");
113  options.setManOption("debug","verbose","type of verbose");
114  options.setManOption("debug","is-profiling-printed","true to print the profiled called routines if program compiled with -DUSE_PROFILER");
115 
116  options.setManOption("test","test","type of test to run in {primary|elementary|case|all}");
117 
118  }
119 
123  virtual void initOptions(CORE_OptionsList& options) const {
124 
125 
126  //arg parameter
127  options.setOptionValue("args","");
128 
129  //input/output parameters
130  options.setOptionValue("is-options-name-case-sensitive","false");
131 
132  options.setOptionValue("current-path","");
133  options.setOptionValue("prefix","default");
134 
135  options.setOptionValue("output-path",".");
136  options.setOptionValue("output-file","out.txt");
137  options.setOptionValue("output-prefix","");
138 
139  options.setOptionValue("input-path",".");
140  options.setOptionValue("input-prefix","");
141 
142  //log parameters
143  options.setOptionValue("log","screen");
144  options.setOptionValue("log-file","");
145  options.setOptionValue("log-file-mode","create");
146 
147 
148  //debug options
149  options.setOptionValue("reference-path","./");
150  options.setOptionValue("check-memory",true);
151  options.setOptionValue("eps",1.e-12);
152  options.setOptionValue("is-profiling",false);
153  options.setOptionValue("is-profiling-printed",false);
154 
155  //test options
156  options.setOptionValue("test","all");
157 
158  }
159 
160 
161 
162 
163 };
164 
165 
166 #endif
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
abstract base class for most classes.
Definition: CORE_Object.h:65
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
This class is an list of options.
Definition: CORE_OptionsList.h:36
void setOptionValue(const tString &optName, const tBoolean &value)
set option
Definition: CORE_OptionsList.h:194
void setManOption(const tString &category, const tString &optName, const tString &man)
set man option
Definition: CORE_OptionsList.h:187
This class is the options of the runner.
Definition: CORE_Options.h:21
virtual void initManOptions(CORE_OptionsList &options) const
init the man of the options
Definition: CORE_Options.h:83
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: CORE_Options.h:59
virtual ~CORE_Options(void)
destroy class instance
Definition: CORE_Options.h:38
CORE_Options(void)
create class instance
Definition: CORE_Options.h:32
static CORE_UniquePointer< CORE_Options > New()
return a new unique pointer of this
Definition: CORE_Options.h:70
virtual void initOptions(CORE_OptionsList &options) const
default initialization of the options
Definition: CORE_Options.h:123