|
SST
15.1.0
StructuralSimulationToolkit
|
Class use to represent OptionDefinitions that store a value. More...
#include <configBase.h>
Public Member Functions | |
| OptionDefinitionImpl (std::string name, T val, std::function< int(T &, std::string)> parser) | |
| Constructor. More... | |
| OptionDefinitionImpl (std::string name, T val, std::function< int(T &, std::string)> parser, std::function< std::string()> ext_help) | |
| Constructor. More... | |
| OptionDefinitionImpl & | operator= (const T &val) |
| OptionDefinitionImpl & | operator= (const OptionDefinitionImpl &val) |
| operator T () const | |
| OptionDefinitionImpl (const OptionDefinitionImpl &)=delete | |
| OptionDefinitionImpl (OptionDefinitionImpl &&)=default | |
| int | parse (std::string arg) override |
| Function called to parse the option. More... | |
| void | transfer (OptionDefinition *def) override |
| Function called to transfer the value(s) of a separate OptionDefinition to the current OptionDefinition. More... | |
| void | serialize (SST::Core::Serialization::serializer &ser) override |
| Function called to serialize the data in the OptionDefinition. More... | |
| void | to_string (std::vector< std::string > &out) override |
| Adds a string representation to the input vector for each of the underlying variables. More... | |
Public Member Functions inherited from SST::OptionDefinition | |
| OptionDefinition (std::function< std::string()> ext_help) | |
Data Fields | |
| T | value = T() |
| std::string | name |
| const std::function< int(T &, std::string)> | parser |
Data Fields inherited from SST::OptionDefinition | |
| const std::function< std::string()> | ext_help |
| bool | set_cmdline = false |
Class use to represent OptionDefinitions that store a value.
The class is templated on the type of the stored data.
NOTE: This class should be created using the DECL_OPTION macro, which will also create an accessor function for the underlying data
|
inline |
Constructor.
| name | Name of the option as seen by users of the class |
| val | Initialization value of the underlying value |
| paraser | Function used to parse the value of the option |
|
inline |
Constructor.
| name | Name of the option as seen by users of the class |
| val | Initialization value of the underlying value |
| parser | Function used to parse the value of the option |
| ext_help | Function called to print extended help for the option |
|
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.
| arg | Argument passed to the option on the command line |
Implements SST::OptionDefinition.
|
inlineoverridevirtual |
Function called to serialize the data in the OptionDefinition.
| ser | Serializer used to serialize the data |
Implements SST::OptionDefinition.
|
inlineoverridevirtual |
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.
| [out] | out | vector to put the output strings in |
Implements SST::OptionDefinition.
|
inlineoverridevirtual |
Function called to transfer the value(s) of a separate OptionDefinition to the current OptionDefinition.
| def | OptionDefinition to copy value(s) from |
Implements SST::OptionDefinition.