Add query executor
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 14 Aug 2017 21:55:53 +0000 (17:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 17 Sep 2017 18:10:50 +0000 (14:10 -0400)
Use a new object, a query executor, to query a component class:

    struct bt_query_executor *query_exec = bt_query_executor_create();
    enum bt_query_status status = bt_query_executor_query(query_exec,
        comp_cls, "object", params, &result);

The user's query method receives this query executor as a parameter so
that some state can be shared between the user who queries (calls
bt_query_executor_query()) and the user's method. Currently, only a
cancellation flag is part of the query executor's state, so that, if you
wish to cancel a query during a signal handler, you can call
bt_query_executor_cancel(): then, when the user's method's current
system call sets the EINTR error (or the equivalent on other supported
platforms), it can check the state of the query executor with
bt_query_executor_is_canceled() to know whether to retry the system call
(debugging mode, query executor is not canceled) or to return an error
(application mode, query executor is canceled).

This is the same mechanism that is used with the graph object and
component objects: bt_graph_cancel() and bt_graph_is_canceled().

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>

No differences found
This page took 0.026486 seconds and 4 git commands to generate.