mlpack
Public Attributes | List of all members
mlpack::util::ParamData Struct Reference

This structure holds all of the information about a single parameter, including its value (which is set when ParseCommandLine() is called). More...

#include <param_data.hpp>

Public Attributes

std::string name
 Name of this parameter. More...
 
std::string desc
 Description of this parameter, if any.
 
std::string tname
 Type information of this parameter. More...
 
char alias
 Alias for this parameter.
 
bool wasPassed
 True if the option was passed to the program. More...
 
bool noTranspose
 True if this is a matrix that should not be transposed. More...
 
bool required
 True if this option is required.
 
bool input
 True if this option is an input option (otherwise, it is output).
 
bool loaded
 If this is an input parameter that needs extra loading, this indicates whether or not it has been loaded. More...
 
bool persistent
 If this should be preserved across different settings (i.e. More...
 
boost::any value
 The actual value that is held. More...
 
std::string cppType
 The true name of the type, as it would be written in C++.
 

Detailed Description

This structure holds all of the information about a single parameter, including its value (which is set when ParseCommandLine() is called).

It does not hold any information about whether or not it was passed—that is handled elsewhere. A ParamData struct is only useful in order to get "static" information about a parameter. Note that some parameter types have internal types but also different types that are used by CLI11 (specifically, matrix and model types map to strings).

This structure is somewhat unwieldy and is likely to be refactored at some point in the future, but for now it does the job fine.

Member Data Documentation

◆ loaded

bool mlpack::util::ParamData::loaded

If this is an input parameter that needs extra loading, this indicates whether or not it has been loaded.

◆ name

std::string mlpack::util::ParamData::name

Name of this parameter.

This is the name used for HasParam() and GetParam().

◆ noTranspose

bool mlpack::util::ParamData::noTranspose

True if this is a matrix that should not be transposed.

Ignored if the parameter is not a matrix.

◆ persistent

bool mlpack::util::ParamData::persistent

If this should be preserved across different settings (i.e.

if it should exist for every binding), this should be set to true.

◆ tname

std::string mlpack::util::ParamData::tname

Type information of this parameter.

Note that this is TYPENAME() of the user-visible parameter type, not whatever is given by ParameterType<>.

◆ value

boost::any mlpack::util::ParamData::value

The actual value that is held.

If the user has passed a different type, this may be a tuple containing multiple values.

◆ wasPassed

bool mlpack::util::ParamData::wasPassed

True if the option was passed to the program.

Note that wasPassed may be set by either ParseCommandLine() or SetPassed().


The documentation for this struct was generated from the following file: