VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
externalCommsMessageTransporter.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2007 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: externalCommsMessageTransporter.h,v $ $Revision: 1.3 $ $State: Exp $
7 *******************************************************************************/
8 
11 
13 
14 #ifndef externalCommsMessageTransporter_h
15 #define externalCommsMessageTransporter_h
16 
18 #include <vlutil/vlMachineTypes.h>
19 #include <vlpi/entityIdentifier.h>
20 #include <vl/globalObjectDesignator.h>
21 #include <vl/dataInteraction.h>
24 #include <vl/signalInteraction.h>
27 
28 class DtExerciseConn;
29 class DtSplitMessageKey;
31 
33 {
34  DtU32 myMessageId;
35  DtEntityIdentifier mySender;
36  DtEntityIdentifier myReceiver;
38  double myDelay;
39 };
40 
42 {
43  DtU32 myMessageId;
44  DtEntityIdentifier mySender;
46 };
47 
49 {
50  DtEntityIdentifier myEntityId;
51  DtU32 myRadioIndex;
52 };
53 
55 {
56  DtU32 messageId;
58  DtGlobalObjectDesignator transmitterDesignator;
59  DtU32 radioIndex;
60  DtU32 messageSize;
61  DtEntityIdentifier receiverID;
62  float timeout;
63  double sampleRate;
64 };
65 
69 {
70 public:
71 
72  typedef struct _tSplitContentEntry{unsigned nSize; char* pBuffer;} SplitContentEntry;
73 
74  typedef std::map<DtSplitMessageKey, std::map<unsigned, SplitContentEntry> > SplitContentMap;
75 
76 private:
78 
83 
84 protected:
86  DtExternalCommsMessageTransporter(DtExerciseConn* exConn);
88  virtual bool init();
89 
90 public:
93  static DtExternalCommsMessageTransporter* create(DtExerciseConn* exConn);
94 
96 
97 public:
100  typedef std::pair<DtExternalCommsMessageParams, DtVrfObjectMessageConstPtr> DtExternalCommsMessageCallbackParams;
103 
107 
108  virtual void addProcessMessageCallback(DtProcessMessageCallbackList::DtCallbackFunctionType fcn,
109  void* usr);
110  virtual void removeProcessMessageCallback(DtProcessMessageCallbackList::DtCallbackFunctionType fcn,
111  void* usr);
113 
117 
118  virtual void addTimeoutCallback(DtTimeoutCallbackList::DtCallbackFunctionType fcn,
119  void* usr);
120  virtual void removeTimeoutCallback(DtTimeoutCallbackList::DtCallbackFunctionType fcn,
121  void* usr);
123 
127 
128  virtual void addReadyToSendCallback(DtReadyToSendCallbackList::DtCallbackFunctionType fcn,
129  void* usr);
130  virtual void removeReadyToSendCallback(DtReadyToSendCallbackList::DtCallbackFunctionType fcn,
131  void* usr);
133 
135 
136  virtual void addNewMessageCallback(DtNewMessageCallbackList::DtCallbackFunctionType fcn,
137  void* usr);
138  virtual void removeNewMessageCallback(DtNewMessageCallbackList::DtCallbackFunctionType fcn,
139  void* usr);
141 
143  virtual void clearSplitContent();
144 
147  bool enabled() const;
148  virtual void setEnabled(bool bEnabled);
151  virtual bool processSplitContent(const DtExternalCommsMessageParams& params,
152  const DtSignalMessageHeader& msgHdr,
153  const char *pContent);
154 
156  virtual void processSplitContentTimeout(const DtSplitMessageKey& key);
157 
159  virtual bool processVrfObjectMessageReceived(const DtExternalCommsMessageParams& params,
160  const char *pVrfObjectMessageBuffer);
161 
163  virtual bool reassembleVrfObjectMessage(const DtExternalCommsMessageParams& params,
164  const DtSignalMessageHeader& msgHdr);
165 
167  virtual void removeSplitContent(const DtSplitMessageKey& key);
168 
170  virtual void sendInteraction(const DtExternalCommsMessageParams& params,
171  const DtSignalMessageHeader& msgHdr,
172  const char* pContent);
173 
176  virtual void sendMessage(const DtExternalCommsMessageParams& params, DtVrfObjectMessage* message);
177 
178  static void splitContentTimeoutCbk(const DtSplitMessageKey& key, void *pUsr);
179 
180 protected:
181 
182  virtual DtString entityIdToString(const DtEntityIdentifier& id) const;
183 
184  static void dataInteractionCallback(DtDataInteraction* interaction, void* usr);
185 
188  virtual void processDataInteraction(DtDataInteraction* interaction);
189 
190  virtual void processExternalCommsProcessMessage(DtDataInteraction* processMessageInteraction);
191 
192  virtual void processExternalCommsTimout(DtDataInteraction* timeoutInteraction);
193 
194  virtual void processExternalCommsReadyToSend(DtDataInteraction* readyToSendInteraction);
195 
196  static void signalInteractionCallback(DtSignalInteraction* inter, void* usr);
197  virtual void processSignalInteraction(DtSignalInteraction* inter);
198 
200  virtual void sendSignalInteraction(DtSignalInteraction& signalInteraction);
201 
202 public:
203 
204 protected:
205  bool myEnabled;
206  DtExerciseConn* myExConn;
213 };
214 
216 {
217  return myEnabled;
218 }
219 #endif

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)