#define BABELTRACE_GRAPH_QUERY_EXECUTOR_CONST_H
/*
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* SOFTWARE.
*/
-/* For bt_bool */
+/* For bt_bool, bt_query_executor */
#include <babeltrace/types.h>
#ifdef __cplusplus
extern "C" {
#endif
-struct bt_query_executor;
-
enum bt_query_executor_status {
BT_QUERY_EXECUTOR_STATUS_OK = 0,
BT_QUERY_EXECUTOR_STATUS_AGAIN = 11,
extern
bt_bool bt_query_executor_is_canceled(
- const struct bt_query_executor *query_executor);
+ const bt_query_executor *query_executor);
+
+extern void bt_query_executor_get_ref(
+ const bt_query_executor *query_executor);
+
+extern void bt_query_executor_put_ref(
+ const bt_query_executor *query_executor);
+
+#define BT_QUERY_EXECUTOR_PUT_REF_AND_RESET(_var) \
+ do { \
+ bt_query_executor_put_ref(_var); \
+ (_var) = NULL; \
+ } while (0)
+
+#define BT_QUERY_EXECUTOR_MOVE_REF(_var_dst, _var_src) \
+ do { \
+ bt_query_executor_put_ref(_var_dst); \
+ (_var_dst) = (_var_src); \
+ (_var_src) = NULL; \
+ } while (0)
#ifdef __cplusplus
}