|
#include <RobotAPI/libraries/aron/core/type/variant/Variant.h>
Public Types | |
using | PointerType = VariantPtr |
Public Member Functions | |
virtual size_t | childrenSize () const =0 |
virtual std::vector< VariantPtr > | getChildren () const =0 |
get all child elements More... | |
type::Descriptor | getDescriptor () const |
virtual std::string | getFullName () const =0 |
get the full name of this specific type More... | |
virtual type::Maybe | getMaybe () const =0 |
get the maybe type More... | |
Path | getPath () const |
virtual std::string | getShortName () const =0 |
get a short name of this specific type More... | |
virtual VariantPtr | navigateAbsolute (const Path &path) const =0 |
naviate absolute More... | |
virtual VariantPtr | navigateRelative (const Path &path) const =0 |
navigate relative More... | |
virtual bool | operator== (const Variant &other) const =0 |
bool | operator== (const VariantPtr &other) const |
std::string | pathToString () const |
virtual void | setMaybe (const type::Maybe m)=0 |
set the maybetype of this type More... | |
virtual type::dto::GenericTypePtr | toAronDTO () const =0 |
convert this variant to a dto object. More... | |
Variant (const type::Descriptor &descriptor, const Path &path=Path()) | |
virtual | ~Variant ()=default |
Static Public Member Functions | |
static VariantPtr | FromAronDTO (const type::dto::GenericType &, const Path &=Path()) |
create a variant object from an dto object More... | |
Protected Attributes | |
const type::Descriptor | descriptor |
const Path | path |
The Variant class.
This is the parent class of all type variant objects. It provides basic methods to get the children of a type, to get the descriptor, etc. Usually, you get a VariantPtr as input to your code. You can use the descriptor to find out, which specific type is behind a variant. It is type safe. For casting, every variant implementation provides the DynamicCast method, which casts a pointer to the static used type.
This implementation wraps around the underlying ice object (armarx::aron::type::dto::XXX). All data is stored in the ice handle. However, for simplicity, container types also contain pointers to their children variants
Each ice type object has a special member 'maybeType' which holds an enum containing the information of if this type is a pointer, an optional or something else.
using PointerType = VariantPtr |
|
inline |
|
virtualdefault |
|
pure virtual |
|
static |
create a variant object from an dto object
Definition at line 39 of file Variant.cpp.
|
pure virtual |
get all child elements
Implemented in Object, PrimitiveVariant< AronTypeT, DerivedT, ValueT >, Pair, Tuple, EnumVariant< AronTypeT, DerivedT, ValueT >, Dict, NDArrayVariant< AronTypeT, DerivedT >, List, AnyVariant< AronTypeT, DerivedT >, and DtoVariant< AronTypeT, DerivedT >.
|
inline |
|
pure virtual |
|
pure virtual |
get the maybe type
Implemented in SpecializedVariantBase< AronTypeT, DerivedT >.
|
inline |
|
pure virtual |
|
pure virtual |
naviate absolute
Implemented in Object, Pair, Tuple, Dict, List, PrimitiveVariant< AronTypeT, DerivedT, ValueT >, PrimitiveVariant< type::dto::AronInt, Int, int >, PrimitiveVariant< type::dto::AronFloat, Float, float >, PrimitiveVariant< type::dto::AronString, String, std::string >, PrimitiveVariant< type::dto::AronDouble, Double, double >, PrimitiveVariant< type::dto::AronBool, Bool, bool >, PrimitiveVariant< type::dto::AronLong, Long, long >, EnumVariant< AronTypeT, DerivedT, ValueT >, EnumVariant< type::dto::IntEnum, IntEnum, int >, AnyVariant< AronTypeT, DerivedT >, DtoVariant< AronTypeT, DerivedT >, NDArrayVariant< AronTypeT, DerivedT >, AnyVariant< type::dto::AnyObject, AnyObject >, NDArrayVariant< type::dto::Quaternion, Quaternion >, NDArrayVariant< type::dto::Image, Image >, NDArrayVariant< type::dto::NDArray, NDArray >, NDArrayVariant< type::dto::PointCloud, PointCloud >, and NDArrayVariant< type::dto::Matrix, Matrix >.
|
pure virtual |
navigate relative
Implemented in SpecializedVariantBase< AronTypeT, DerivedT >, SpecializedVariantBase< type::dto::Quaternion, Quaternion >, SpecializedVariantBase< type::dto::AronBool, Bool >, SpecializedVariantBase< type::dto::AronObject, Object >, SpecializedVariantBase< type::dto::IntEnum, IntEnum >, SpecializedVariantBase< type::dto::Image, Image >, SpecializedVariantBase< type::dto::AronLong, Long >, SpecializedVariantBase< type::dto::Tuple, Tuple >, SpecializedVariantBase< type::dto::AnyObject, AnyObject >, SpecializedVariantBase< type::dto::NDArray, NDArray >, SpecializedVariantBase< type::dto::AronFloat, Float >, SpecializedVariantBase< type::dto::Dict, Dict >, SpecializedVariantBase< type::dto::Pair, Pair >, SpecializedVariantBase< type::dto::AronDouble, Double >, SpecializedVariantBase< type::dto::PointCloud, PointCloud >, SpecializedVariantBase< type::dto::Matrix, Matrix >, SpecializedVariantBase< type::dto::AronString, String >, SpecializedVariantBase< type::dto::AronInt, Int >, and SpecializedVariantBase< type::dto::List, List >.
|
pure virtual |
Implemented in SpecializedVariantBase< AronTypeT, DerivedT >, SpecializedVariantBase< type::dto::Quaternion, Quaternion >, SpecializedVariantBase< type::dto::AronBool, Bool >, SpecializedVariantBase< type::dto::AronObject, Object >, SpecializedVariantBase< type::dto::IntEnum, IntEnum >, SpecializedVariantBase< type::dto::Image, Image >, SpecializedVariantBase< type::dto::AronLong, Long >, SpecializedVariantBase< type::dto::Tuple, Tuple >, SpecializedVariantBase< type::dto::AnyObject, AnyObject >, SpecializedVariantBase< type::dto::NDArray, NDArray >, SpecializedVariantBase< type::dto::AronFloat, Float >, SpecializedVariantBase< type::dto::Dict, Dict >, SpecializedVariantBase< type::dto::Pair, Pair >, SpecializedVariantBase< type::dto::AronDouble, Double >, SpecializedVariantBase< type::dto::PointCloud, PointCloud >, SpecializedVariantBase< type::dto::Matrix, Matrix >, SpecializedVariantBase< type::dto::AronString, String >, SpecializedVariantBase< type::dto::AronInt, Int >, and SpecializedVariantBase< type::dto::List, List >.
|
inline |
|
inline |
|
pure virtual |
set the maybetype of this type
Implemented in SpecializedVariantBase< AronTypeT, DerivedT >, SpecializedVariantBase< type::dto::Quaternion, Quaternion >, SpecializedVariantBase< type::dto::AronBool, Bool >, SpecializedVariantBase< type::dto::AronObject, Object >, SpecializedVariantBase< type::dto::IntEnum, IntEnum >, SpecializedVariantBase< type::dto::Image, Image >, SpecializedVariantBase< type::dto::AronLong, Long >, SpecializedVariantBase< type::dto::Tuple, Tuple >, SpecializedVariantBase< type::dto::AnyObject, AnyObject >, SpecializedVariantBase< type::dto::NDArray, NDArray >, SpecializedVariantBase< type::dto::AronFloat, Float >, SpecializedVariantBase< type::dto::Dict, Dict >, SpecializedVariantBase< type::dto::Pair, Pair >, SpecializedVariantBase< type::dto::AronDouble, Double >, SpecializedVariantBase< type::dto::PointCloud, PointCloud >, SpecializedVariantBase< type::dto::Matrix, Matrix >, SpecializedVariantBase< type::dto::AronString, String >, SpecializedVariantBase< type::dto::AronInt, Int >, and SpecializedVariantBase< type::dto::List, List >.
|
pure virtual |
convert this variant to a dto object.
In most cases you have to use the specific conversion methods of each type implementation (e.g. to toIntDTO() to get an aron::type::dto::Int object)
Implemented in SpecializedVariantBase< AronTypeT, DerivedT >.
|
protected |