CARMA C++
GenericTaskMsg.h
Go to the documentation of this file.
1 #ifndef GENERICTASKMSG_H
2 #define GENERICTASKMSG_H
3 
11 #define SIGNALTASK_HANDLER_FN(fn) void (fn)(int sigNo, void* args)
12 #define SIGNAL_NAME_LEN 10
13 
14 namespace sza {
15  namespace util {
16 
32 
33  public:
34 
39  HEARTBEAT, // A request to respond to the heartbeat
40  STOP, // A message to shutdown
41  RESTART, // A message to restart threads managed by this
42  // task.
43  TASK_SPECIFIC, // A task-specific message
44  LAST // This should always come last!
45  };
46 
51 
52  //------------------------------------------------------------
53  // If running under the CARMA control system, this sequence
54  // number will be used to store sequence numbers received from
55  // the CARMA control system
56 
57  enum CarmaSeqNoType {
58  NONE,
59  DRIVE,
60  RX,
61  CAL,
62  OPTICS,
63  OPTICALTEL
64  };
65 
66  unsigned long carmaSeqNo_;
67  CarmaSeqNoType carmaSeqNoType_;
68 
69  void setCarmaSequenceNumber(unsigned long seq=0, CarmaSeqNoType type=NONE) {
70  carmaSeqNo_ = seq;
71  carmaSeqNoType_ = type;
72  }
73 
74  void setCarmaCalSequenceNumber(unsigned long seq) {
75  setCarmaSequenceNumber(seq, CAL);
76  }
77 
78  void setCarmaDriveSequenceNumber(unsigned long seq) {
79  setCarmaSequenceNumber(seq, DRIVE);
80  }
81 
82  void setCarmaOpticsSequenceNumber(unsigned long seq) {
83  setCarmaSequenceNumber(seq, OPTICS);
84  }
85 
86  void setCarmaRxSequenceNumber(unsigned long seq) {
87  setCarmaSequenceNumber(seq, RX);
88  }
89 
90  }; // End class GenericTaskMsg
91 
92  }; // End namespace util
93 }; // End namespace sza
94 
95 #endif // End #ifndef
GenericMsgType
Enumerate supported generic message types.
GenericMsgType genericMsgType_
A type for this message.
A class to encapsulate message types for a generic task.