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
29
30
31
| #ifndef COMMAND_H
| #define COMMAND_H
|
| #include <msgpack.h>
| #include <string>
| #include <unordered_map>
|
| // Define the command types as an enum
| enum class CommandType {
| PluginRegistered = 1000,
| PluginList = 1001
| };
|
| // Map the CommandType enum to its string representation
| static const std::unordered_map<CommandType, std::string> CommandTypeToString = {
| {CommandType::PluginRegistered, "PluginRegistered"},
| {CommandType::PluginList, "PluginList"}
| };
|
| MSGPACK_ADD_ENUM(CommandType::PluginList)
|
| MSGPACK_ADD_ENUM(CommandType::PluginRegistered)
|
| struct Command {
| CommandType commandType;
| std::string payload;
|
| MSGPACK_DEFINE(commandType, payload);
| };
|
| #endif // COMMAND_H
|
|