4 #include <ItemKeyFun.h>
7 * A tuple is an array of void*
12 * A TupleSchema record declares the ItemKeyFun functions for tuple
13 * items together with applicable arity and domain combinations.
14 * Records are created dynamically via the \ref TupleSchema_create
15 * function or the \ref TUPLESCHEMA convenience macro.
21 * These are the ItemKeyFun callback functions to support
22 * HashVector use for tuple items. The functions expects their
23 * ItemKeyFun pointer to be within a TupleSchema record so as to
24 * provide the handling of the tuple columns.
29 * This is the number of columns in a tuple.
34 * This points to an array of pointers to the tuple item domains
35 * as represented by their associated ItemKeyFun records.
41 * Create a tuples with given values.
43 * \related TupleSchema
45 extern tuple *tuple_create(int arity,...);
48 * Create a tuples with given values.
50 * \related TupleSchema
52 extern TupleSchema *TupleSchema_create(int arity,tuple *columns);
55 * Copy the given TupleSchema into a new TupleSchema with some columns
56 * masked. This represents a sub-index type using the unmasked columns
59 * \related TupleSchema
61 extern TupleSchema *TupleSchema_mask(TupleSchema *schema,...);
64 * \brief Return 1/0 to indicate whether the query matches the item.
66 * \related TupleSchema
68 extern int TupleSchema_match(TupleSchema *def,tuple *query,tuple *item);
71 * \brief Generic macro to determine the number of expressions in a
74 * \related TupleSchema
76 #define NUMARGS(...) (sizeof((void*[]){__VA_ARGS__})/sizeof(void*))
79 * \brief Create a tuple with the given values.
81 * This invokes \ref tuple_create to allocate and assign a void*
82 * array with the given values.
84 * \related TupleSchema
86 #define TUPLE(...) tuple_create( NUMARGS(__VA_ARGS__), __VA_ARGS__ )
89 * \brief Create a \ref TupleSchema with the given column "types".
91 * This invokes \ref TupleSchema_create to allocate and initialize a
92 * \ref TupleSchema for the given columns via the \ref TUPLE macro.
94 * \related TupleSchema
96 #define TUPLESCHEMA(...) \
97 TupleSchema_create( NUMARGS( __VA_ARGS__ ), TUPLE( __VA_ARGS__ ) )