14 #ifndef MLPACK_CORE_UTIL_CLI_HPP 15 #define MLPACK_CORE_UTIL_CLI_HPP 22 #include <boost/any.hpp> 182 static bool HasParam(
const std::string& identifier);
191 static T&
GetParam(
const std::string& identifier);
214 static T&
GetRawParam(
const std::string& identifier);
227 static CLI& GetSingleton();
239 static std::map<std::string, util::ParamData>& Parameters();
241 static std::map<char, std::string>& Aliases();
244 static std::string ProgramName();
251 static void SetPassed(
const std::string& name);
261 static void StoreSettings(
const std::string& name);
272 static void RestoreSettings(
const std::string& name,
const bool fatal =
true);
277 static void ClearSettings();
281 std::map<char, std::string> aliases;
283 std::map<std::string, util::ParamData> parameters;
288 typedef std::map<std::string, std::map<std::string,
294 std::map<std::string, std::tuple<std::map<std::string, util::ParamData>,
323 CLI& operator=(
const CLI& other);
329 #include "cli_impl.hpp" bool didParse
True, if CLI was used to parse command line options.
The core includes that mlpack expects; standard C++ includes and Armadillo.
Timers timer
Holds the timer objects.
std::string programName
Holds the name of the program for –version.
This structure holds all of the information about a single parameter, including its value (which is s...
The timer class provides a way for mlpack methods to be timed.
util::ProgramDoc * doc
Pointer to the ProgramDoc object.
std::map< std::string, std::map< std::string, void(*)(const util::ParamData &, const void *, void *)> > FunctionMapType
Map for functions and types.
T & GetParam(util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
This overload is called when nothing special needs to happen to the name of the parameter.
std::string GetPrintableParam(const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
Print an option.
T & GetRawParam(util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
This overload is called when nothing special needs to happen to the name of the parameter.
A static object whose constructor registers program documentation with the CLI class.
Parses the command line for parameters and holds user-specified parameters.
FunctionMapType functionMap