WriterInterface< R > Class Template Referenceabstract

The WriterInterface class. More...

#include <RobotAPI/libraries/aron/core/type/rw/Writer.h>

Public Types

using ReturnType = R
 
using ReturnTypeConst = typename std::add_const< ReturnType >::type
 

Public Member Functions

virtual type::Descriptor getDescriptor (ReturnTypeConst &input)=0
 
virtual ReturnType writeAnyObject (const type::Maybe maybe, const Path &p)=0
 Construct a time from the params. More...
 
virtual ReturnType writeBool (const std::optional< bool > &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a bool from the params. More...
 
virtual ReturnType writeDict (const ReturnType &acceptedType, const type::Maybe maybe, const Path &p)=0
 Construct a dict from the params. More...
 
virtual ReturnType writeDouble (const std::optional< double > &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a double from the params. More...
 
virtual ReturnType writeFloat (const std::optional< float > &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a float from the params. More...
 
virtual ReturnType writeImage (const type::image::PixelType type, const std::string &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a image from the params. More...
 
virtual ReturnType writeInt (const std::optional< int > &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a int from the params. More...
 
virtual ReturnType writeIntEnum (const std::string &name, const std::map< std::string, int > &acceptedValues, const std::string &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a int enum from the params. More...
 
virtual ReturnType writeList (const ReturnType &acceptedType, const type::Maybe maybe, const Path &p)=0
 Construct a list from the params. More...
 
virtual ReturnType writeLong (const std::optional< long > &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a long from the params. More...
 
virtual ReturnType writeMatrix (const int rows, const int cols, const type::matrix::ElementType type, const std::string &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a matrix from the params. More...
 
virtual ReturnType writeNDArray (const int ndim, const type::ndarray::ElementType type, const std::string &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a ndarray from the params. More...
 
virtual ReturnType writeNull (const Path &p=Path())
 write a null More...
 
virtual ReturnType writeObject (const std::string &name, const std::vector< std::string > &templates, const std::vector< std::string > &templateInstantiations, const std::map< std::string, ReturnType > &memberTypes, const std::optional< ReturnType > &extends, const type::Maybe maybe, const Path &p)=0
 Construct an object from the params. More...
 
virtual ReturnType writePair (const ReturnType &acceptedType1, const ReturnType &acceptedType2, const type::Maybe maybe, const Path &p)=0
 Construct a pair from the params. More...
 
virtual ReturnType writePointCloud (const type::pointcloud::VoxelType, const std::string &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a pointcloud from the params. More...
 
virtual ReturnType writeQuaternion (const type::quaternion::ElementType type, const std::string &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a quaternion from the params. More...
 
virtual ReturnType writeString (const std::optional< std::string > &defaultValue, const type::Maybe maybe, const Path &p)=0
 Construct a string from the params. More...
 
virtual ReturnType writeTuple (const std::vector< ReturnType > &acceptedTypes, const type::Maybe maybe, const Path &p)=0
 Construct a tuple from the params. More...
 
virtual ~WriterInterface ()=default
 

Detailed Description

template<class R>
class armarx::aron::type::WriterInterface< R >

The WriterInterface class.

It defines the interface to construct aron representations (e.g. variant or nlohmann::json)

Definition at line 38 of file Writer.h.

Member Typedef Documentation

◆ ReturnType

using ReturnType = R

Definition at line 41 of file Writer.h.

◆ ReturnTypeConst

using ReturnTypeConst = typename std::add_const<ReturnType>::type

Definition at line 42 of file Writer.h.

Constructor & Destructor Documentation

◆ ~WriterInterface()

virtual ~WriterInterface ( )
virtualdefault

Member Function Documentation

◆ getDescriptor()

virtual type::Descriptor getDescriptor ( ReturnTypeConst input)
pure virtual

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeAnyObject()

virtual ReturnType writeAnyObject ( const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a time from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeBool()

virtual ReturnType writeBool ( const std::optional< bool > &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a bool from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeDict()

virtual ReturnType writeDict ( const ReturnType acceptedType,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a dict from the params.

Implemented in NlohmannJSONWriter.

◆ writeDouble()

virtual ReturnType writeDouble ( const std::optional< double > &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a double from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeFloat()

virtual ReturnType writeFloat ( const std::optional< float > &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a float from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeImage()

virtual ReturnType writeImage ( const type::image::PixelType  type,
const std::string &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a image from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeInt()

virtual ReturnType writeInt ( const std::optional< int > &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a int from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeIntEnum()

virtual ReturnType writeIntEnum ( const std::string &  name,
const std::map< std::string, int > &  acceptedValues,
const std::string &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a int enum from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeList()

virtual ReturnType writeList ( const ReturnType acceptedType,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a list from the params.

Implemented in NlohmannJSONWriter.

◆ writeLong()

virtual ReturnType writeLong ( const std::optional< long > &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a long from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeMatrix()

virtual ReturnType writeMatrix ( const int  rows,
const int  cols,
const type::matrix::ElementType  type,
const std::string &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a matrix from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeNDArray()

virtual ReturnType writeNDArray ( const int  ndim,
const type::ndarray::ElementType  type,
const std::string &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a ndarray from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeNull()

virtual ReturnType writeNull ( const Path p = Path())
inlinevirtual

write a null

Definition at line 151 of file Writer.h.

◆ writeObject()

virtual ReturnType writeObject ( const std::string &  name,
const std::vector< std::string > &  templates,
const std::vector< std::string > &  templateInstantiations,
const std::map< std::string, ReturnType > &  memberTypes,
const std::optional< ReturnType > &  extends,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct an object from the params.

Implemented in NlohmannJSONWriter.

◆ writePair()

virtual ReturnType writePair ( const ReturnType acceptedType1,
const ReturnType acceptedType2,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a pair from the params.

Implemented in NlohmannJSONWriter.

◆ writePointCloud()

virtual ReturnType writePointCloud ( const type::pointcloud::VoxelType  ,
const std::string &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a pointcloud from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeQuaternion()

virtual ReturnType writeQuaternion ( const type::quaternion::ElementType  type,
const std::string &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a quaternion from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeString()

virtual ReturnType writeString ( const std::optional< std::string > &  defaultValue,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a string from the params.

Implemented in NlohmannJSONWriter, and VariantWriter.

◆ writeTuple()

virtual ReturnType writeTuple ( const std::vector< ReturnType > &  acceptedTypes,
const type::Maybe  maybe,
const Path p 
)
pure virtual

Construct a tuple from the params.

Implemented in NlohmannJSONWriter.


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