Documentation for microsoft::quantum::IConfigBind
microsoft::quantum::IConfigBind
#include <Commandline/IConfigBind.hpp>
Inherited by microsoft::quantum::ConfigBind< T >
Public Types
Name | |
---|---|
enum | ParameterVisibility { None = 0, CliOnly = 1, ConfigOnly = 2, CliAndConfig = CliOnly |
Public Functions
Name | |
---|---|
IConfigBind(IConfigBind const & ) | |
IConfigBind(IConfigBind && ) | |
IConfigBind & | operator=(IConfigBind const & ) |
IConfigBind & | operator=(IConfigBind && ) |
virtual | ~IConfigBind() |
virtual bool | setupArguments(ParameterParser & parser) =0 |
virtual bool | configure(ParameterParser & parser, bool experimental_mode) =0 |
virtual void | reset() =0 Resets the value to the default value. |
virtual String | value() =0 |
virtual void * | pointer() const =0 Pointer to underlying data. |
virtual void * | pointerDefaultValue() =0 Pointer to underlying default value. |
virtual std::type_index | valueType() const =0 Type index of contained data. |
virtual void | setValueFromYamlNode(YAML::Node const & node) =0 Method to load value from YAML configuration. |
virtual void | updateValueInYamlNode(YAML::Node & node) =0 Dumps the current value to the node. |
String | name() const Returns the name of the bound configuration variable. |
String | description() const Returns the description of the configuration variable. |
bool | isFlag() const Indicates whether or not this. |
String | defaultValue() const Returns the default value for the flag. |
bool | isExperimental() const Indicates whether or not this is an experimental config. |
bool | isLoadAndSavable() const |
bool | isAvailableToCli() const Indicates whether or not this paramter is available to the CLI. |
void | setShorthandNotation(String const & name) Set shorthand notation. |
String | shorthandNotation() const Gets shorthand notation. |
Protected Functions
Name | |
---|---|
IConfigBind(String const & name, String const & description, ParameterVisibility visibility =ParameterVisibility::CliAndConfig) | |
void | setName(String const & name) Sets the name of the configuration variable. |
void | markAsFlag() Marks the variable as a flag. |
void | setDefault(String const & v) Sets the default value as a string. |
void | makeSettingExperimental() Marks the config as experimental. |
Detailed Description
class microsoft::quantum::IConfigBind;
Interface class to bind a variable to a configuration flag. This class provides the necessary interface to bind variables and populate their value based on given command-line arguments.
Public Types Documentation
enum ParameterVisibility
Enumerator | Value | Description |
---|---|---|
None | 0 | |
CliOnly | 1 | |
ConfigOnly | 2 | |
CliAndConfig | CliOnly | ConfigOnly |
Public Functions Documentation
function IConfigBind
IConfigBind(
IConfigBind const &
)
function IConfigBind
IConfigBind(
IConfigBind &&
)
function operator=
IConfigBind & operator=(
IConfigBind const &
)
function operator=
IConfigBind & operator=(
IConfigBind &&
)
function ~IConfigBind
virtual ~IConfigBind()
function setupArguments
virtual bool setupArguments(
ParameterParser & parser
) =0
Reimplemented by: microsoft::quantum::ConfigBind::setupArguments
Interface function to register configuration in the parser. This function register the configuration to the parameter parser. This makes the configuration available in the parameter parsers help function. This method should return true if arguments were successfully setup.
function configure
virtual bool configure(
ParameterParser & parser,
bool experimental_mode
) =0
Reimplemented by: microsoft::quantum::ConfigBind::configure
Interface function to extract configuration from the command line arguments. Given an instance of the command line parameter parser, this function is meant to read the command line arguments, interpret it and set the bound variable value (if present). This method should return true if configure operation was successful.
function reset
virtual void reset() =0
Resets the value to the default value.
Reimplemented by: microsoft::quantum::ConfigBind::reset
function value
virtual String value() =0
Reimplemented by: microsoft::quantum::ConfigBind::value
Interface function to return a string representation of the current value of the bound variable.
function pointer
virtual void * pointer() const =0
Pointer to underlying data.
Reimplemented by: microsoft::quantum::ConfigBind::pointer
function pointerDefaultValue
virtual void * pointerDefaultValue() =0
Pointer to underlying default value.
Reimplemented by: microsoft::quantum::ConfigBind::pointerDefaultValue
function valueType
virtual std::type_index valueType() const =0
Type index of contained data.
Reimplemented by: microsoft::quantum::ConfigBind::valueType
function setValueFromYamlNode
virtual void setValueFromYamlNode(
YAML::Node const & node
) =0
Method to load value from YAML configuration.
Reimplemented by: microsoft::quantum::ConfigBind::setValueFromYamlNode
function updateValueInYamlNode
virtual void updateValueInYamlNode(
YAML::Node & node
) =0
Dumps the current value to the node.
Reimplemented by: microsoft::quantum::ConfigBind::updateValueInYamlNode
function name
String name() const
Returns the name of the bound configuration variable.
function description
String description() const
Returns the description of the configuration variable.
function isFlag
bool isFlag() const
Indicates whether or not this.
function defaultValue
String defaultValue() const
Returns the default value for the flag.
function isExperimental
bool isExperimental() const
Indicates whether or not this is an experimental config.
function isLoadAndSavable
bool isLoadAndSavable() const
Indicates whether the load and save functions should serialize this configuration.
function isAvailableToCli
bool isAvailableToCli() const
Indicates whether or not this paramter is available to the CLI.
function setShorthandNotation
void setShorthandNotation(
String const & name
)
Set shorthand notation.
function shorthandNotation
String shorthandNotation() const
Gets shorthand notation.
Protected Functions Documentation
function IConfigBind
IConfigBind(
String const & name,
String const & description,
ParameterVisibility visibility =ParameterVisibility::CliAndConfig
)
function setName
void setName(
String const & name
)
Sets the name of the configuration variable.
function markAsFlag
void markAsFlag()
Marks the variable as a flag.
function setDefault
void setDefault(
String const & v
)
Sets the default value as a string.
function makeSettingExperimental
void makeSettingExperimental()
Marks the config as experimental.
Updated on 1 August 2023 at 16:25:10 UTC