DelegateMQ
Loading...
Searching...
No Matches
freertos/ThreadMsg.h
Go to the documentation of this file.
1#ifndef _THREAD_MSG_H
2#define _THREAD_MSG_H
3
4#include "DelegateMQ.h"
5#include <memory>
6
7// Message IDs
8#define MSG_DISPATCH_DELEGATE 1
9#define MSG_EXIT_THREAD 2
10
12{
13public:
14 // Constructor for generic messages
15 ThreadMsg(int id, std::shared_ptr<dmq::DelegateMsg> data = nullptr)
16 : m_id(id), m_data(data) {
17 }
18
19 virtual ~ThreadMsg() = default;
20
21 int GetId() const { return m_id; }
22 std::shared_ptr<dmq::DelegateMsg> GetData() const { return m_data; }
23
24private:
25 int m_id;
26 std::shared_ptr<dmq::DelegateMsg> m_data;
27
29};
30
31#endif
A single-include header for the complete DelegateMQ library functionality.
#define XALLOCATOR
Definition DelegateOpt.h:91
A class to hold a platform-specific thread messsage that will be passed through the OS message queue.
Definition freertos/ThreadMsg.h:12
ThreadMsg(int id, std::shared_ptr< dmq::DelegateMsg > data=nullptr)
Definition freertos/ThreadMsg.h:15
int GetId() const
Definition freertos/ThreadMsg.h:21
virtual ~ThreadMsg()=default
std::shared_ptr< dmq::DelegateMsg > GetData() const
Definition freertos/ThreadMsg.h:22