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>
12 #include "cpp-common/bt2/self-component-class.hpp"
13 #include "cpp-common/bt2/self-component-port.hpp"
14 #include "cpp-common/bt2/self-message-iterator.hpp"
17 * Base class from which to inherit to call runIn().
19 * Override any of the on*() methods to get your statements executed in
25 virtual ~RunIn() = default;
28 * Called when querying the component class `self`.
30 virtual void onQuery(bt2::SelfComponentClass self);
33 * Called when initializing the component `self`.
35 virtual void onCompInit(bt2::SelfComponent self);
38 * Called when initializing the message iterator `self`.
40 virtual void onMsgIterInit(bt2::SelfMessageIterator self);
44 * Runs a simple graph (one source and one sink component), calling the
45 * `on*()` methods of `runIn` along the way.
47 void runIn(RunIn& runIn);
49 #endif /* TESTS_LIB_UTILS_H */