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 points to tuple whose elements is array of pointers to the
25 * tuple item domains as represented by their associated
32 * Create a tuples with given values.
34 * \related TupleSchema
36 extern TupleSchema *TupleSchema_create(Tuple *columns);
39 * Copy the given TupleSchema into a new TupleSchema with some columns
40 * masked. This represents a sub-index type using the unmasked columns
43 * \related TupleSchema
45 extern TupleSchema *TupleSchema_mask(TupleSchema *schema,...);
48 * \brief Return 1/0 to indicate whether the Query matches the item.
50 * \related TupleSchema
52 extern int TupleSchema_match(TupleSchema *def,Tuple *query,Tuple *item);
55 * \brief Generic macro to determine the number of expressions in a
58 * \related TupleSchema
60 #define NUMARGS(...) (sizeof((void*[]){__VA_ARGS__})/sizeof(void*))
63 * \brief Create a tuple with the given values.
65 * This invokes \ref tuple_create to allocate and assign a void*
66 * array with the given values.
68 * \related TupleSchema
70 #define TUPLE(...) Tuple_create( NUMARGS(__VA_ARGS__), __VA_ARGS__ )
73 * \brief Create a \ref TupleSchema with the given column "types".
75 * This invokes \ref TupleSchema_create to allocate and initialize a
76 * \ref TupleSchema for the given columns via the \ref TUPLE macro.
78 * \related TupleSchema
80 #define TUPLESCHEMA(...) \
81 TupleSchema_create( TUPLE( __VA_ARGS__ ) )