Go to the documentation of this file.
13 #ifndef MLPACK_CORE_BINDINGS_TESTS_TEST_OPTION_HPP
14 #define MLPACK_CORE_BINDINGS_TESTS_TEST_OPTION_HPP
62 const std::string& identifier,
63 const std::string& description,
64 const std::string& alias,
65 const std::string& cppName,
66 const bool required =
false,
67 const bool input =
true,
68 const bool noTranspose =
false,
69 const std::string& testName =
"")
74 data.
desc = description;
75 data.
name = identifier;
77 data.
alias = alias[0];
84 data.
value = boost::any(defaultValue);
87 const std::string tname = data.
tname;
93 &GetPrintableParam<N>;
96 &GetAllocatedMemory<N>;
98 &DeleteAllocatedMemory<N>;
static CLI & GetSingleton()
Retrieve the singleton.
TestOption(const N defaultValue, const std::string &identifier, const std::string &description, const std::string &alias, const std::string &cppName, const bool required=false, const bool input=true, const bool noTranspose=false, const std::string &testName="")
Construct an Option object.
std::string cppType
The true name of the type, as it would be written in C++.
boost::any value
The actual value that is held.
bool persistent
If this should be preserved across different settings (i.e.
static void Add(util::ParamData &&d)
Adds a parameter to the hierarchy; use the PARAM_*() macros instead of this (i.e.
static void ClearSettings()
Clear all of the settings, removing all parameters and function mappings.
ProgramDoc(const std::string &programName, const std::string &documentation)
Construct a ProgramDoc object.
static void SetPassed(const std::string &name)
Mark a particular parameter as passed.
bool input
True if this option is an input option (otherwise, it is output).
This structure holds all of the information about a single parameter, including its value (which is s...
std::string desc
Description of this parameter, if any.
A static object whose constructor registers a parameter with the CLI class.
FunctionMapType functionMap
A static object whose constructor registers program documentation with the CLI class.
bool wasPassed
True if the option was passed to the program.
static void RestoreSettings(const std::string &name, const bool fatal=true)
Restore all of the parameters and function mappings of the given name, if they exist.
std::string name
Name of this parameter.
static void StoreSettings(const std::string &name)
Take all parameters and function mappings and store them, under the given name.
#define TYPENAME(x)
The TYPENAME macro is used internally to convert a type into a string.
std::string programName
The name of the program.
bool required
True if this option is required.
bool loaded
If this is an input parameter that needs extra loading, this indicates whether or not it has been loa...
char alias
Alias for this parameter.
std::string tname
Type information of this parameter.
std::string documentation
Documentation for what the program does.
bool noTranspose
True if this is a matrix that should not be transposed.