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
10 #include <babeltrace2/babeltrace.h>
13 using RunInCompClsQueryFunc = std::function<void(bt_self_component_class *)>;
14 using RunInCompClsInitFunc = std::function<void(bt_self_component *)>;
15 using RunInMsgIterClsInitFunc = std::function<void(bt_self_message_iterator *)>;
20 * • `compClsCtxFunc` in the context of a component class method,
23 * • `compCtxFunc` in the context of a component method, if not
26 * • `msgIterCtxFunc` in the context of a message iterator method, if
29 void runIn(RunInCompClsQueryFunc compClsCtxFunc, RunInCompClsInitFunc compCtxFunc,
30 RunInMsgIterClsInitFunc msgIterCtxFunc);
33 * Runs `func` in the context of a component class method.
35 void runInCompClsQuery(RunInCompClsQueryFunc func);
38 * Runs `func` in the context of a component method.
40 void runInCompClsInit(RunInCompClsInitFunc func);
43 * Runs `func` in the context of a message iterator method.
45 void runInMsgIterClsInit(RunInMsgIterClsInitFunc func);
47 #endif /* TESTS_LIB_UTILS_H */