SubObjectFinder Class Reference

Finds aron objects with a given type name prefix in aron variants. More...

#include <RobotAPI/libraries/aron/common/util/object_finders.h>

+ Inheritance diagram for SubObjectFinder:

Public Member Functions

const std::map< std::string, std::pair< aron::data::VariantPtr, aron::type::VariantPtr > > & getFoundObjects ()
 Get the objects that have been found. More...
 
MapElements getObjectElements (DataInput &elementData, TypeInput &elementType) override
 
 SubObjectFinder (const std::string &typeNamePrefix)
 
void visitObjectOnEnter (DataInput &elementData, TypeInput &elementType) override
 
void visitUnknown (DataInput &elementData, TypeInput &elementType) override
 
 ~SubObjectFinder () override=default
 
- Public Member Functions inherited from RecursiveConstTypedVariantVisitor
type::Descriptor getDescriptor (DataInput &o, TypeInput &n) override
 
MapElements getDictElements (DataInput &o, TypeInput &t) override
 
ListElements getListElements (DataInput &o, TypeInput &t) override
 
MapElements getObjectElements (DataInput &o, TypeInput &t) override
 
PairElements getPairElements (DataInput &o, TypeInput &t) override
 
TupleElements getTupleElements (DataInput &o, TypeInput &t) override
 
virtual void visitAronVariant (const data::BoolPtr &, const type::BoolPtr &)
 
virtual void visitAronVariant (const data::DoublePtr &, const type::DoublePtr &)
 
virtual void visitAronVariant (const data::FloatPtr &, const type::FloatPtr &)
 
virtual void visitAronVariant (const data::IntPtr &, const type::IntEnumPtr &)
 
virtual void visitAronVariant (const data::IntPtr &, const type::IntPtr &)
 
virtual void visitAronVariant (const data::LongPtr &, const type::LongPtr &)
 
virtual void visitAronVariant (const data::NDArrayPtr &, const type::ImagePtr &)
 
virtual void visitAronVariant (const data::NDArrayPtr &, const type::MatrixPtr &)
 
virtual void visitAronVariant (const data::NDArrayPtr &, const type::NDArrayPtr &)
 
virtual void visitAronVariant (const data::NDArrayPtr &, const type::PointCloudPtr &)
 
virtual void visitAronVariant (const data::NDArrayPtr &, const type::QuaternionPtr &)
 
virtual void visitAronVariant (const data::StringPtr &, const type::StringPtr &)
 
virtual void visitAronVariantOnEnter (const data::DictPtr &, const type::DictPtr &)
 
virtual void visitAronVariantOnEnter (const data::DictPtr &, const type::ObjectPtr &)
 
virtual void visitAronVariantOnEnter (const data::ListPtr &, const type::ListPtr &)
 
virtual void visitAronVariantOnEnter (const data::ListPtr &, const type::PairPtr &)
 
virtual void visitAronVariantOnEnter (const data::ListPtr &, const type::TuplePtr &)
 
virtual void visitAronVariantOnExit (const data::DictPtr &, const type::DictPtr &)
 
virtual void visitAronVariantOnExit (const data::DictPtr &, const type::ObjectPtr &)
 
virtual void visitAronVariantOnExit (const data::ListPtr &, const type::ListPtr &)
 
virtual void visitAronVariantOnExit (const data::ListPtr &, const type::PairPtr &)
 
virtual void visitAronVariantOnExit (const data::ListPtr &, const type::TuplePtr &)
 
void visitBool (DataInput &, TypeInput &) override
 
void visitDictOnEnter (DataInput &, TypeInput &) override
 
void visitDictOnExit (DataInput &, TypeInput &) override
 
void visitDouble (DataInput &, TypeInput &) override
 
void visitFloat (DataInput &, TypeInput &) override
 
void visitImage (DataInput &, TypeInput &) override
 
void visitInt (DataInput &, TypeInput &) override
 
void visitIntEnum (DataInput &, TypeInput &) override
 
void visitListOnEnter (DataInput &, TypeInput &) override
 
void visitListOnExit (DataInput &, TypeInput &) override
 
void visitLong (DataInput &, TypeInput &) override
 
void visitMatrix (DataInput &, TypeInput &) override
 
void visitNDArray (DataInput &, TypeInput &) override
 
void visitObjectOnEnter (DataInput &, TypeInput &) override
 
