SST  15.1.0
StructuralSimulationToolkit
SST::OptionDefinition Struct Referenceabstract

Base class for defining options available in the various config classes. More...

#include <configBase.h>

Inheritance diagram for SST::OptionDefinition:
SST::OptionDefinitionImpl< T > SST::OptionDefinitionNoVar SST::OptionDefinitionPair< T, U >

Public Member Functions

 OptionDefinition (std::function< std::string()> ext_help)
 
virtual int parse (std::string arg)=0
 Function called to parse the option. More...
 
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< std::string()> ext_help
 
bool set_cmdline = false
 

Detailed Description

Base class for defining options available in the various config classes.

This class and its children encapsulates the value, parsing function, extended help function and name. There are also virtual functions that allow the Config* classes to operate on the options without having to know the type of the underlying data.

Member Function Documentation

◆ parse()

virtual int SST::OptionDefinition::parse ( std::string  arg)
pure virtual

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

Implemented in SST::OptionDefinitionPair< T, U >, SST::OptionDefinitionImpl< T >, and SST::OptionDefinitionNoVar.

◆ serialize()

virtual void SST::OptionDefinition::serialize ( SST::Core::Serialization::serializer ser)
pure virtual

Function called to serialize the data in the OptionDefinition.

See also
Impl::option_serialize_data()
Parameters
serSerializer used to serialize the data

Implemented in SST::OptionDefinitionPair< T, U >, and SST::OptionDefinitionImpl< T >.

◆ to_string()

virtual void SST::OptionDefinition::to_string ( std::vector< std::string > &  out)
pure virtual

Adds a string representation to the input vector for each of the underlying variables.

Format is variable = value. If there are no underlying variables, nothing will be added.

Parameters
[out]outvector to put the output strings in

Implemented in SST::OptionDefinitionPair< T, U >, and SST::OptionDefinitionImpl< T >.

◆ transfer()

virtual void SST::OptionDefinition::transfer ( OptionDefinition def)
pure virtual

Function called to transfer the value(s) of a separate OptionDefinition to the current OptionDefinition.

Parameters
defOptionDefinition to copy value(s) from

Implemented in SST::OptionDefinitionPair< T, U >, and SST::OptionDefinitionImpl< T >.


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