Cleanup Tuple to allow self-typing.
[rrq/rrqmisc.git] / vector / Tuple.h
1 #ifndef Tuple_H
2 #define Tuple_H
3
4 #include <ItemKeyFun.h>
5
6 typedef struct TupleSchema TupleSchema;
7
8 /**
9  * A Tuple is a "self typed" array of elements.
10  */
11 typedef struct {
12     TupleSchema *types;
13     void *elements[];
14 } Tuple;
15
16 extern ItemKeyFun *Tuple_elementType(Tuple *t,unsigned long index);
17
18 /**
19  * Create a tuples with given values.
20  *
21  * \related TupleSchema
22  */
23 extern Tuple *Tuple_create(int arity,...);
24
25 /**
26  * \brief Create a tuples as a clone of a given tuple
27  *
28  * \related TupleSchema
29  */
30 extern Tuple *Tuple_clone(int arity,Tuple *t);
31
32
33 #endif