Sort includes in C++ files
[babeltrace.git] / tests / lib / utils / run-in.hpp
CommitLineData
484a3024
SM
1/*
2 * SPDX-License-Identifier: GPL-2.0-only
3 *
4 * Copyright (C) 2020-2023 EfficiOS, inc.
5 */
6
7#ifndef TESTS_LIB_UTILS_H
8#define TESTS_LIB_UTILS_H
9
484a3024
SM
10#include <functional>
11
c802cacb
SM
12#include <babeltrace2/babeltrace.h>
13
484a3024
SM
14using RunInCompClsQueryFunc = std::function<void(bt_self_component_class *)>;
15using RunInCompClsInitFunc = std::function<void(bt_self_component *)>;
16using RunInMsgIterClsInitFunc = std::function<void(bt_self_message_iterator *)>;
17
18/*
19 * Runs:
20 *
21 * • `compClsCtxFunc` in the context of a component class method,
22 * if not `nullptr`.
23 *
24 * • `compCtxFunc` in the context of a component method, if not
25 * `nullptr`.
26 *
27 * • `msgIterCtxFunc` in the context of a message iterator method, if
28 * not `nullptr`.
29 */
30void runIn(RunInCompClsQueryFunc compClsCtxFunc, RunInCompClsInitFunc compCtxFunc,
31 RunInMsgIterClsInitFunc msgIterCtxFunc);
32
33/*
34 * Runs `func` in the context of a component class method.
35 */
36void runInCompClsQuery(RunInCompClsQueryFunc func);
37
38/*
39 * Runs `func` in the context of a component method.
40 */
41void runInCompClsInit(RunInCompClsInitFunc func);
42
43/*
44 * Runs `func` in the context of a message iterator method.
45 */
46void runInMsgIterClsInit(RunInMsgIterClsInitFunc func);
47
48#endif /* TESTS_LIB_UTILS_H */
This page took 0.027363 seconds and 4 git commands to generate.