#include <Param.hh>
|
typedef std::variant< bool, char, std::string, int, std::uint64_t, unsigned int, double, float, sdf::Time, gz::math::Angle, gz::math::Color, gz::math::Vector2i, gz::math::Vector2d, gz::math::Vector3d, gz::math::Quaterniond, gz::math::Pose3d > | ParamVariant |
|
|
void | Init (const std::string &_key, const std::string &_typeName, const std::string &_default, bool _required, const std::string &_minValue, const std::string &_maxValue, sdf::Errors &_errors, const std::string &_description) |
| Initializer function to help Param constructors. More...
|
|
void | Init (const std::string &_key, const std::string &_typeName, const std::string &_default, bool _required, sdf::Errors &_errors, const std::string &_description) |
| Initializer function to help Param constructors. More...
|
|
bool | StringFromValueImpl (const PrintConfig &_config, const std::string &_typeName, const ParamVariant &_value, std::string &_valueStr, sdf::Errors &_errors) const |
| Method used to get the string representation from a ParamVariant, or the string that was used to set it. More...
|
|
template<typename T > |
std::string | TypeToString () const |
| Data type to string mapping. More...
|
|
bool GZ_SDFORMAT_VISIBLE | ValueFromStringImpl (const std::string &_typeName, const std::string &_valueStr, ParamVariant &_valueToSet, sdf::Errors &_errors) const |
| Method used to set the Param from a passed-in string. More...
|
|
◆ ParamVariant
typedef std::variant<bool, char, std::string, int, std::uint64_t, unsigned int, double, float, sdf::Time, gz::math::Angle, gz::math::Color, gz::math::Vector2i, gz::math::Vector2d, gz::math::Vector3d, gz::math::Quaterniond, gz::math::Pose3d> sdf::SDF_VERSION_NAMESPACE::ParamPrivate::ParamVariant |
◆ Init() [1/2]
void sdf::SDF_VERSION_NAMESPACE::ParamPrivate::Init |
( |
const std::string & |
_key, |
|
|
const std::string & |
_typeName, |
|
|
const std::string & |
_default, |
|
|
bool |
_required, |
|
|
const std::string & |
_minValue, |
|
|
const std::string & |
_maxValue, |
|
|
sdf::Errors & |
_errors, |
|
|
const std::string & |
_description |
|
) |
| |
Initializer function to help Param constructors.
- Parameters
-
[in] | _key | Key for the parameter. |
[in] | _typeName | String name for the value type (double, int,...). |
[in] | _default | Default value. |
[in] | _required | True if the parameter is required to be set. |
[in] | _minValue | Minimum allowed value for the parameter. |
[in] | _maxValue | Maximum allowed value for the parameter. |
[out] | _errors | Vector of errors. |
[in] | _description | Description of the parameter. |
◆ Init() [2/2]
void sdf::SDF_VERSION_NAMESPACE::ParamPrivate::Init |
( |
const std::string & |
_key, |
|
|
const std::string & |
_typeName, |
|
|
const std::string & |
_default, |
|
|
bool |
_required, |
|
|
sdf::Errors & |
_errors, |
|
|
const std::string & |
_description |
|
) |
| |
Initializer function to help Param constructors.
- Parameters
-
[in] | _key | Key for the parameter. |
[in] | _typeName | String name for the value type (double, int,...). |
[in] | _default | Default value. |
[in] | _required | True if the parameter is required to be set. |
[out] | _errors | Vector of errors. |
[in] | _description | Description of the parameter. |
◆ StringFromValueImpl()
bool sdf::SDF_VERSION_NAMESPACE::ParamPrivate::StringFromValueImpl |
( |
const PrintConfig & |
_config, |
|
|
const std::string & |
_typeName, |
|
|
const ParamVariant & |
_value, |
|
|
std::string & |
_valueStr, |
|
|
sdf::Errors & |
_errors |
|
) |
| const |
Method used to get the string representation from a ParamVariant, or the string that was used to set it.
- Parameters
-
[in] | _config | Print configuration for the string output |
[in] | _typeName | The data type of the value |
[in] | _value | The value |
[out] | _valueStr | The output string. |
[out] | _errors | Vector of errors. |
- Returns
- True if the string was successfully retrieved, false otherwise.
◆ TypeToString()
template<typename T >
std::string sdf::SDF_VERSION_NAMESPACE::ParamPrivate::TypeToString |
Data type to string mapping.
- Returns
- The type as a string, empty string if unknown type
◆ ValueFromStringImpl()
bool GZ_SDFORMAT_VISIBLE sdf::SDF_VERSION_NAMESPACE::ParamPrivate::ValueFromStringImpl |
( |
const std::string & |
_typeName, |
|
|
const std::string & |
_valueStr, |
|
|
ParamVariant & |
_valueToSet, |
|
|
sdf::Errors & |
_errors |
|
) |
| const |
Method used to set the Param from a passed-in string.
- Parameters
-
[in] | _typeName | The data type of the value to set |
[in] | _valueStr | The value as a string |
[out] | _valueToSet | The value to set |
[out] | _errors | Vector of errors. |
- Returns
- True if the value was successfully set, false otherwise
◆ defaultStrValue
std::string sdf::SDF_VERSION_NAMESPACE::ParamPrivate::defaultStrValue |
This parameter's default value that was provided as a string.
◆ defaultValue
ParamVariant sdf::SDF_VERSION_NAMESPACE::ParamPrivate::defaultValue |
This parameter's default value.
◆ description
std::string sdf::SDF_VERSION_NAMESPACE::ParamPrivate::description |
Description of the parameter.
◆ ignoreParentAttributes
bool sdf::SDF_VERSION_NAMESPACE::ParamPrivate::ignoreParentAttributes |
True if the value has been parsed while ignoring its parent element's attributes, and will continue to ignore them for subsequent reparses.
◆ key
std::string sdf::SDF_VERSION_NAMESPACE::ParamPrivate::key |
◆ maxValue
std::optional<ParamVariant> sdf::SDF_VERSION_NAMESPACE::ParamPrivate::maxValue |
This parameter's maximum allowed value.
◆ minValue
std::optional<ParamVariant> sdf::SDF_VERSION_NAMESPACE::ParamPrivate::minValue |
This parameter's minimum allowed value.
◆ parentElement
ElementWeakPtr sdf::SDF_VERSION_NAMESPACE::ParamPrivate::parentElement |
◆ required
bool sdf::SDF_VERSION_NAMESPACE::ParamPrivate::required |
True if the parameter is required.
◆ set
bool sdf::SDF_VERSION_NAMESPACE::ParamPrivate::set |
True if the parameter is set.
◆ strValue
std::optional<std::string> sdf::SDF_VERSION_NAMESPACE::ParamPrivate::strValue |
This parameter's value that was provided as a string.
◆ typeName
std::string sdf::SDF_VERSION_NAMESPACE::ParamPrivate::typeName |
◆ updateFunc
std::function<std::any ()> sdf::SDF_VERSION_NAMESPACE::ParamPrivate::updateFunc |
◆ value
ParamVariant sdf::SDF_VERSION_NAMESPACE::ParamPrivate::value |
The documentation for this class was generated from the following file: