My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
ControlMsg.h
1 #ifndef GCP_GRABBER_CONTROLMSG_H
2 #define GCP_GRABBER_CONTROLMSG_H
3 
11 #include "gcp/util/common/GenericTaskMsg.h"
12 #include "gcp/util/common/NetMsg.h"
13 
14 namespace gcp {
15  namespace grabber {
16 
17  class ControlMsg :
19 
20  public:
21 
25  enum MsgType {
26 
27  // Messages for this task
28 
29  CONNECT, // A message to connect to the control port.
30  NETMSG, // A network message to be sent back to the
31  // control program
32  };
33 
37  MsgType type;
38 
42  union {
43  gcp::util::NetMsg networkMsg;
44  } body;
45 
50  {
52  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
53 
54  type = NETMSG;
55 
56  return &body.networkMsg;
57  }
58 
59  //------------------------------------------------------------
60  // Methods for packing messages intended for the
61  // Control task
62  //------------------------------------------------------------
63 
67  inline void packConnectMsg() {
68 
70  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
71 
72  type = CONNECT;
73  }
74 
75  }; // End class ControlMsg
76 
77  }; // End namespace grabber
78 }; // End namespace gcp
79 
80 
81 #endif // End #ifndef GCP_GRABBER_CONTROL_H
Definition: GenericTaskMsg.h:31
void packConnectMsg()
Definition: ControlMsg.h:67
gcp::util::NetMsg * getNetMsg()
Definition: ControlMsg.h:49
union gcp::grabber::ControlMsg::@169 body
MsgType
Definition: ControlMsg.h:25
GenericMsgType genericMsgType_
Definition: GenericTaskMsg.h:50
Definition: NetMsg.h:26
MsgType type
Definition: ControlMsg.h:37