|
SST 16.0.0
Structural Simulation Toolkit
|
Class use to represent OptionDefinitions that need to store two values. More...
#include <configBase.h>
Public Member Functions | |
| OptionDefinitionPair (std::string name1, T val1, std::string name2, U val2, std::function< int(T &, U &, std::string)> parser) | |
| Constructor. | |
| OptionDefinitionPair (std::string name1, T val1, std::string name2, U val2, std::function< int(T &, U &, std::string)> parser, std::function< std::string()> ext_help) | |
| Constructor. | |
| OptionDefinitionPair (const OptionDefinitionPair &)=delete | |
| OptionDefinitionPair (OptionDefinitionPair &&)=default | |
| int | parse (std::string arg) override |
| Function called to parse the option. | |
| void | transfer (OptionDefinition *def) override |
| Function called to transfer the value(s) of a separate OptionDefinition to the current OptionDefinition. | |
| void | serialize (SST::Core::Serialization::serializer &ser) override |
| Function called to serialize the data in the OptionDefinition. | |
| void | to_string (std::vector< std::string > &out) override |
| Adds a string representation to the input vector for each of the underlying variables. | |
| Public Member Functions inherited from SST::OptionDefinition | |
| OptionDefinition (std::function< std::string()> ext_help) | |
Data Fields | |
| T | value1 = T() |
| std::string | name1 |
| U | value2 = U() |
| std::string | name2 |
| const std::function< int(T &, U &, 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 need to store two values.
The class is templated on the types of the stored data.
NOTE: This class should be created using the DECL_OPTION_PAIR macro, which will also create accessor functions the two underlying data types.
|
inline |
Constructor.
| name1 | Name of the first value |
| val1 | Initialzation value of value1 |
| name2 | Name of the first value |
| val2 | Initialzation value of value2 |
| parser | Function used to parese the values |
Referenced by transfer().
|
inline |
Constructor.
| name1 | Name of the first value |
| val1 | Initialzation value of value1 |
| name2 | Name of the first value |
| val2 | Initialzation value of value2 |
| parser | Function used to parese the values |
| ext_help | Function called to print the 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.
References OptionDefinitionPair().