7 * A TupleSchema record declares the ItemKeyFun functions for tuple
8 * items together with applicable arity and domain combinations.
9 * Records are created dynamically via the \ref TupleSchema_create
10 * function or the \ref TUPLESCHEMA convenience macro.
14 typedef struct TupleSchema {
16 * These are the ItemKeyFun callback functions to support
17 * HashVector use for tuple items. The functions expects their
18 * ItemKeyFun pointer to be within a TupleSchema record so as to
19 * provide the handling of the tuple columns.
24 * This is the number of columns in a tuple.
29 * This points to tuple whose elements is array of pointers to the
30 * tuple item domains as represented by their associated
37 * Create a tuples with given values.
39 * \related TupleSchema
41 extern TupleSchema *TupleSchema_create(int arity,Tuple *columns);
44 * Copy the given TupleSchema into a new TupleSchema with some columns
45 * masked. This represents a sub-index type using the unmasked columns
48 * \related TupleSchema
50 extern TupleSchema *TupleSchema_mask(TupleSchema *schema,...);
53 * \brief Return 1/0 to indicate whether the Query matches the item.
55 * \related TupleSchema
57 extern int TupleSchema_match(TupleSchema *def,Tuple *query,Tuple *item);
60 * \brief Generic macro to determine the number of expressions in a
63 * \related TupleSchema
65 #define NUMARGS(...) (sizeof((void*[]){__VA_ARGS__})/sizeof(void*))
68 * \brief Create a tuple with the given values.
70 * This invokes \ref tuple_create to allocate and assign a void*
71 * array with the given values.
73 * \related TupleSchema
75 #define TUPLE(...) Tuple_create( NUMARGS(__VA_ARGS__), __VA_ARGS__ )
78 * \brief Create a \ref TupleSchema with the given column "types".
80 * This invokes \ref TupleSchema_create to allocate and initialize a
81 * \ref TupleSchema for the given columns via the \ref TUPLE macro.
83 * \related TupleSchema
85 #define TUPLESCHEMA(...) \
86 TupleSchema_create( NUMARGS( __VA_ARGS__ ), TUPLE( __VA_ARGS__ ) )