armarx::aron::data Namespace Reference

A convenience header to include all aron files (full include, not forward declared) More...

Namespaces

namespace  converter
 
namespace  defaultconversion
 
namespace  detail
 
namespace  dto
 
namespace  filter
 
namespace  reader
 
namespace  rw
 
namespace  writer
 

Classes

class  Bool
 
struct  ConstNlohmannJSONVisitor
 
struct  ConstTypedVariantVisitor
 
struct  ConstVariantVisitor
 
struct  Converter
 Converter struct providing the needed methods. More...
 
class  Dict
 
class  Double
 
class  Float
 
struct  FromNlohmannJSONConverter
 
struct  FromVariantConverter
 
class  Int
 
class  List
 
class  Long
 
class  NDArray
 
class  ReaderInterface
 
struct  RecursiveConstTypedVariantVisitor
 
struct  RecursiveConstVariantVisitor
 
struct  RecursiveTypedVisitor
 
struct  RecursiveVariantVisitor
 
struct  RecursiveVisitor
 
class  String
 
struct  ToNlohmannJSONConverter
 
struct  ToVariantConverter
 
struct  TypedVisitor
 
struct  TypedVisitorBase
 
class  Variant
 The Variant class. More...
 
class  VariantFactory
 The VariantFactory class. More...
 
struct  Visitor
 
struct  VisitorBase
 
class  WriterInterface
 

Typedefs

using BoolPtr = std::shared_ptr<Bool>
 
using DictPtr = std::shared_ptr<Dict>
 
using DoublePtr = std::shared_ptr<Double>
 
using FloatPtr = std::shared_ptr<Float>
 
using IntPtr = std::shared_ptr<Int>
 
using ListPtr = std::shared_ptr<List>
 
using LongPtr = std::shared_ptr<Long>
 
using NDArrayPtr = std::shared_ptr<NDArray>
 
using StringPtr = std::shared_ptr<String>
 
typedef std::unique_ptr< VariantFactory > VariantFactoryPtr
 
using VariantPtr = std::shared_ptr<Variant>
 

Enumerations

enum class  Descriptor {
  LIST , DICT , NDARRAY , INT ,
  LONG , FLOAT , DOUBLE , STRING ,
  BOOL , UNKNOWN = -1
}
 

Functions

data::Descriptor Aron2Descriptor (const data::dto::GenericData &t)
 
template<class T>
decltype(auto) dereferenceElement (const T &element)
 Normalises access to a child element handed out by a reader.
 
template<class ConverterImplementation>
requires isConverter<ConverterImplementation>
ConverterImplementation::WriterReturnType readAndWrite (typename ConverterImplementation::ReaderInputType &o)
 the function to read from a variant and write to a writer T returns the returntype of T
 
template<class VisitorImplementation>
requires isTypedVisitor<VisitorImplementation, typename VisitorImplementation::DataInput, typename VisitorImplementation::TypeInput>
void visit (VisitorImplementation &v, typename VisitorImplementation::DataInput &o, typename VisitorImplementation::TypeInput &t)
 
template<class VisitorImplementation>
requires isVisitor<VisitorImplementation, typename VisitorImplementation::Input>
void visit (VisitorImplementation &v, typename VisitorImplementation::Input &o)
 
template<class RecursiveVisitorImplementation>
requires isRecursiveTypedVisitor<RecursiveVisitorImplementation, typename RecursiveVisitorImplementation::DataInput, typename RecursiveVisitorImplementation::TypeInput>
void visitRecursive (RecursiveVisitorImplementation &v, typename RecursiveVisitorImplementation::DataInput &o, typename RecursiveVisitorImplementation::TypeInput &t)
 
template<class RecursiveVisitorImplementation>
requires isRecursiveVisitor<RecursiveVisitorImplementation, typename RecursiveVisitorImplementation::Input>
void visitRecursive (RecursiveVisitorImplementation &v, typename RecursiveVisitorImplementation::Input &o)
 

Variables

const std::vector< data::Descriptor > AllDescriptors
 

Detailed Description

A convenience header to include all aron files (full include, not forward declared)

forward declarations of ALL aron data objects

Typedef Documentation

◆ BoolPtr

typedef std::shared_ptr< Bool > BoolPtr = std::shared_ptr<Bool>

◆ DictPtr

