Babeltrace 2 C API  2.0.3
Open-source trace manipulation framework
query-executor.h
1 #ifndef BABELTRACE2_GRAPH_QUERY_EXECUTOR_H
2 #define BABELTRACE2_GRAPH_QUERY_EXECUTOR_H
3 
4 /*
5  * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  */
25 
26 #ifndef __BT_IN_BABELTRACE_H
27 # error "Please include <babeltrace2/babeltrace.h> instead."
28 #endif
29 
30 #include <babeltrace2/types.h>
31 #include <babeltrace2/logging.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
159 extern
161  const bt_component_class *component_class,
162  const char *object_name, const bt_value *params);
163 
211 extern
213  const bt_component_class *component_class,
214  const char *object_name, const bt_value *params,
215  void *method_data);
216 
233  BT_QUERY_EXECUTOR_QUERY_STATUS_OK = __BT_FUNC_STATUS_OK,
234 
239  BT_QUERY_EXECUTOR_QUERY_STATUS_UNKNOWN_OBJECT = __BT_FUNC_STATUS_UNKNOWN_OBJECT,
240 
245  BT_QUERY_EXECUTOR_QUERY_STATUS_AGAIN = __BT_FUNC_STATUS_AGAIN,
246 
251  BT_QUERY_EXECUTOR_QUERY_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
252 
257  BT_QUERY_EXECUTOR_QUERY_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
259 
302 extern
304  bt_query_executor *query_executor, const bt_value **result);
305 
324 
348  bt_logging_level logging_level);
349 
369  const bt_query_executor *query_executor);
370 
388 
395 
437  const bt_interrupter *interrupter);
438 
462  bt_query_executor *query_executor);
463 
480  const bt_query_executor *query_executor);
481 
504 extern void bt_query_executor_get_ref(const bt_query_executor *query_executor);
505 
521 extern void bt_query_executor_put_ref(const bt_query_executor *query_executor);
522 
537 #define BT_QUERY_EXECUTOR_PUT_REF_AND_RESET(_query_executor) \
538  do { \
539  bt_query_executor_put_ref(_query_executor); \
540  (_query_executor) = NULL; \
541  } while (0)
542 
568 #define BT_QUERY_EXECUTOR_MOVE_REF(_dst, _src) \
569  do { \
570  bt_query_executor_put_ref(_dst); \
571  (_dst) = (_src); \
572  (_src) = NULL; \
573  } while (0)
574 
579 #ifdef __cplusplus
580 }
581 #endif
582 
583 #endif /* BABELTRACE2_GRAPH_QUERY_EXECUTOR_H */
bt_query_executor_query_status bt_query_executor_query(bt_query_executor *query_executor, const bt_value **result)
Performs a query operation using the query executor query_executor, setting *result to the operation'...
Success.
Definition: query-executor.h:387
void bt_query_executor_get_ref(const bt_query_executor *query_executor)
Increments the reference count of the query executor query_executor.
bt_query_executor_query_status
Status codes for bt_query_executor_query().
Definition: query-executor.h:228
struct bt_query_executor bt_query_executor
Query executor.
Definition: types.h:84
Success.
Definition: query-executor.h:233
Try again.
Definition: query-executor.h:245
bt_query_executor_set_logging_level_status
Status codes for bt_query_executor_set_logging_level().
Definition: query-executor.h:317
struct bt_component_class bt_component_class
Component class.
Definition: types.h:39
bt_query_executor_add_interrupter_status
Status codes for bt_query_executor_add_interrupter().
Definition: query-executor.h:382
bt_query_executor * bt_query_executor_create(const bt_component_class *component_class, const char *object_name, const bt_value *params)
Alias of bt_query_executor_create_with_method_data() with the method_data parameter set to NULL...
bt_logging_level bt_query_executor_get_logging_level(const bt_query_executor *query_executor)
Returns the logging level of the query executor query_executor.
Out of memory.
Definition: query-executor.h:393
bt_query_executor_add_interrupter_status bt_query_executor_add_interrupter(bt_query_executor *query_executor, const bt_interrupter *interrupter)
Adds the interrupter interrupter to the query executor query_executor.
struct bt_interrupter bt_interrupter
Interrupter.
Definition: types.h:70
Out of memory.
Definition: query-executor.h:251
Unknown object to query.
Definition: query-executor.h:239
struct bt_value bt_value
Value.
Definition: types.h:107
bt_logging_level
Logging level enumerators.
Definition: logging.h:110
int bt_bool
Babeltrace 2 boolean type.
Definition: types.h:140
bt_interrupter * bt_query_executor_borrow_default_interrupter(bt_query_executor *query_executor)
Borrows the default interrupter from the query executor query_executor.
Success.
Definition: query-executor.h:322
bt_query_executor * bt_query_executor_create_with_method_data(const bt_component_class *component_class, const char *object_name, const bt_value *params, void *method_data)
Creates a query executor to query the object named object_name from the component class component_cla...
bt_query_executor_set_logging_level_status bt_query_executor_set_logging_level(bt_query_executor *query_executor, bt_logging_level logging_level)
Sets the logging level of the query executor query_executor to logging_level.
bt_bool bt_query_executor_is_interrupted(const bt_query_executor *query_executor)
Returns whether or not the query executor query_executor is interrupted, that is, whether or not any ...
void bt_query_executor_put_ref(const bt_query_executor *query_executor)
Decrements the reference count of the query executor query_executor.
Other error.
Definition: query-executor.h:257