2 * SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (C) 2020-2023 EfficiOS, inc.
7 #ifndef TESTS_LIB_UTILS_H
8 #define TESTS_LIB_UTILS_H
12 #include <babeltrace2/babeltrace.h>
14 using RunInCompClsQueryFunc = std::function<void(bt_self_component_class *)>;
15 using RunInCompClsInitFunc = std::function<void(bt_self_component *)>;
16 using RunInMsgIterClsInitFunc = std::function<void(bt_self_message_iterator *)>;
21 * • `compClsCtxFunc` in the context of a component class method,
24 * • `compCtxFunc` in the context of a component method, if not
27 * • `msgIterCtxFunc` in the context of a message iterator method, if
30 void runIn(RunInCompClsQueryFunc compClsCtxFunc, RunInCompClsInitFunc compCtxFunc,
31 RunInMsgIterClsInitFunc msgIterCtxFunc);
34 * Runs `func` in the context of a component class method.
36 void runInCompClsQuery(RunInCompClsQueryFunc func);
39 * Runs `func` in the context of a component method.
41 void runInCompClsInit(RunInCompClsInitFunc func);
44 * Runs `func` in the context of a message iterator method.
46 void runInMsgIterClsInit(RunInMsgIterClsInitFunc func);
48 #endif /* TESTS_LIB_UTILS_H */