Go to the documentation of this file.
29 #include <unordered_map>
38 template <
typename AronTypeT,
typename DerivedT,
typename ValueT>
55 "Could not navigate through a non container navigator. The input path was: " +
60 std::vector<VariantPtr>
75 this->
aron->acceptedValues = valueMap;
78 std::map<std::string, int>
81 return this->
aron->acceptedValues;
84 std::vector<std::string>
87 std::vector<std::string>
names;
88 for (
const auto& [k, _] : this->
aron->acceptedValues)
95 std::vector<ValueType>
98 std::vector<ValueType> vals;
99 for (
const auto& [_, i] : this->
aron->acceptedValues)
109 for (
const auto& [k,
v] : this->
aron->acceptedValues)
117 "Enum could not be resolved. Input was: " +
125 return this->
aron->acceptedValues[
s];
131 return this->
aron->enumName;
137 this->
aron->enumName =
s;
143 this->
aron->acceptedValues[
s] = i;
149 return this->
aron->defaultValue;
160 return this->
aron->acceptedValues[this->
aron->defaultValue];
166 for (
const auto& [key,
value] : this->
aron->acceptedValues)
170 this->
aron->defaultValue = key;
174 __PRETTY_FUNCTION__,
"Got invalid input for enum value",
std::to_string(
v));
185 this->
aron->defaultValue =
v;
size_t childrenSize() const override
A base class for aron exceptions.
std::shared_ptr< Variant > VariantPtr
std::vector< std::string > getAcceptedValueNames() const
std::string getEnumName() const
void addAcceptedValue(const std::string &s, ValueType i)
std::vector< ValueType > getAcceptedValues() const
void setDefaultValueName(const std::string &v)
std::vector< VariantPtr > getChildren() const override
get all child elements
int getValue(const std::string &s) const
std::string getDefaultValueName() const
The ValueNotValidException class.
std::shared_ptr< Value > value()
std::string getValueName(ValueType i) const
AronTypeT::PointerType aron
void setDefaultValue(const ValueType &v)
const std::string & to_string(const std::string &s)
double v(double t, double v0, double a0, double j)
const simox::meta::IntEnumNames names
void setAcceptedValueMap(const std::map< std::string, ValueType > &valueMap)
void setEnumName(const std::string &s)
ValueType getDefaultValue() const
std::map< std::string, int > getAcceptedValueMap() const
virtual ~EnumVariant()=default
double s(double t, double s0, double v0, double a0, double j)
VariantPtr navigateAbsolute(const Path &path) const override
naviate absolute
SpecializedVariantBase(const type::Descriptor &descriptor, const Path &path)
std::string toString() const