parametersystem.hpp
Go to the documentation of this file.
bool IsSet_(const std::string ¶mName, bool errorIfNotRegistered) Private implementation. ParamType Get_(const std::string ¶mName, ParamType defaultValue, bool errorIfNotRegistered) Private implementation. auto getParamName() get the name data member of a parameter Definition: parametersystem.hpp:58 void Register_(const std::string ¶mName, const std::string ¶mTypeName, const std::string &defaultValue, const char *usageString) Private implementation. void SetDefault_(const std::string ¶mName, const std::string ¶mValue) Private implementation. Definition: blackoilnewtonmethodparams.hpp:31 std::function< int(std::function< void(const std::string &, const std::string &)>, std::set< std::string > &, std::string &, int, const char **, int, int)> PositionalArgumentCallback Callback function for command line parsing. Definition: parametersystem.hpp:120 std::string parseCommandLineOptions(int argc, const char **argv, const PositionalArgumentCallback &posArgCallback, const std::string &helpPreamble="") Parse the parameters provided on the command line. void printValues(std::ostream &os) Print values of the run-time parameters. void SetDefault(decltype(Param::value) new_value) Set a runtime parameter. Definition: parametersystem.hpp:210 bool IsSet(bool errorIfNotRegistered=true) Returns true if a parameter has been specified at runtime, false otherwise. Definition: parametersystem.hpp:268 void Register(const char *usageString) Register a run-time parameter. Definition: parametersystem.hpp:290 bool IsRegistrationOpen() Query whether parameter registration is open or not. void endRegistration() Indicate that all parameters are registered for a given type tag. bool parseParameterFile(const std::string &fileName, bool overwrite=true) Read the parameters from an INI-style file. void getLists(std::vector< Parameter > &usedParams, std::vector< Parameter > &unusedParams) Retrieves the lists of parameters specified at runtime and their values. void printUsage(const std::string &helpPreamble, std::ostream &os, const std::string &errorMsg="", const bool showAll=false) Print a usage message for all run-time parameters. void Hide() Indicate that a given parameter should not be mentioned in the help message. Definition: parametersystem.hpp:309 bool printUnused(std::ostream &os) Print the list of unused run-time parameters. auto Get(bool errorIfNotRegistered=true) Retrieve a runtime parameter. Definition: parametersystem.hpp:185 A struct holding the key-value pair for a parameter. Definition: parametersystem.hpp:222 bool operator==(const Parameter &setting) const Definition: parametersystem.hpp:233 Parameter(const std::string &k, const std::string &v) Definition: parametersystem.hpp:223 bool operator!=(const Parameter &setting) const Definition: parametersystem.hpp:239 friend std::ostream & operator<<(std::ostream &os, const Parameter ¶m) Definition: parametersystem.hpp:227 Definition: parametersystem.hpp:50 |