Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Tuple Class Referenceabstract

#include <elm/rtti/Tuple.h>

+ Inheritance diagram for Tuple:

Public Member Functions

virtual ~Tuple ()
 
virtual const Vector< const rtti::Type * > & types () const =0
 
virtual void split (void *ptr, Vector< Variant > &values) const =0
 
virtual voidmake (const Vector< Variant > &values, int i=0) const =0
 
int count () const
 

Detailed Description

This interface provides access to member of a tuple class. A tuple class is a class of object which identity is not important. They are used as scalar values as int, float, etc. A good example of tuple class would be a class representing complex numbers.

Constructor & Destructor Documentation

◆ ~Tuple()

~Tuple ( )
virtual

Member Function Documentation

◆ count()

int count ( ) const
inline

Count the number of components in the tuple.

Returns
Number of components.

References Tuple::types().

◆ make()

void * make ( const Vector< Variant > &  values,
int  i = 0 
) const
pure virtual

Build a tuple objects from its components. The component order in values arrays must be the same as type as types returned by Tuple::types().

Parameters
valuesValues composing the tuple object.
iIndex to start reading components from.
Returns
Built tuple object.

Implemented in Tuple1< T, A >.

◆ split()

void split ( void ptr,
Vector< Variant > &  values 
) const
pure virtual

Decompose a tuple object in its component. The component order in values arrays must be the same as type as types returned by Tuple::types().

Parameters
ptrObject to decompose.
valuesResult variant vector made of components of the object.

Implemented in Tuple1< T, A >.

◆ types()

const Vector< const rtti::Type * > types ( ) const
pure virtual

Get the types of the values composing the object.

Returns
Vector of types of object components.

Implemented in AbstractTuple< T >.

Referenced by Tuple::count().


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