Namespace for command line arguments. More...
Classes | |
struct | ArgInfo |
Structure to store information on a command line argument. More... | |
Functions | |
void | setup (int argc, char **argv) |
Set values. | |
void | output () |
Doc the command line arguments. | |
void | specify_command_line_flag (const std::string &command_line_flag, const std::string &doc) |
Specify possible argument-free command line flag. | |
void | specify_command_line_flag (const std::string &command_line_flag, double *arg_pt, const std::string &doc) |
Specify possible command line flag that specifies a double, accessed via pointer. | |
void | specify_command_line_flag (const std::string &command_line_flag, int *arg_pt, const std::string &doc) |
Specify possible command line flag that specifies an int, accessed via pointer. | |
void | specify_command_line_flag (const std::string &command_line_flag, unsigned *arg_pt, const std::string &doc) |
Specify possible command line flag that specifies an unsigned, accessed via pointer. | |
void | specify_command_line_flag (const std::string &command_line_flag, std::string *arg_pt, const std::string &doc) |
Specify possible command line flag that specifies a string, accessed via pointer. | |
bool | command_line_flag_has_been_set (const std::string &flag) |
Check if command line flag has been set (value will have been assigned directly). | |
void | doc_all_flags (std::ostream &outstream) |
Document the values of all flags (specified or not). | |
void | doc_specified_flags () |
Document specified command line flags. | |
void | doc_available_flags () |
Document available command line flags. | |
void | check_arg_index (const int &argc, const int &arg_index) |
Helper function to check if command line index is legal. | |
void | parse_and_assign (int argc, char *argv[], const bool &throw_on_unrecognised_args) |
Parse command line, check for recognised flags and assign associated values. | |
void | parse_and_assign (const bool &throw_on_unrecognised_args) |
Parse previously specified command line, check for recognised flags and assign associated values. | |
Variables | |
int | Argc |
Number of arguments + 1. | |
char ** | Argv |
Arguments themselves. | |
std::map< std::string, ArgInfo< bool > > | Specified_command_line_flag |
Map to indicate an input flag as having been set. | |
std::map< std::string, ArgInfo< double > > | Specified_command_line_double_pt |
Map to associate an input flag with a double – specified via pointer. | |
std::map< std::string, ArgInfo< int > > | Specified_command_line_int_pt |
Map to associate an input flag with an int – specified via pointer. | |
std::map< std::string, ArgInfo< unsigned > > | Specified_command_line_unsigned_pt |
Map to associate an input flag with an unsigned – specified via pointer. | |
std::map< std::string, ArgInfo< std::string > > | Specified_command_line_string_pt |
Map to associate an input flag with a string – specified via pointer. | |
Namespace for command line arguments.
Helper function to check if command line index is legal.
Definition at line 745 of file oomph_utilities.cc.
References doc_available_flags(), and output().
Referenced by parse_and_assign().
Check if command line flag has been set (value will have been assigned directly).
Check if specified flag has been set (the associated value will have been assigned directly)
Definition at line 509 of file oomph_utilities.cc.
References Specified_command_line_double_pt, Specified_command_line_flag, Specified_command_line_int_pt, Specified_command_line_string_pt, and Specified_command_line_unsigned_pt.
void oomph::CommandLineArgs::doc_all_flags | ( | std::ostream & | outstream | ) |
Document the values of all flags (specified or not).
Document the values of all flags (specified or not)
Definition at line 570 of file oomph_utilities.cc.
References Specified_command_line_double_pt, Specified_command_line_flag, Specified_command_line_int_pt, Specified_command_line_string_pt, and Specified_command_line_unsigned_pt.
void oomph::CommandLineArgs::doc_available_flags | ( | ) |
Document available command line flags.
Definition at line 684 of file oomph_utilities.cc.
References oomph::oomph_info, Specified_command_line_double_pt, Specified_command_line_flag, Specified_command_line_int_pt, Specified_command_line_string_pt, and Specified_command_line_unsigned_pt.
Referenced by check_arg_index(), and parse_and_assign().
void oomph::CommandLineArgs::doc_specified_flags | ( | ) |
Document specified command line flags.
Definition at line 618 of file oomph_utilities.cc.
References oomph::oomph_info, Specified_command_line_double_pt, Specified_command_line_flag, Specified_command_line_int_pt, Specified_command_line_string_pt, and Specified_command_line_unsigned_pt.
void oomph::CommandLineArgs::output | ( | ) |
Doc the command line arguments.
Definition at line 444 of file oomph_utilities.cc.
References Argc, Argv, i, and oomph::oomph_info.
Referenced by check_arg_index().
Parse previously specified command line, check for recognised flags and assign associated values.
Definition at line 944 of file oomph_utilities.cc.
References Argc, Argv, and parse_and_assign().
void oomph::CommandLineArgs::parse_and_assign | ( | int | argc, |
char * | argv[], | ||
const bool & | throw_on_unrecognised_args | ||
) |
Parse command line, check for recognised flags and assign associated values.
Definition at line 768 of file oomph_utilities.cc.
References check_arg_index(), doc_available_flags(), oomph::MPI_Helpers::finalize(), oomph::oomph_info, Specified_command_line_double_pt, Specified_command_line_flag, Specified_command_line_int_pt, Specified_command_line_string_pt, and Specified_command_line_unsigned_pt.
Referenced by parse_and_assign().
void oomph::CommandLineArgs::specify_command_line_flag | ( | const std::string & | command_line_flag, |
const std::string & | doc | ||
) |
Specify possible argument-free command line flag.
Definition at line 459 of file oomph_utilities.cc.
References Specified_command_line_flag.
void oomph::CommandLineArgs::specify_command_line_flag | ( | const std::string & | command_line_flag, |
double * | arg_pt, | ||
const std::string & | doc | ||
) |
Specify possible command line flag that specifies a double, accessed via pointer.
Definition at line 468 of file oomph_utilities.cc.
References Specified_command_line_double_pt.
void oomph::CommandLineArgs::specify_command_line_flag | ( | const std::string & | command_line_flag, |
int * | arg_pt, | ||
const std::string & | doc | ||
) |
Specify possible command line flag that specifies an int, accessed via pointer.
Definition at line 478 of file oomph_utilities.cc.
References Specified_command_line_int_pt.
void oomph::CommandLineArgs::specify_command_line_flag | ( | const std::string & | command_line_flag, |
std::string * | arg_pt, | ||
const std::string & | doc | ||
) |
Specify possible command line flag that specifies a string, accessed via pointer.
Definition at line 498 of file oomph_utilities.cc.
References Specified_command_line_string_pt.
void oomph::CommandLineArgs::specify_command_line_flag | ( | const std::string & | command_line_flag, |
unsigned * | arg_pt, | ||
const std::string & | doc | ||
) |
Specify possible command line flag that specifies an unsigned, accessed via pointer.
Definition at line 488 of file oomph_utilities.cc.
References Specified_command_line_unsigned_pt.
int oomph::CommandLineArgs::Argc |
Number of arguments + 1.
Definition at line 415 of file oomph_utilities.cc.
Referenced by output(), parse_and_assign(), print_stacktrace(), and setup().
char ** oomph::CommandLineArgs::Argv |
Arguments themselves.
Definition at line 418 of file oomph_utilities.cc.
Referenced by output(), parse_and_assign(), print_stacktrace(), and setup().
Map to associate an input flag with a double – specified via pointer.
Definition at line 424 of file oomph_utilities.cc.
Referenced by command_line_flag_has_been_set(), doc_all_flags(), doc_available_flags(), doc_specified_flags(), parse_and_assign(), and specify_command_line_flag().
Map to indicate an input flag as having been set.
Definition at line 421 of file oomph_utilities.cc.
Referenced by command_line_flag_has_been_set(), doc_all_flags(), doc_available_flags(), doc_specified_flags(), parse_and_assign(), and specify_command_line_flag().
Map to associate an input flag with an int – specified via pointer.
Definition at line 427 of file oomph_utilities.cc.
Referenced by command_line_flag_has_been_set(), doc_all_flags(), doc_available_flags(), doc_specified_flags(), parse_and_assign(), and specify_command_line_flag().
std::map< std::string, ArgInfo< std::string > > oomph::CommandLineArgs::Specified_command_line_string_pt |
Map to associate an input flag with a string – specified via pointer.
Definition at line 434 of file oomph_utilities.cc.
Referenced by command_line_flag_has_been_set(), doc_all_flags(), doc_available_flags(), doc_specified_flags(), parse_and_assign(), and specify_command_line_flag().
std::map< std::string, ArgInfo< unsigned > > oomph::CommandLineArgs::Specified_command_line_unsigned_pt |
Map to associate an input flag with an unsigned – specified via pointer.
Definition at line 430 of file oomph_utilities.cc.
Referenced by command_line_flag_has_been_set(), doc_all_flags(), doc_available_flags(), doc_specified_flags(), parse_and_assign(), and specify_command_line_flag().