21 #ifndef __mast_getpot_wrapper_h__ 22 #define __mast_getpot_wrapper_h__ 26 #include <getpot/GetPot> 45 const std::string &input):
49 GetPot command_line(argc, argv);
51 input_name = command_line(input,
"");
54 _input =
new GetPot(argc, argv);
56 _input =
new GetPot(input_name);
58 _print = (*_input)(
"print_params",
false);
67 _input (new GetPot(argc, argv)),
94 const char*
operator()(
const std::string& nm,
const std::string& doc,
const char* v) {
99 <<
" [Default: v = " << v <<
" ]" << std::endl;
105 template <
typename ValType>
106 ValType
operator()(
const std::string& nm,
const std::string& doc,
const ValType& v) {
110 << nm <<
" : " << doc
111 <<
" [Default: v = " << v <<
" ]" << std::endl;
116 template <
typename ValType>
117 ValType
operator()(
const std::string& nm,
const std::string& doc,
const ValType& v,
const unsigned int i) {
122 <<
"Vector: " << nm <<
" : " << doc
123 <<
" [ Default: v(i) = " << v <<
" ] " << std::endl;
125 return (*
_input)(nm, v, i);
138 #endif // __mast_getpot_wrapper_h__ ValType operator()(const std::string &nm, const std::string &doc, const ValType &v, const unsigned int i)
GetPotWrapper(const std::string &file)
creates a wrapper for the input arguments in the input file named file.
const char * operator()(const std::string &nm, const std::string &doc, const char *v)
GetPotWrapper(const int argc, char **argv)
creates a wrapper around the input arguments given to the executable in argc and argv ...
ValType operator()(const std::string &nm, const std::string &doc, const ValType &v)
GetPotWrapper(const int argc, char **argv, const std::string &input)
Identifies if an input file name is provided in argc by the parameter name input. ...