11 const double period = 0.1):
12 ifw::ccf::mptk::
Thread(thread_name, message_bus, period) {
21 std::map<std::string, std::string>
22 receiver_threads = {{
"ThreadA",
"ThreadB"}, {
"ThreadB",
"ThreadC"},
23 {
"ThreadC",
"ThreadD"}, {
"ThreadD",
"MainThread"}};
26 if (
MsgBus().ReceiveMessage(
GetName(), 1, timed_out, message)) {
27 std::string data = fmt::format(
"{}/{}. Data: {}",
GetName().c_str(),
28 ++m_msg_count, message.
Data().c_str());
30 receiver_threads[
GetName()], data);
Definition testManagerHelper.cpp:7
TestThread(const std::string &thread_name, ifw::ccf::mptk::MessageBus &message_bus, const double period=0.1)
Definition testManagerHelper.cpp:9
void UserLogic()
User provided business logic. The UserLogic method need not execute an internal loop....
Definition testManagerHelper.cpp:20
~TestThread()
Definition testManagerHelper.cpp:16
IFW CTD Multiprocessing Toolkit Message Bus.
Definition messageBus.hpp:91
void SendMessage(const Message &message)
Send a message on the Message Bus.
Definition messageBus.cpp:82
IFW CTD Multiprocessing Toolkit Message class.
Definition message.hpp:24
const std::string & Data() const
Return data (payload) of message.
Definition message.cpp:89
IFW CTD Multiprocessing Toolkit Thread base class.
Definition thread.hpp:30
MessageBus & MsgBus()
Get acces to the MessageBus associated with this thread object.
Definition thread.cpp:279
std::string GetName() const
Return the thread Name.
Definition thread.cpp:72
Thread(const std::string &thread_name, MessageBus &message_bus, const double period=0.1)
Constructor method, setting up the internal members.
Definition thread.cpp:41