|
|
#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h>
Inheritance diagram for Dict:Public Member Functions | |
| void | addElement (const std::string &key, const VariantPtr &=nullptr) |
| void | addElementCopy (const std::string &key, const VariantPtr &=nullptr) |
| void | addElements (const std::map< std::string, VariantPtr > &elements) |
| Bulk-fill an empty dict from an already unique, sorted element map. | |
| void | addElements (std::map< std::string, VariantPtr > &&elements) |
As above, but takes ownership of elements. | |
| VariantPtr | at (const std::string &) const |
| size_t | childrenSize () const override |
| get the children size of a data variant | |
| void | clear () |
| DictPtr | clone (const Path &p) const override |
| Dict (const data::dto::DictPtr &, const Path &path=Path()) | |
| Dict (const Path &path=Path()) | |
| Dict (const std::map< std::string, VariantPtr > &, const Path &path=Path()) | |
| bool | fullfillsType (const type::VariantPtr &) const override |
| checks, if the current data variant fullfills the given type | |
| std::vector< std::string > | getAllKeys () const |
| std::string | getAllKeysAsString () const |
| std::vector< VariantPtr > | getChildren () const override |
| get the children of a data variant | |
| VariantPtr | getElement (const std::string &) const |
| std::map< std::string, VariantPtr > | getElements () const |
| std::string | getFullName () const override |
| get the full str representation of this variant | |
| std::string | getShortName () const override |
| get a short str representation of this variant | |
| bool | hasElement (const std::string &) const |
| void | mergeAndReplace (const DictPtr &d) |
| void | mergeAndReplaceCopy (const DictPtr &d) |
| VariantPtr | navigateAbsolute (const Path &path) const override |
| naviate absolute | |
| Dict & | operator= (const Dict &) |
| bool | operator== (const Dict &) const override |
| bool | operator== (const DictPtr &) const override |
| VariantPtr | operator[] (const std::string &) const |
| type::VariantPtr | recalculateType () const override |
| recalculate the type of a data variant. Please not tha the mapping ist NOT bijective, so the calculated type may be wrong | |
| void | removeElement (const std::string &key) |
| void | setElement (const std::string &, const VariantPtr &=nullptr) |
| void | setElementCopy (const std::string &, const VariantPtr &=nullptr) |
| data::dto::DictPtr | toAronDictDTO () const |
Public Member Functions inherited from ContainerVariant< data::dto::Dict, Dict > | |
| SpecializedVariantBase ()=delete | |
| SpecializedVariantBase ()=delete | |
| SpecializedVariantBase (const data::Descriptor descriptor, const Path &path=Path()) | |
| SpecializedVariantBase (const data::Descriptor descriptor, const Path &path=Path()) | |
| SpecializedVariantBase (const typename AronDataType::PointerType &o, const data::Descriptor descriptor, const Path &path=Path()) | |
| SpecializedVariantBase (const typename AronDataType::PointerType &o, const data::Descriptor descriptor, const Path &path=Path()) | |
| virtual | ~ContainerVariant ()=default |
Public Member Functions inherited from SpecializedVariantBase< data::dto::Dict, Dict > | |
| virtual PointerType | clone () const |
| VariantPtr | cloneAsVariant () const override |
| get a pointer to a copy of this variant | |
| VariantPtr | cloneAsVariant (const Path &newPath) const override |
| std::optional< float > | getImportance () const override |
| get optional importance metadata for this data variant. | |
| VariantPtr | navigateRelative (const Path &path) const override |
| navigate relative | |
| operator typename AronDataType::PointerType () | |
| bool | operator== (const Variant &other) const override |
| void | setImportance (const std::optional< float > &importance) override |
| set optional importance metadata in [0, 1] for this data variant. | |
| SpecializedVariantBase ()=delete | |
| SpecializedVariantBase (const data::Descriptor descriptor, const Path &path=Path()) | |
| SpecializedVariantBase (const typename AronDataType::PointerType &o, const data::Descriptor descriptor, const Path &path=Path()) | |
| data::dto::GenericDataPtr | toAronDTO () const override |
| convert the variant to the ice representation | |
| virtual | ~SpecializedVariantBase ()=default |
Public Member Functions inherited from Variant | |
| data::Descriptor | getDescriptor () const |
| getter for the descriptor enum | |
| const Path & | getPath () const |
| get the path | |
| bool | operator== (const VariantPtr &other) const |
| std::string | pathToString () const |
| get the path as string | |
| Variant ()=delete | |
| Variant (const data::Descriptor &descriptor, const Path &path) | |
| virtual | ~Variant ()=default |
Static Public Member Functions | |
| static PointerType | FromAronDictDTO (const data::dto::DictPtr &aron) |
| static data::dto::DictPtr | ToAronDictDTO (const PointerType &navigator) |
Static Public Member Functions inherited from SpecializedVariantBase< data::dto::Dict, Dict > | |
| static const Dict & | DynamicCast (const Variant &n) |
| static PointerType | DynamicCast (const VariantPtr &n) |
| static Dict & | DynamicCast (Variant &n) |
| static PointerType | DynamicCastAndCheck (const VariantPtr &n) |
Static Public Member Functions inherited from Variant | |
| static VariantPtr | FromAronDTO (const data::dto::GenericDataPtr &, const Path &=Path()) |
| create a variant from a dto object | |
| static std::vector< VariantPtr > | FromAronDTO (const std::vector< data::dto::GenericDataPtr > &, const Path &=Path()) |
| create a list of variants from a list of dto objects | |
| static std::vector< data::dto::GenericDataPtr > | ToAronDTO (const std::vector< VariantPtr > &) |
| return a list of dto objects from a list of variant objects | |
Additional Inherited Members | |
Public Types inherited from ContainerVariant< data::dto::Dict, Dict > | |
| using | Base |
Public Types inherited from SpecializedVariantBase< data::dto::Dict, Dict > | |
| using | AronDataType |
| using | Base |
| using | PointerType |
Public Types inherited from Variant | |
| using | PointerType = VariantPtr |
Protected Attributes inherited from SpecializedVariantBase< data::dto::Dict, Dict > | |
| AronDataType::PointerType | aron |
Protected Attributes inherited from Variant | |
| const data::Descriptor | descriptor |
| const Path | path |
| Dict | ( | const data::dto::DictPtr & | o, |
| const Path & | path = Path() ) |
| Dict | ( | const std::map< std::string, VariantPtr > & | m, |
| const Path & | path = Path() ) |
| void addElement | ( | const std::string & | key, |
| const VariantPtr & | data = nullptr ) |
| void addElementCopy | ( | const std::string & | key, |
| const VariantPtr & | data = nullptr ) |
| void addElements | ( | const std::map< std::string, VariantPtr > & | elements | ) |
Bulk-fill an empty dict from an already unique, sorted element map.
Equivalent to calling addElement() for every entry, but skips the per-element duplicate lookup and appends with an end-hint instead of searching from the root. Used by the writers, which build the element map before the dict exists.
| void addElements | ( | std::map< std::string, VariantPtr > && | elements | ) |
As above, but takes ownership of elements.
When this dict is still empty the element map becomes the navigator map outright, which saves rebuilding one std::map (a tree node and a key string per element) for every dict in a serialized tree.
| VariantPtr at | ( | const std::string & | s | ) | const |
|
overridevirtual |
get the children size of a data variant
Implements Variant.
| void clear | ( | ) |
Implements SpecializedVariantBase< data::dto::Dict, Dict >.
|
static |
|
overridevirtual |
checks, if the current data variant fullfills the given type
Implements Variant.
| std::vector< std::string > getAllKeys | ( | ) | const |
| std::string getAllKeysAsString | ( | ) | const |
|
overridevirtual |
get the children of a data variant
Implements Variant.
| VariantPtr getElement | ( | const std::string & | key | ) | const |
| std::map< std::string, VariantPtr > getElements | ( | ) | const |
|
overridevirtual |
get the full str representation of this variant
Implements Variant.
|
overridevirtual |
get a short str representation of this variant
Implements Variant.
| bool hasElement | ( | const std::string & | key | ) | const |
| void mergeAndReplace | ( | const DictPtr & | d | ) |
| void mergeAndReplaceCopy | ( | const DictPtr & | d | ) |
|
overridevirtual |
naviate absolute
Implements Variant.
|
overridevirtual |
Implements SpecializedVariantBase< data::dto::Dict, Dict >.
|
overridevirtual |
Implements SpecializedVariantBase< data::dto::Dict, Dict >.
| VariantPtr operator[] | ( | const std::string & | s | ) | const |
|
overridevirtual |
recalculate the type of a data variant. Please not tha the mapping ist NOT bijective, so the calculated type may be wrong
Implements Variant.
| void removeElement | ( | const std::string & | key | ) |
| void setElement | ( | const std::string & | key, |
| const VariantPtr & | data = nullptr ) |
| void setElementCopy | ( | const std::string & | key, |
| const VariantPtr & | data = nullptr ) |
|
static |
| data::dto::DictPtr toAronDictDTO | ( | ) | const |