typedef std::shared_ptr< Dict > DictPtr = std::shared_ptr<Dict>

◆ DoublePtr

typedef std::shared_ptr< Double > DoublePtr = std::shared_ptr<Double>

◆ FloatPtr

typedef std::shared_ptr< Float > FloatPtr = std::shared_ptr<Float>

◆ IntPtr

typedef std::shared_ptr< Int > IntPtr = std::shared_ptr<Int>

◆ ListPtr

typedef std::shared_ptr< List > ListPtr = std::shared_ptr<List>

◆ LongPtr

typedef std::shared_ptr< Long > LongPtr = std::shared_ptr<Long>

◆ NDArrayPtr

typedef std::shared_ptr< NDArray > NDArrayPtr = std::shared_ptr<NDArray>

◆ StringPtr

typedef std::shared_ptr< String > StringPtr = std::shared_ptr<String>

◆ VariantFactoryPtr

typedef std::unique_ptr<VariantFactory> VariantFactoryPtr

◆ VariantPtr

typedef std::shared_ptr< Variant > VariantPtr = std::shared_ptr<Variant>

Enumeration Type Documentation

◆ Descriptor

enum class Descriptor
strong
Enumerator
LIST 
DICT 
NDARRAY 
INT 
LONG 
FLOAT 
DOUBLE 
STRING 
BOOL 
UNKNOWN 

Function Documentation

◆ Aron2Descriptor()

data::Descriptor Aron2Descriptor ( const data::dto::GenericData & t)
inline

◆ dereferenceElement()

template<class T>
decltype(auto) dereferenceElement ( const T & element)

Normalises access to a child element handed out by a reader.

Readers may hand out children either by value (VariantReader: the elements are shared_ptrs, so copying is cheap) or as pointers into the input tree (NlohmannJSONReader: a nlohmann::json owns its subtree, so handing one out by value would deep-copy that whole subtree). This lets call sites treat both the same way.

◆ readAndWrite()

template<class ConverterImplementation>
requires isConverter<ConverterImplementation>
ConverterImplementation::WriterReturnType readAndWrite ( typename ConverterImplementation::ReaderInputType & o)

the function to read from a variant and write to a writer T returns the returntype of T

◆ visit() [1/2]

template<class VisitorImplementation>
requires isTypedVisitor<VisitorImplementation, typename VisitorImplementation::DataInput, typename VisitorImplementation::TypeInput>
void visit ( VisitorImplementation & v,
typename VisitorImplementation::DataInput & o,
typename VisitorImplementation::TypeInput & t )
See also
type/visitor/Visitor.h This implemntation visits a data and type representation simultaneously (based on the type descriptor). Does NOT check if the data and type representation match!

◆ visit() [2/2]

template<class VisitorImplementation>
requires isVisitor<VisitorImplementation, typename VisitorImplementation::Input>
void visit ( VisitorImplementation & v,
typename VisitorImplementation::Input & o )

◆ visitRecursive() [1/2]

template<class RecursiveVisitorImplementation>
requires isRecursiveTypedVisitor<RecursiveVisitorImplementation, typename RecursiveVisitorImplementation::DataInput, typename RecursiveVisitorImplementation::TypeInput>
void visitRecursive ( RecursiveVisitorImplementation & v,
typename RecursiveVisitorImplementation::DataInput & o,
typename RecursiveVisitorImplementation::TypeInput & t )

◆ visitRecursive() [2/2]

template<class RecursiveVisitorImplementation>
requires isRecursiveVisitor<RecursiveVisitorImplementation, typename RecursiveVisitorImplementation::Input>
void visitRecursive ( RecursiveVisitorImplementation & v,
typename RecursiveVisitorImplementation::Input & o )

Variable Documentation

◆ AllDescriptors

const std::vector<data::Descriptor> AllDescriptors
Initial value:
@ LIST
Definition Descriptor.h:181
@ INT
Definition Descriptor.h:184
@ STRING
Definition Descriptor.h:188
@ UNKNOWN
Definition Descriptor.h:190
@ BOOL
Definition Descriptor.h:189
@ LONG
Definition Descriptor.h:185
@ DICT
Definition Descriptor.h:182
@ NDARRAY
Definition Descriptor.h:183
@ FLOAT
Definition Descriptor.h:186
@ DOUBLE
Definition Descriptor.h:187