My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
ReceiverControlMsg.h
Go to the documentation of this file.
1 #ifndef GCP_MEDIATOR_RECEIVERCONTROLMSG_H
2 #define GCP_MEDIATOR_RECEIVERCONTROLMSG_H
3 
11 #include "gcp/util/common/GenericTaskMsg.h"
12 
13 // Do not reshuffle these. GCC3.2.2 is easily confused
14 
15 #include "gcp/control/code/unix/libunix_src/specific/rtcnetcoms.h"
16 #include "gcp/control/code/unix/libunix_src/common/tcpip.h"
17 
18 namespace gcp {
19  namespace mediator {
20 
23  public:
24 
28  enum MsgType {
29 
30  // A script command to be issued
31 
32  COMMAND,
33 
34  // The directory in which to output files
35 
36  DIRECTORY
37  };
38 
43 
47  union {
48 
49 
50  // A command to execute
51 
52  struct {
53 
54  // The script to execute
55 
56  char script[gcp::control::NET_LOG_MAX+1];
57 
58  // A sequence number associated with this script
59 
60  unsigned seq;
61 
62  } command;
63 
64  // A directory specification
65 
66  struct {
67 
68  // The script to execute
69 
70  char dir[gcp::control::NET_LOG_MAX+1];
71 
72  } directory;
73 
74  } body;
75 
76  //------------------------------------------------------------
77  // Methods for packing messages to the ReceiverControl
78  // task
79  //------------------------------------------------------------
80 
84  inline void packCommandMsg(char* script, unsigned seq) {
85 
87  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
88 
89  type = COMMAND;
90 
91  strcpy(body.command.script, script);
92 
93  body.command.seq = seq;
94  }
95 
99  inline void packDirectoryMsg(char* dir) {
100 
101  genericMsgType_ =
102  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
103 
104  type = DIRECTORY;
105 
106  strcpy(body.directory.dir, dir);
107  }
108 
109  }; // End class ReceiverControlMsg
110 
111  } // End namespace mediator
112 } // End namespace gcp
113 
114 
115 
116 #endif // End #ifndef GCP_MEDIATOR_RECEIVERCONTROLMSG_H
Definition: GenericTaskMsg.h:31
void packDirectoryMsg(char *dir)
Definition: ReceiverControlMsg.h:99
union gcp::mediator::ReceiverControlMsg::@198 body
GenericMsgType genericMsgType_
Definition: GenericTaskMsg.h:50
MsgType type
Definition: ReceiverControlMsg.h:42
void packCommandMsg(char *script, unsigned seq)
Definition: ReceiverControlMsg.h:84
MsgType
Definition: ReceiverControlMsg.h:28
Definition: ReceiverControlMsg.h:21