CARMA C++
RtdClientTask.h
Go to the documentation of this file.
1 // $Id: RtdClientTask.h,v 1.1 2013/07/10 15:35:15 eml Exp $
2 
3 #ifndef SZA_UTIL_RTDCLIENTTASK_H
4 #define SZA_UTIL_RTDCLIENTTASK_H
5 
18 
19 namespace sza {
20  namespace util {
21 
22  //------------------------------------------------------------
23  // A message class for use with this task
24  //------------------------------------------------------------
25 
26  class RtdClientMsg : public GenericTaskMsg {
27  public:
28 
29  enum MsgType {
30  ADD_REG = 0x1,
31  REM_REG = 0x2,
32  };
33 
34  union {
35  unsigned regId_;
36  } body;
37 
38  // A type for this message
39 
40  MsgType type;
41  };
42 
43  //------------------------------------------------------------
44  // Test class for communicating with RtdServer
45  //------------------------------------------------------------
46 
47  class RtdClientTask : public ClientTask<RtdClientMsg> {
48  public:
49 
53  RtdClientTask(bool spawn, std::string host, unsigned connectPort);
54 
58  virtual ~RtdClientTask();
59 
60  virtual void processServerData();
61  virtual void processMsg(RtdClientMsg* msg);
62 
63  void sendAddRegMsg(unsigned id);
64  void sendRemRegMsg(unsigned id);
65 
66  private:
67 
68  RtdClientData data_;
69 
70  }; // End class RtdClientTask
71 
72  } // End namespace util
73 } // End namespace sza
74 
75 
76 
77 #endif // End #ifndef SZA_UTIL_RTDCLIENTTASK_H
virtual void processMsg(Msg *msg)
This method should be defined by each inheriting task to process its own task-specific messages...
Definition: SpawnableTask.h:57
Tagged: Wed 01-Feb-06 10:43:27.
Tagged: Thu Mar 7 15:26:50 PST 2013.
Tagged: Fri Nov 14 12:39:34 UTC 2003.