-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathThreadMsg.h
More file actions
28 lines (21 loc) · 698 Bytes
/
Copy pathThreadMsg.h
File metadata and controls
28 lines (21 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _THREAD_MSG_H
#define _THREAD_MSG_H
#include <memory>
struct UserData;
/// @brief Message priority levels for the worker thread queue.
enum class Priority { LOW = 0, NORMAL = 1, HIGH = 2 };
/// @brief A thread message container with priority support.
class ThreadMsg
{
public:
ThreadMsg(int id, std::shared_ptr<UserData> data, Priority priority = Priority::NORMAL)
: m_id(id), m_data(data), m_priority(priority) {}
int GetId() const { return m_id; }
std::shared_ptr<UserData> GetData() const { return m_data; }
Priority GetPriority() const { return m_priority; }
private:
int m_id;
std::shared_ptr<UserData> m_data;
Priority m_priority;
};
#endif