SST  15.1.0
StructuralSimulationToolkit
SST::OptionDefinitionNoVar Struct Reference

OptionDefinition representing options that don't require a value. More...

#include <configBase.h>

Inheritance diagram for SST::OptionDefinitionNoVar:
SST::OptionDefinition

Public Member Functions

 OptionDefinitionNoVar (std::function< int(std::string)> operate)
 Constructor. More...
 
int parse (std::string arg) override
 Function called to parse the option. More...
 
void transfer (OptionDefinition *UNUSED(def)) override
 
void serialize (SST::Core::Serialization::serializer &UNUSED(ser)) override
 
void to_string (std::vector< std::string > &UNUSED(out)) override
 
- Public Member Functions inherited from SST::OptionDefinition
 OptionDefinition (std::function< std::string()> ext_help)
 
virtual void transfer (OptionDefinition *def)=0
 Function called to transfer the value(s) of a separate OptionDefinition to the current OptionDefinition. More...
 
virtual void serialize (SST::Core::Serialization::serializer &ser)=0
 Function called to serialize the data in the OptionDefinition. More...
 
virtual void to_string (std::vector< std::string > &out)=0
 Adds a string representation to the input vector for each of the underlying variables. More...
 

Data Fields

const std::function< int(std::string)> operate
 std::function that holds a pointer to the function that will either print out the information, or that is modifying a variable contained in the enclosing class.
 
- Data Fields inherited from SST::OptionDefinition
const std::function< std::string()> ext_help
 
bool set_cmdline = false
 

Detailed Description

OptionDefinition representing options that don't require a value.

This is generally used for options that only print infomation when specified (i.e. –help or –version), but can also be used if it is modifying a variable set directly in the containing class.

Constructor & Destructor Documentation

◆ OptionDefinitionNoVar()

SST::OptionDefinitionNoVar::OptionDefinitionNoVar ( std::function< int(std::string)>  operate)
inline

Constructor.

Parameters
operatateFunction that will be called when this Option is called on the command line

Member Function Documentation

◆ parse()

int SST::OptionDefinitionNoVar::parse ( std::string  arg)
inlineoverridevirtual

Function called to parse the option.

This generally defers to an underlying std::function that is defined when the OptionDefinition is declared (see children classes). There are standard parsers found in the StandardConfigParsers namespace, and extra parsing functions can be added to the namespace by child classes, if needed.

Parameters
argArgument passed to the option on the command line

Implements SST::OptionDefinition.

References operate.


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