|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
21 #ifndef ELM_RTTI_TUPLE_H_
22 #define ELM_RTTI_TUPLE_H_
24 #include <elm/rtti/type_of.h>
25 #include <elm/rtti/Class.h>
27 namespace elm {
namespace rtti {
43 void free(
void *obj)
const override {
delete static_cast<T *
>(obj); }
52 template <
class T,
class A>
59 { values.
add(
Variant((
static_cast<const T *
>(ptr)->*_acc)())); }
62 return new T(values[i].as<A>()); }
67 template <
class T,
class A>
string name(void) const
Definition: Type.h:91
virtual void split(void *ptr, Vector< Variant > &values) const =0
const AbstractClass & operator*() const
Definition: Tuple.h:74
void free(void *obj) const override
Definition: Tuple.h:43
void split(void *ptr, Vector< Variant > &values) const override
Definition: Tuple.h:58
void add(const T &v)
Definition: Vector.h:101
A(T::* acc_t)() const
Definition: Tuple.h:55
virtual ~Tuple()
Definition: rtti.cpp:814
const EOL endl
Definition: io_Output.cpp:880
AbstractTuple(cstring name)
Definition: Tuple.h:41
const AbstractClass & get() const
Definition: Tuple.h:73
void add(const rtti::Type *t)
Definition: Tuple.h:47
const Tuple * toTuple() const override
Definition: Tuple.h:44
Declare(const AbstractClass *cls)
Definition: Tuple.h:72
virtual void * make(const Vector< Variant > &values, int i=0) const =0
AbstractClass * tuple1(cstring name, A(T::*a)() const)
Definition: Tuple.h:68
const AbstractClass * operator->() const
Definition: Tuple.h:75
void * make(const Vector< Variant > &values, int i) const override
Definition: Tuple.h:60
const Vector< const rtti::Type * > & types() const override
Definition: Tuple.h:45
Tuple1(cstring name, acc_t acc)
Definition: Tuple.h:56
void * instantiate(void) const override
Definition: Tuple.h:42
virtual const Vector< const rtti::Type * > & types() const =0
int count() const
Definition: Tuple.h:35