void visitObjectOnExit (DataInput &i, TypeInput &j) override
 
void visitPairOnEnter (DataInput &, TypeInput &) override
 
void visitPairOnExit (DataInput &, TypeInput &) override
 
void visitPointCloud (DataInput &, TypeInput &) override
 
void visitQuaternion (DataInput &, TypeInput &) override
 
void visitString (DataInput &, TypeInput &) override
 
void visitTupleOnEnter (DataInput &, TypeInput &) override
 
void visitTupleOnExit (DataInput &, TypeInput &) override
 
virtual ~RecursiveConstTypedVariantVisitor ()=default
 
- Public Member Functions inherited from RecursiveTypedVisitor< const data::VariantPtr, const type::VariantPtr >
virtual void visitAnyObject (DataInput &elementData, TypeInput &elementType)
 
virtual ~RecursiveTypedVisitor ()=default
 
- Public Member Functions inherited from TypedVisitorBase< const data::VariantPtr, const type::VariantPtr >
virtual type::Descriptor getDescriptor (DataInput &, TypeInput &)=0
 
virtual ~TypedVisitorBase ()=default
 

Additional Inherited Members

- Public Types inherited from RecursiveTypedVisitor< const data::VariantPtr, const type::VariantPtr >
using DataInput = typename TypedVisitorBase< const data::VariantPtr, const type::VariantPtr >::DataInput
 
using DataInputNonConst = typename std::remove_const< DataInput >::type
 
using ListElements = std::vector< std::pair< DataInputNonConst, TypeInputNonConst > >
 
using MapElements = std::map< std::string, std::pair< DataInputNonConst, TypeInputNonConst > >
 
using PairElements = std::pair< std::pair< DataInputNonConst, TypeInputNonConst >, std::pair< DataInputNonConst, TypeInputNonConst > >
 
using TupleElements = std::vector< std::pair< DataInputNonConst, TypeInputNonConst > >
 
using TypeInput = typename TypedVisitorBase< const data::VariantPtr, const type::VariantPtr >::TypeInput
 
using TypeInputNonConst = typename std::remove_const< TypeInput >::type
 
- Public Types inherited from TypedVisitorBase< const data::VariantPtr, const type::VariantPtr >
using DataInput = const data::VariantPtr
 
using TypeInput = const type::VariantPtr
 
- Static Public Member Functions inherited from RecursiveConstTypedVariantVisitor
static MapElements GetDictElements (DataInput &o, TypeInput &t)
 
static ListElements GetListElements (DataInput &o, TypeInput &t)
 
static MapElements GetObjectElements (DataInput &o, TypeInput &t)
 
static MapElements GetObjectElementsWithNullType (DataInput &o, TypeInput &t)
 
static PairElements GetPairElements (DataInput &o, TypeInput &t)
 
static TupleElements GetTupleElements (DataInput &o, TypeInput &t)
 

Detailed Description

Finds aron objects with a given type name prefix in aron variants.

Construct it with the prefix you want to search for, then use visitRecursive to run the finder over the variant to search. Get a map of paths to data and type of the found objects using getFoundObjects.

Definition at line 43 of file object_finders.h.

Constructor & Destructor Documentation

◆ SubObjectFinder()

SubObjectFinder ( const std::string &  typeNamePrefix)

Definition at line 27 of file object_finders.cpp.

◆ ~SubObjectFinder()

~SubObjectFinder ( )
overridedefault

Member Function Documentation

◆ getFoundObjects()

const std::map< std::string, std::pair< aron::data::VariantPtr, aron::type::VariantPtr > > & getFoundObjects ( )

Get the objects that have been found.

The keys are strings instead of aron::Paths because those don't support comparisons.

Returns
map of paths to pair of data and type variants

Definition at line 33 of file object_finders.cpp.

◆ getObjectElements()

SubObjectFinder::MapElements getObjectElements ( DataInput elementData,
TypeInput elementType 
)
overridevirtual

◆ visitObjectOnEnter()

void visitObjectOnEnter ( DataInput elementData,
TypeInput elementType 
)
overridevirtual

Reimplemented from RecursiveTypedVisitor< const data::VariantPtr, const type::VariantPtr >.

Definition at line 39 of file object_finders.cpp.

+ Here is the call graph for this function:

◆ visitUnknown()

void visitUnknown ( DataInput elementData,
TypeInput elementType 
)
overridevirtual

The documentation for this class was generated from the following files: