tests: normalize inclusions of tap/tap.h
[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
10#include <babeltrace2/babeltrace.h>
11#include <functional>
12
13using RunInCompClsQueryFunc = std::function<void(bt_self_component_class *)>;
14using RunInCompClsInitFunc = std::function<void(bt_self_component *)>;
15using RunInMsgIterClsInitFunc = std::function<void(bt_self_message_iterator *)>;
16
17/*
18 * Runs:
19 *
20 * • `compClsCtxFunc` in the context of a component class method,
21 * if not `nullptr`.
22 *
23 * • `compCtxFunc` in the context of a component method, if not
24 * `nullptr`.
25 *
26 * • `msgIterCtxFunc` in the context of a message iterator method, if
27 * not `nullptr`.
28 */
29void runIn(RunInCompClsQueryFunc compClsCtxFunc, RunInCompClsInitFunc compCtxFunc,
30 RunInMsgIterClsInitFunc msgIterCtxFunc);
31
32/*
33 * Runs `func` in the context of a component class method.
34 */
35void runInCompClsQuery(RunInCompClsQueryFunc func);
36
37/*
38 * Runs `func` in the context of a component method.
39 */
40void runInCompClsInit(RunInCompClsInitFunc func);
41
42/*
43 * Runs `func` in the context of a message iterator method.
44 */
45void runInMsgIterClsInit(RunInMsgIterClsInitFunc func);
46
47#endif /* TESTS_LIB_UTILS_H */
This page took 0.026882 seconds and 4 git commands to generate.