DDS  ver. 3.4
ProtocolCommands.h
Go to the documentation of this file.
1 // Copyright 2014 GSI, Inc. All rights reserved.
2 //
3 //
4 //
5 #ifndef PROTOCOLCOMMANDS_H_
6 #define PROTOCOLCOMMANDS_H_
7 // MiscCommon
8 #include "def.h"
9 
10 #define NAME_TO_STRING(NAME) #NAME
11 
12 // define current protocol version version
13 //
14 // We wanted to track protocol changes by versions, but at the moment it is a kinda overkill.
15 // At the moment it doesn't matter which versions peers have, once the version is different, we break the connection.
16 // In the future we might want to support backward compatibility. In this case protocol version, command will be
17 // organized in separate structures and enums.
18 //
19 const uint16_t g_protocolCommandsVersion = 5;
20 
21 namespace dds
22 {
23  namespace protocol_api
24  {
25  enum ECmdType
26  {
27 
29  cmdRAW_MSG = 2, // special case - raw message processing
31  cmdHANDSHAKE, // attachment: SVersionCmd
32  cmdSUBMIT, // attachment: SSubmitCmd
33  cmdSIMPLE_MSG, // attachment: SSimpleMsgCmd
35  cmdREPLY_HANDSHAKE_ERR, // attachment: SSimpleMsgCmd
37  cmdREPLY_HOST_INFO, // attachment: SHostInfoCmd
39  cmdREPLY_PID, // attachment: SSimpleMsgCmd. The message contains the pid of the responder.
40  cmdBINARY_ATTACHMENT, // attachment: SBinanryAttachmentCmd. The message contains binary attachment.
41  cmdBINARY_ATTACHMENT_RECEIVED, // attachment: SBinaryAttachmentReceivedCmd.
42  cmdBINARY_ATTACHMENT_START, // attachment: SBinaryAttachmentStartCmd.
44  cmdREPLY_ID, // attachment: SUUIDCmd
45  cmdSET_ID, // attachment: SUUIDCmd
48  cmdREPLY_AGENTS_INFO, // attachment: SAgentsInfoCmd
49  cmdASSIGN_USER_TASK, // attachment: SAssignUserTaskCmd
50  // this command activates a given agent and triggers a start of an assigned user task
51  cmdACTIVATE_USER_TASK, // attachment: SIDCmd
53  cmdUSER_TASK_DONE, // attachment: SUserTaskDoneCmd
55  cmdUPDATE_KEY, // attachment: SUpdateKeyCmd
58  cmdPROGRESS, // attachment: SProgressCmd
60  cmdSET_TOPOLOGY, // attachment: SSetTopologyCmd
61  cmdUPDATE_TOPOLOGY, // attachment: SUpdateTopologyCmd
65  cmdCUSTOM_CMD, // attachment: SCustomCmdCmd
66  cmdLOBBY_MEMBER_INFO, // attachment: SSimpleMsgCmd
67  cmdLOBBY_MEMBER_HANDSHAKE, // attachment: SVersionCmd
68  cmdREPLY, // attachment: SReplyCmd
70  cmdREPLY_IDLE_AGENTS_COUNT, // attachment: SSimpleMsgCmd
71  cmdADD_SLOT, // attachment: SIDCmd
72  cmdREPLY_ADD_SLOT // attachment: SUUIDCmd
73  };
74 
75  static std::map<uint16_t, std::string> g_cmdToString{
116  { cmdGET_IDLE_AGENTS_COUNT, NAME_TO_STRING(cmdGET_IDLE_AGENT_COUNT) },
117  { cmdREPLY_IDLE_AGENTS_COUNT, NAME_TO_STRING(cmdREPLY_IDLE_AGENT_COUNT) },
120  };
121  } // namespace protocol_api
122 } // namespace dds
123 
124 #endif /* PROTOCOLMESSAGES_H_ */
Definition: ProtocolCommands.h:69
Definition: ProtocolCommands.h:67
Definition: ProtocolCommands.h:54
Definition: ProtocolCommands.h:49
Definition: ProtocolCommands.h:61
Definition: ProtocolCommands.h:45
Definition: ProtocolCommands.h:34
Definition: ProtocolCommands.h:71
Definition: ProtocolCommands.h:68
Definition: ProtocolCommands.h:48
Definition: ProtocolCommands.h:47
Definition: ProtocolCommands.h:38
Definition: ProtocolCommands.h:60
Definition: ProtocolCommands.h:66
Definition: ProtocolCommands.h:30
Definition: ProtocolCommands.h:29
#define NAME_TO_STRING(NAME)
Definition: ProtocolCommands.h:10
Definition: ProtocolCommands.h:59
Definition: ProtocolCommands.h:62
Definition: ProtocolCommands.h:35
Definition: ProtocolCommands.h:58
Definition: ProtocolCommands.h:43
Definition: ProtocolCommands.h:33
Definition: ProtocolCommands.h:42
const uint16_t g_protocolCommandsVersion
Definition: ProtocolCommands.h:19
Definition: ProtocolCommands.h:32
Definition: ProtocolCommands.h:70
Definition: ProtocolCommands.h:36
Definition: AgentConnectionManager.h:13
Definition: ProtocolCommands.h:65
Definition: ProtocolCommands.h:55
Definition: ProtocolCommands.h:56
Definition: ProtocolCommands.h:52
Definition: ProtocolCommands.h:63
Definition: ProtocolCommands.h:51
Definition: ProtocolCommands.h:64
Definition: ProtocolCommands.h:44
Definition: ProtocolCommands.h:37
Definition: ProtocolCommands.h:46
Definition: ProtocolCommands.h:39
Definition: ProtocolCommands.h:72
Definition: ProtocolCommands.h:41
Definition: ProtocolCommands.h:53
Definition: ProtocolCommands.h:40
Definition: ProtocolCommands.h:31
Definition: ProtocolCommands.h:57
ECmdType
Definition: ProtocolCommands.h:25
Definition: ProtocolCommands.h:28