122 void values(ostream& os,
bool defined_only=
true);
124 class args_container;
131 arg_base(
const char* name,
const char* desc);
133 const string&
get_name()
const {
return arg_name; }
135 const string&
get_desc()
const {
return arg_desc; }
150 virtual int parse_parameters (
int argc,
char* argv []) = 0;
155 virtual void write_parameters (ostream& os,
bool def=
false)
const = 0;
173 argT(
const char* arg,
const char* desc) :
196 argString(
const char* arg,
const char* desc,
string v) :
197 argT<string>(arg,desc)
205 if (argc <= 0)
return -1;
206 value = string(argv[0]);
225 argInt(
const char* arg,
const char* desc,
int v = 0) :
234 if (argc <= 0)
return -1;
236 std::stringstream(argv[0]) >> value;
238 catch (
const exception& ) {
return -1;}
256 argDouble(
const char* arg,
const char* desc,
double v = 0.0) :
257 argT<double>(arg,desc)
265 if (argc <= 0)
return -1;
267 std::stringstream(argv[0]) >> value;
269 catch (
const exception& ) {
return -1;}
287 argBool(
const char* arg,
const char* desc,
bool v =
false) :
295 { value =
true;
return 0; }
const string & get_name() const
void write_parameters(ostream &os, bool def) const
void set_value(const T &v) const
argInt(const char *arg, const char *desc, int v=0)
argBool(const char *arg, const char *desc, bool v=false)
void write_parameters(ostream &os, bool def) const
argDouble(const char *arg, const char *desc, double v=0.0)
int parse_parameters(int argc, char *argv [])
argString(const char *arg, const char *desc, string v)
void write_parameters(ostream &os, bool def) const
int parse_parameters(int argc, char *argv [])
int parse_parameters(int argc, char *argv [])
int parse_arguments(int argc, char *argv[])
void arguments_descriptions(ostream &os, string prefix, string suffix)
int dump_arguments_to_file(ostream &of)
void write_parameters(ostream &os, bool def) const
argT(const char *arg, const char *desc)
int parse_arguments_from_file(istream &is)
const T & get_value() const
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
clarg::argString m("-m", "input matrix file name (text format)", "matrix.txt")
const string & get_desc() const
int parse_parameters(int argc, char *argv [])