NDArray Class Reference

#include <RobotAPI/libraries/aron/core/data/variant/complex/NDArray.h>

+ Inheritance diagram for NDArray:

Public Member Functions

void addToShape (int)
 
NDArrayPtr clone (const Path &p) const override
 
virtual bool fullfillsType (const type::VariantPtr &) const override
 checks, if the current data variant fullfills the given type
 
DictPtr getAsDict () const
 
unsigned char * getData () const
 
std::vector< unsigned char > getDataAsVector () const
 
virtual std::string getFullName () const override
 get the full str representation of this variant
 
std::vector< int > getShape () const
 
virtual std::string getShortName () const override
 get a short str representation of this variant
 
std::string getType () const
 
 NDArray (const data::dto::NDArrayPtr &, const Path &path=Path())
 
 NDArray (const Path &path=Path())
 
 NDArray (const std::vector< int > &, const std::string &, const std::vector< unsigned char > &, const Path &path=Path())
 
virtual bool operator== (const NDArray &) const override
 
bool operator== (const NDArrayPtr &) const override
 
virtual 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 setData (unsigned int, const unsigned char *)
 
void setShape (const std::vector< int > &)
 
void setType (const std::string &)
 
data::dto::NDArrayPtr toNDArrayDTO () const
 
- Public Member Functions inherited from ComplexVariant< data::dto::NDArray, NDArray >
size_t childrenSize () const override
 get the children size of a data variant
 
std::vector< VariantPtrgetChildren () const override
 get the children of a data variant
 
VariantPtr navigateAbsolute (const Path &path) const override
 naviate absolute
 
 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 ~ComplexVariant ()=default
 
- Public Member Functions inherited from SpecializedVariantBase< data::dto::NDArray, NDArray >
virtual PointerType clone () const
 
VariantPtr cloneAsVariant () const override
 get a pointer to a copy of this variant
 
VariantPtr cloneAsVariant (const Path &newPath) const override
 
VariantPtr navigateRelative (const Path &path) const override
 navigate relative
 
 operator typename AronDataType::PointerType ()
 
bool operator== (const Variant &other) const override
 
 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
 
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 std::string DimensionsToString (const std::vector< int > &dimensions)
 Return dimensions in a readable string such as "(2, 3, 4)".
 
static PointerType FromNDArrayDTO (const data::dto::NDArrayPtr &aron)
 
static data::dto::NDArrayPtr ToNDArrayDTO (const PointerType &navigator)
 
- Static Public Member Functions inherited from SpecializedVariantBase< data::dto::NDArray, NDArray >
static const NDArrayDynamicCast (const Variant &n)
 
static PointerType DynamicCast (const VariantPtr &n)
 
static NDArrayDynamicCast (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< VariantPtrFromAronDTO (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 ComplexVariant< data::dto::NDArray, NDArray >
using Base
 
- Public Types inherited from SpecializedVariantBase< data::dto::NDArray, NDArray >
using AronDataType
 
using Base
 
using PointerType
 
- Public Types inherited from Variant
using PointerType = VariantPtr
 
- Protected Attributes inherited from SpecializedVariantBase< data::dto::NDArray, NDArray >
AronDataType::PointerType aron
 
- Protected Attributes inherited from Variant
const data::Descriptor descriptor
 
const Path path
 

Detailed Description

Definition at line 48 of file NDArray.h.

Constructor & Destructor Documentation

◆ NDArray() [1/3]

NDArray ( const Path & path = Path())

Definition at line 39 of file NDArray.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NDArray() [2/3]

NDArray ( const data::dto::NDArrayPtr & o,
const Path & path = Path() )

Definition at line 46 of file NDArray.cpp.

+ Here is the call graph for this function:

◆ NDArray() [3/3]

NDArray ( const std::vector< int > & dim,
const std::string & t,
const std::vector< unsigned char > & data,
const Path & path = Path() )

Definition at line 54 of file NDArray.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ addToShape()

void addToShape ( int i)

Definition at line 159 of file NDArray.cpp.

◆ clone()

NDArrayPtr clone ( const Path & p) const
overridevirtual

Implements SpecializedVariantBase< data::dto::NDArray, NDArray >.

Definition at line 94 of file NDArray.cpp.

+ Here is the call graph for this function:

◆ DimensionsToString()

std::string DimensionsToString ( const std::vector< int > & dimensions)
static

Return dimensions in a readable string such as "(2, 3, 4)".

Definition at line 257 of file NDArray.cpp.

+ Here is the caller graph for this function:

◆ FromNDArrayDTO()

NDArrayPtr FromNDArrayDTO ( const data::dto::NDArrayPtr & aron)
static

Definition at line 102 of file NDArray.cpp.

◆ fullfillsType()

bool fullfillsType ( const type::VariantPtr & ) const
overridevirtual

checks, if the current data variant fullfills the given type

Implements Variant.

Definition at line 210 of file NDArray.cpp.

+ Here is the call graph for this function:

◆ getAsDict()

DictPtr getAsDict ( ) const

Definition at line 119 of file NDArray.cpp.

+ Here is the call graph for this function:

◆ getData()

unsigned char * getData ( ) const

Definition at line 128 of file NDArray.cpp.

◆ getDataAsVector()

std::vector< unsigned char > getDataAsVector ( ) const

Definition at line 141 of file NDArray.cpp.

+ Here is the caller graph for this function:

◆ getFullName()

std::string getFullName ( ) const
overridevirtual

get the full str representation of this variant

Implements Variant.

Definition at line 196 of file NDArray.cpp.

◆ getShape()

std::vector< int > getShape ( ) const

Definition at line 147 of file NDArray.cpp.

+ Here is the caller graph for this function:

◆ getShortName()

std::string getShortName ( ) const
overridevirtual

get a short str representation of this variant

Implements Variant.

Definition at line 190 of file NDArray.cpp.

◆ getType()

std::string getType ( ) const

Definition at line 165 of file NDArray.cpp.

+ Here is the caller graph for this function:

◆ operator==() [1/2]

bool operator== ( const NDArray & other) const
overridevirtual

Implements SpecializedVariantBase< data::dto::NDArray, NDArray >.

Definition at line 64 of file NDArray.cpp.

+ Here is the call graph for this function:

◆ operator==() [2/2]

bool operator== ( const NDArrayPtr & other) const
overridevirtual

Implements SpecializedVariantBase< data::dto::NDArray, NDArray >.

Definition at line 84 of file NDArray.cpp.

◆ recalculateType()

type::VariantPtr recalculateType ( ) 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.

Definition at line 203 of file NDArray.cpp.

◆ setData()

void setData ( unsigned int elements,
const unsigned char * src )

Definition at line 134 of file NDArray.cpp.

◆ setShape()

void setShape ( const std::vector< int > & d)

Definition at line 153 of file NDArray.cpp.

◆ setType()

void setType ( const std::string & t)

Definition at line 171 of file NDArray.cpp.

+ Here is the call graph for this function:

◆ ToNDArrayDTO()

data::dto::NDArrayPtr ToNDArrayDTO ( const PointerType & navigator)
static

Definition at line 112 of file NDArray.cpp.

◆ toNDArrayDTO()

data::dto::NDArrayPtr toNDArrayDTO ( ) const

Definition at line 183 of file NDArray.cpp.

+ Here is the caller graph for this function:

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