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...

Public Attributes

char alias
 Alias for this parameter. More...

 
std::string cppType
 The true name of the type, as it would be written in C++. More...

 
std::string desc
 Description of this parameter, if any. More...

 
bool input
 True if this option is an input option (otherwise, it is output). More...

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

 
std::string name
 Name of this parameter. More...

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

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

 
bool required
 True if this option is required. More...

 
std::string tname
 Type information of this parameter. More...

 
boost::any value
 The actual value that is held. More...

 
bool wasPassed
 True if the option was passed to the program. More...

 

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 boost::program_options (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.

Definition at line 52 of file param_data.hpp.

Member Data Documentation

◆ alias

◆ cppType

◆ desc

◆ input

◆ loaded

bool loaded

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

Definition at line 76 of file param_data.hpp.

Referenced by CLIOption< N >::CLIOption(), mlpack::bindings::cli::GetParam(), MDOption< T >::MDOption(), PyOption< T >::PyOption(), and TestOption< N >::TestOption().

◆ name

◆ noTranspose

bool noTranspose

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

Ignored if the parameter is not a matrix.

Definition at line 69 of file param_data.hpp.

Referenced by CLIOption< N >::CLIOption(), mlpack::bindings::cli::GetParam(), MDOption< T >::MDOption(), PyOption< T >::PyOption(), and TestOption< N >::TestOption().

◆ persistent

bool persistent

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

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

Definition at line 79 of file param_data.hpp.

Referenced by CLIOption< N >::CLIOption(), MDOption< T >::MDOption(), PyOption< T >::PyOption(), and TestOption< N >::TestOption().

◆ required

◆ tname

std::string tname

Type information of this parameter.

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

Definition at line 61 of file param_data.hpp.

Referenced by CLIOption< N >::CLIOption(), mlpack::bindings::cli::EndProgram(), MDOption< T >::MDOption(), mlpack::bindings::cli::ParseCommandLine(), PyOption< T >::PyOption(), and TestOption< N >::TestOption().

◆ value

◆ wasPassed

bool wasPassed

True if the option was passed to the program.

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

Definition at line 66 of file param_data.hpp.

Referenced by CLIOption< N >::CLIOption(), MDOption< T >::MDOption(), mlpack::bindings::cli::ParseCommandLine(), PyOption< T >::PyOption(), mlpack::bindings::cli::SetParam(), and TestOption< N >::TestOption().


The documentation for this struct was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-3.1.0/src/mlpack/core/util/param_data.hpp