1 #ifndef QueryCallbacks_H
2 #define QueryCallbacks_H
6 * This state tells the "next" function that it should capture the
7 * incoming BindingTable state and provide the initial Binding of
8 * a new sucession of bindings.
12 * This state tells the "next" function that it should update the
13 * bidning table with a subsequent Binding in the current
14 * succession of bindings.
18 * This state tells the "next" function that it should just
19 * restore the Binding table to its incoming state.
25 * A struct Query_callbacks record defines the callbacks for a
26 * specific Query type.
28 struct QueryCallbacks {
30 * \brief Callback function to reclaim the Query memory for a
33 * \param this is the specific \ref Query concerned.
35 * Ground queries recalim their own state memory. Composite
36 * queries first propagate the reclaim call to its components, and
37 * thereafter reclaim their local state memory.
39 void (*reclaim)(Query *this);
41 * \brief Callback function to update the Binding table with a
42 * succession of alternative bindings.
44 * \param this is the specific \ref Query concerned.
46 * \param bt is the Binding table to set bindings in.
48 * \param s is the call "sub-command" for the function.
50 * \returns 1 if a new Binding is provided and 0 otherwise.
52 * This function is called repeatedly for successively obtaining
53 * the alternative bindings that satisfy the Query. The "initial"
54 * state sub-command tells the function to capture the incoming
55 * BindingTable state so that the function can later restore it
56 * upon the "restore" sub-command. Upon the "initial" command, the
57 * function also sets up the Binding table with its first Binding
58 * alternative. This is followed by a series of "subsequent"
59 * sub-command calls for the function to change the BindingTable
60 * for its succession of Binding alternatives. The function should
61 * return 1 after any successful Binding setup, and return 0 when
62 * it cannot setup any (more) Binding.
64 int (*next)(Query *this,BindingTable *bt,enum NextState state);
66 * This callback function adds its binding names to the
69 void (*bindings)(Query *this,HashVector *hv);