variant.h
Go to the documentation of this file.
73 using variant_policy_func = bool (*)(variant_policy_operation, const variant_data&, argument_wrapper);
976 detail::enable_if_t<!std::is_arithmetic<T>::value && !std::is_enum<T>::value, T> convert_impl(bool* ok = nullptr) const;
The variant_associative_view describes a class that refers to an associative container (e....
Definition: variant_associative_view.h:93
bool can_convert() const
Returns true if the contained value can be converted to the given type T.
variant & operator=(const variant &other)
Assigns the value of the other variant to this variant.
const T & get_value() const
Returns a reference to the containing value as type T.
bool is_type() const
Returns true if the containing variant data is of the given template type T.
const T & get_wrapped_value() const
Returns a reference to the contained wrapped value as type T.
int32_t to_int32(bool *ok=nullptr) const
Returns the containing variant as an int32_t when the type is an int32_t.
bool convert(const type &target_type)
Converts the containing variant internally to the given type target_type.
int8_t to_int8(bool *ok=nullptr) const
Returns the containing variant as an int8_t when the type is an int8_t.
The variant_sequential_view describes a class that refers to an sequence container (e....
Definition: variant_sequential_view.h:96
T variant_cast(const variant &operand)
Returns a reference to the containing value as type T.
bool operator<=(const variant &other) const
Compares this variant with other and returns true if this is less or equal than other,...
Definition: access_levels.h:34
bool is_valid() const
Returns true if this variant is valid, that means the variant is holding some data.
detail::enum_data< Enum_Type > value(string_view, Enum_Type value)
The value function should be used to add a mapping from enum name to value during the registration pr...
bool operator>(const variant &other) const
Compares this variant with other and returns true if this is greater than other, otherwise returns fa...
variant(const variant &other)
Constructs a new variant object from the given variant other.
variant & operator=(T &&other)
Assigns the value of the other object to this variant.
int16_t to_int16(bool *ok=nullptr) const
Returns the containing variant as an int16_t when the type is an int16_t.
double to_double(bool *ok=nullptr) const
Returns the containing variant as a double when the type is a double.
int64_t to_int64(bool *ok=nullptr) const
Returns the containing variant as an int64_t when the type is an int64_t.
variant_associative_view create_associative_view() const
Creates a variant_associative_view from the containing value, when the type or its raw type or the wr...
uint32_t to_uint32(bool *ok=nullptr) const
Returns the containing variant as an uint32_t when the type is an uint32_t.
bool can_convert(const type &target_type) const
Returns true if the contained value can be converted to the given type target_type; otherwise false.
T convert(bool *ok=nullptr) const
Converts the containing data to a new value of type T and return this value.
int to_int(bool *ok=nullptr) const
Returns the containing variant as an int when the type is an integer.
variant & operator=(variant &&other)
Assigns the value of the other variant to this variant.
bool operator>=(const variant &other) const
Compares this variant with other and returns true if this is greater or equal then other,...
bool operator==(const variant &other) const
Compares this variant with other and returns true if they are equal; otherwise returns false.
float to_float(bool *ok=nullptr) const
Returns the containing variant as a float when the type is a float.
bool operator!=(const variant &other) const
Compares this variant with other and returns true if they are not equal; otherwise returns false.
bool is_sequential_container() const
Returns true, when for the underlying or the wrapped type an sequential_mapper exists.
uint16_t to_uint16(bool *ok=nullptr) const
Returns the containing variant as an uint16_t when the type is an uint16_t.
uint8_t to_uint8(bool *ok=nullptr) const
Returns the containing variant as an uint8_t when the type is an uint8_t.
bool to_bool() const
Returns the variant as a bool if this variant is of type bool.
variant extract_wrapped_value() const
Extracts the wrapped value and copies its content into a new variant.
The instance class is used for forwarding the instance of an object to invoke a property or method.
Definition: instance.h:48
variant_sequential_view create_sequential_view() const
Creates a variant_sequential_view from the containing value, when the type or its raw type or the wra...
bool is_associative_container() const
Returns true, when for the underlying or the wrapped type an associative_mapper exists.
void clear()
When the variant contains a value, then this function will clear the content.
The variant class allows to store data of any type and convert between these types transparently.
Definition: variant.h:199
bool convert(T &value) const
Converts the containing data to the given value value and returns a bool flag that indicated whether ...
std::string to_string(bool *ok=nullptr) const
Returns the containing variant as a std::string when the type is a std::string.
uint64_t to_uint64(bool *ok=nullptr) const
Returns the containing variant as an uint64_t when the type is an uint64_t.
The argument class is used for forwarding arguments to properties or methods.
Definition: argument.h:52
bool operator<(const variant &other) const
Compares this variant with other and returns true if this is less than other, otherwise returns false...
Generated on Mon Aug 12 2024 10:52:01 for rttr - 0.9.6 by doxygen.