#include <kanzi/core/math/srt_value_2d.hpp>#include <kanzi/core/math/srt_value_3d.hpp>#include <kanzi/core/property/property_type.hpp>#include <kanzi/core/cpp/memory.hpp>#include <kanzi/core/cpp/platform.hpp>#include <kanzi/core/cpp/variant.hpp>Classes | |
| struct | kanzi::Variant |
| Union container for manipulating an object from a heterogeneous set of types in a uniform manner. More... | |
Namespaces | |
| kanzi | |
Functions | |
| KANZI_API kzsError | kzuVariantSetEmpty (struct kanzi::Variant *variant) |
| Set a variant to be empty. More... | |
| KANZI_API kzBool | kzuVariantIsEmpty (const struct kanzi::Variant *variant) |
| Checks if a variant is empty. More... | |
| KANZI_API kanzi::PropertyDataType | kzuVariantGetType (const struct kanzi::Variant *variant) |
| Get the type of the value stored in a variant. More... | |
| KANZI_API kzsError | kzuVariantSetFloatWithField (struct kanzi::Variant *variant, kanzi::PropertyField field, float value) |
| Set a float field of a variant. More... | |
| KANZI_API float | kzuVariantGetFloatWithField (const struct kanzi::Variant *variant, kanzi::PropertyField field) |
| Get the float value stored in a variant, also use field. More... | |
| KANZI_API kzBool | kzuVariantIsEqual (const struct kanzi::Variant *variantA, const struct kanzi::Variant *variantB) |
| Check if variants are equal. More... | |
| KANZI_API kanzi::PropertyDataType | kzuVariantResolveType (const struct kanzi::Variant *variant, kanzi::PropertyField field) |
| Resolve the actual data type of a variant, including the field. More... | |
| KANZI_API kzsError | kzuVariantCast (struct kanzi::Variant *targetVariant, kanzi::PropertyDataType targetDataType, const struct kanzi::Variant *sourceVariant, kzBool *out_cast) |
| Cast a variant into the target variant. More... | |
| KANZI_API kzsError | kzuVariantInitializeFromProperty (const kanzi::Object *object, kanzi::AbstractPropertyType propertyType, kanzi::PropertyField field, struct kanzi::Variant *variant, kzBool *out_found) |
| Gets an object's property from a property manager and sets the property value to the given variant. More... | |
| KANZI_API kzsError | kzuVariantSetToProperty (const struct kanzi::Variant *variant, kanzi::Object *object, kanzi::AbstractPropertyType propertyType, kanzi::PropertyField field, kzBool *out_written) |
| Sets an object's property from a variant. More... | |
| KANZI_API kzsError | kzuVariantFilterWithField (struct kanzi::Variant *variant, kanzi::PropertyField field) |
| Changes the value and the type of the variant to a sub-value and a sub-type of the variant. More... | |
| KANZI_API kzsError kzuVariantSetEmpty | ( | struct kanzi::Variant * | variant | ) |
Set a variant to be empty.
Empty variants are considered invalid.
| KANZI_API kzBool kzuVariantIsEmpty | ( | const struct kanzi::Variant * | variant | ) |
Checks if a variant is empty.
Empty variants are considered invalid.
| KANZI_API kanzi::PropertyDataType kzuVariantGetType | ( | const struct kanzi::Variant * | variant | ) |
Get the type of the value stored in a variant.
| KANZI_API kzsError kzuVariantSetFloatWithField | ( | struct kanzi::Variant * | variant, |
| kanzi::PropertyField | field, | ||
| float | value | ||
| ) |
Set a float field of a variant.
| KANZI_API float kzuVariantGetFloatWithField | ( | const struct kanzi::Variant * | variant, |
| kanzi::PropertyField | field | ||
| ) |
Get the float value stored in a variant, also use field.
| KANZI_API kzBool kzuVariantIsEqual | ( | const struct kanzi::Variant * | variantA, |
| const struct kanzi::Variant * | variantB | ||
| ) |
Check if variants are equal.
Empty variants are not equal to each other. KZU_PROPERTY_DATA_TYPE_STRUCT and KZU_PROPERTY_DATA_TYPE_ARRAY data types are not supported.
| KANZI_API kanzi::PropertyDataType kzuVariantResolveType | ( | const struct kanzi::Variant * | variant, |
| kanzi::PropertyField | field | ||
| ) |
Resolve the actual data type of a variant, including the field.
| variant | Variant to examine. |
| field | Field. |
| KANZI_API kzsError kzuVariantCast | ( | struct kanzi::Variant * | targetVariant, |
| kanzi::PropertyDataType | targetDataType, | ||
| const struct kanzi::Variant * | sourceVariant, | ||
| kzBool * | out_cast | ||
| ) |
Cast a variant into the target variant.
| targetVariant | The variant which value is written. |
| targetDataType | ::KzuPropertyDataType to use as the target variant's data type. |
| sourceVariant | The variant which value is read. |
| out_cast | Set on success. The value is KZ_TRUE if the cast succeeded, otherwise KZ_FALSE. |
| KANZI_API kzsError kzuVariantInitializeFromProperty | ( | const kanzi::Object * | object, |
| kanzi::AbstractPropertyType | propertyType, | ||
| kanzi::PropertyField | field, | ||
| struct kanzi::Variant * | variant, | ||
| kzBool * | out_found | ||
| ) |
Gets an object's property from a property manager and sets the property value to the given variant.
| object | Object owning the property to read. |
| propertyType | ::KzuPropertyType of the property to read. |
| field | The field to read from the property. |
| variant | Previously created variant which value is set. |
| out_found | Set on success. The value is KZ_TRUE if the property was found, otherwise KZ_FALSE. |
| KANZI_API kzsError kzuVariantSetToProperty | ( | const struct kanzi::Variant * | variant, |
| kanzi::Object * | object, | ||
| kanzi::AbstractPropertyType | propertyType, | ||
| kanzi::PropertyField | field, | ||
| kzBool * | out_written | ||
| ) |
Sets an object's property from a variant.
| variant | Variant which value is read. |
| object | Object owning the property to set. |
| propertyType | ::KzuPropertyType of the property to set. |
| field | ::KzuPropertyField of the property to set. |
| out_written | Set on success. The value is KZ_TRUE if the property was written, otherwise KZ_FALSE. |
| KANZI_API kzsError kzuVariantFilterWithField | ( | struct kanzi::Variant * | variant, |
| kanzi::PropertyField | field | ||
| ) |
Changes the value and the type of the variant to a sub-value and a sub-type of the variant.
| variant | Variant which value is filtered. |
| field | The field to filter by. |