MAK Data Logger API Documentation for HLA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
remoteControlInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2026 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 
11 #pragma once
12 
14 
16 
17 #include <vlutil/vlString.h>
18 #include <vlpi/entityIdentifier.h>
19 #include <vlutil/vlInetSocket.h>
20 
21 #include <list>
22 #include <map>
23 #include <set>
24 
25 class DtExerciseConn;
26 class DtInteraction;
27 class DtLgrControlPdu;
28 class DtEntityIdentifier;
30 class DtLgrConnectPdu;
31 class DtLgrDisconnectPdu;
33 class DtLgrResponsePdu;
34 class DtLgrTotalStatePdu;
35 class DtInetSocket;
36 
37 namespace MAKLogger
38 {
39  class DtAbsoluteTime;
40  class DtRelativeTime;
41  class DtCommand;
42  class DtRemoteControlDomainInterface;
43  class DtRemoteControlSystemInterface;
44  class DtRemoteControlPlaybackInterface;
45  class DtRemoteControlRecordInterface;
46  class DtRemoteControlEditorInterface;
47  class DtRemoteControlSimulationInterface;
49 
50  typedef DtU32 DtSequenceNumber;
51  typedef std::set<DtSequenceNumber> DtSequenceNumberSet;
52  typedef std::set<DtEntityIdentifier> DtEntityIdSet;
53 
54  typedef void (*DtLgrConnectCb)( DtLgrConnectPdu* connect, void* usr );
55  typedef void (*DtLgrDisconnectCb)( DtLgrDisconnectPdu* connect, void* usr );
56  typedef void (*DtLgrLgrHeartbeatCb)( DtLgrLgrHeartbeatPdu* connect, void* usr );
57  typedef void (*DtLgrAcknowledgeCb)( DtLgrAcknowledgePdu* connect, void* usr );
58  typedef void (*DtLgrResponseCb)( DtLgrResponsePdu* connect, void* usr );
59  typedef void (*DtLgrTotalStateCb)( DtLgrTotalStatePdu* connect, void* usr );
60  typedef void (*DtLgrConnectionAddedCb)( const DtRemoteLoggerConnection& loggerConnection, void* usr );
61  typedef void (*DtLgrConnectionRemovedCb)( const DtRemoteLoggerConnection& loggerConnection, void* usr );
62  typedef void (*DtLgrConnectionTimedOutCb)( const DtRemoteLoggerConnection& loggerConnection, void* usr );
63 
64  typedef void (*DtLgrCommandAcceptedCb)( DtSequenceNumber sequenceNumber, void* usr );
65  typedef void (*DtLgrCommandRejectedCb)(const DtEntityIdentifier& source, DtSequenceNumber sequenceNumber, void* usr );
66  typedef void (*DtLgrCommandTimedOutCb)( DtSequenceNumber sequenceNumber, void* usr );
67 
68 
74  {
75  public:
79  DtRemoteControlInterface(int numberOfLoggersToManage=0);
80 
82  virtual ~DtRemoteControlInterface();
83 
84  private:
89 
90  public:
91 
93  virtual void setConnection(DtExerciseConn* exconn, const DtEntityIdentifier& entityId);
94 
96  virtual void setConnection(const DtEntityIdentifier& id, DtInetSocket* socket);
97 
100  virtual void clearConnection();
101 
103  virtual void disconnect(const DtEntityIdentifier& entityId);
104 
106  virtual void tick();
107 
109  virtual void setId( const DtEntityIdentifier& id );
111  virtual const DtEntityIdentifier& id() const;
113 
115  virtual void setAcceptAnyId( bool acceptAny);
117  virtual bool acceptAnyId() const;
119 
121  virtual DtTime connectionTimeout() const;
123  virtual void setConnectionTimeout(DtTime val);
125 
127  virtual DtTime acknowledgeTimeout() const;
129  virtual void setAcknowledgeTimeout(DtTime val);
131 
133  virtual int backChannelTickBudget() const;
136  virtual void setBackChannelTickBudget(int val);
138 
140  virtual void setNumberOfLoggers(int numberOfLoggersToManage);
142  virtual int numberOfLoggers() const;
144 
146  virtual void setPassivelyAccepting(bool enablePassivelyAccept);
148  virtual bool isPassivelyAccepting() const;
150 
152  virtual void getConnectionIds(DtEntityIdSet& connectedLoggers) const;
153 
155  virtual void getConnectionIds(DtEntityIdSet& connectedLoggers,
156  const DtEntityIdentifier& idFilter) const;
157 
159  virtual int numberConnections() const;
160 
162  virtual DtRemoteLoggerConnection* getConnection(const DtEntityIdentifier& id);
163 
165  virtual DtTime lowestTime() const;
166 
168  virtual DtTime highestTime() const;
169 
171 
172  virtual DtRemoteControlSystemInterface* systemInterface();
173  virtual DtRemoteControlPlaybackInterface* playbackInterface();
174  virtual DtRemoteControlRecordInterface* recordInterface();
175  virtual DtRemoteControlEditorInterface* editorInterface();
176  virtual DtRemoteControlSimulationInterface* simulationInterface();
177  virtual DtRemoteControlSharedInterface* sharedInterface();
179 
184  virtual DtSequenceNumber sendCommandMessage(const DtCommand& command,
185  const DtEntityIdentifier& target=theWildcardAddress);
186 
192  virtual DtSequenceNumber sendCommandMessage(const DtCommand& command,
193  DtRemoteControlDomainInterface* domainInterface,
194  const DtEntityIdentifier& target=theWildcardAddress);
195 
200  virtual DtSequenceNumber sendLoggerControlMessage(DtLgrControlPdu& lgrControl,
201  const DtEntityIdentifier& target=theWildcardAddress);
202 
208  virtual DtSequenceNumber sendLoggerControlMessage(DtLgrControlPdu& lgrControl,
209  DtRemoteControlDomainInterface* domainInterface,
210  const DtEntityIdentifier& target=theWildcardAddress);
211 
213 
214  virtual void addCallback( DtLgrConnectCb cb, void* user );
215  virtual void removeCallback( DtLgrConnectCb );
216 
217  virtual void addCallback( DtLgrDisconnectCb cb, void* user );
218  virtual void removeCallback( DtLgrDisconnectCb );
219 
220  virtual void addCallback( DtLgrLgrHeartbeatCb cb, void* user );
221  virtual void removeCallback( DtLgrLgrHeartbeatCb );
222 
223  virtual void addCallback( DtLgrAcknowledgeCb cb, void* user );
224  virtual void removeCallback( DtLgrAcknowledgeCb );
225 
226  virtual void addCallback( DtLgrResponseCb cb, void* user );
227  virtual void removeCallback( DtLgrResponseCb );
228 
229  virtual void addCallback( DtLgrTotalStateCb cb, void* user );
230  virtual void removeCallback( DtLgrTotalStateCb );
231 
232  virtual void addCallbackConnectionAdded( DtLgrConnectionAddedCb cb, void* user );
233  virtual void removeCallbackConnectionAdded( DtLgrConnectionAddedCb );
234 
235  virtual void addCallbackConnectionRemoved( DtLgrConnectionRemovedCb cb, void* user );
236  virtual void removeCallbackConnectionRemoved( DtLgrConnectionRemovedCb );
237 
238  virtual void addCallbackConnectionTimedOut( DtLgrConnectionTimedOutCb cb, void* user );
239  virtual void removeCallbackConnectionTimedOut( DtLgrConnectionTimedOutCb );
240 
241  virtual void addCallbackCommandAccepted( DtLgrCommandAcceptedCb cb, void* user );
242  virtual void removeCallbackCommandAccepted( DtLgrCommandAcceptedCb );
243 
244  virtual void addCallbackCommandRejected( DtLgrCommandRejectedCb cb, void* user );
245  virtual void removeCallbackCommandRejected( DtLgrCommandRejectedCb );
246 
247  virtual void addCallbackCommandTimedOut( DtLgrCommandTimedOutCb cb, void* user );
248  virtual void removeCallbackCommandTimedOut( DtLgrCommandTimedOutCb );
249 
251 
252  public:
253 
255  static const DtEntityIdentifier& wildcardAddress();
256 
258  static const char* commandToString(int domain, int command);
259 
260  const DtRemoteLoggerMap& getMyRemoteLoggerMap() const;
261 
262  protected:
263 
265  virtual void lgrCtrlCallback( DtInteraction* );
266 
268  virtual void processControlPdus();
269 
271  virtual void processBackChannel();
272 
274  virtual void checkConnections();
275 
277  virtual bool isIdMatching(const DtEntityIdentifier& targetId, bool allowWildCard=true);
278 
280  virtual DtSequenceNumber nextSequenceNumber();
281 
283 
284  virtual void processTotalState(DtLgrTotalStatePdu* totalStatePdu);
285  virtual void processConnect(DtLgrConnectPdu* connectPdu);
286  virtual void processDisconnect(DtLgrDisconnectPdu* disconnectPdu);
287  virtual void processLgrHeartbeat(DtLgrLgrHeartbeatPdu* lgrHeartbeatPdu);
288  virtual void processAcknowledge(DtLgrAcknowledgePdu* acknowledgePdu);
289  virtual void processResponse(DtLgrResponsePdu* responsePdu);
291 
293  virtual void commandAccepted(DtSequenceNumber sequenceNumber);
294 
296  virtual void commandRejected(const DtEntityIdentifier& source, DtSequenceNumber sequenceNumber);
297 
299  virtual void commandTimedOut(DtSequenceNumber sequenceNumber);
300 
302  virtual void sendMessage(const DtLgrControlPdu& message);
303 
304  protected:
305 
307  static void lgrCtrlCb( DtInteraction*, void* );
308 
309  protected:
310 
312  typedef struct DtPendingAcknowledge
313  {
314  DtTime timeout;
317 
318  typedef std::map<DtSequenceNumber, DtPendingAcknowledge> DtPendingAcknowledgeList;
319  typedef std::map<DtSequenceNumber, DtTime> DtRejectCommandList;
320  typedef std::map<DtSequenceNumber, DtRemoteControlDomainInterface*> DtAcknowledgeDomainMap;
321 
322  typedef std::list<DtLgrControlPdu*> DtPduList;
323 
324  protected:
325 
326 
328  DtInetSocket* myBackChannelConnection;
329  DtInetBuffer myBackChannelBuffer;
330  DtEntityIdentifier myId;
345  DtClock myClock;
347 
348  std::map<DtLgrConnectCb, void*> myConnectCallbacks;
349  std::map<DtLgrDisconnectCb, void*> myDisconnectCallbacks;
350  std::map<DtLgrAcknowledgeCb, void*> myAcknowledgeCallbacks;
351  std::map<DtLgrResponseCb, void*> myResponseCallbacks;
352  std::map<DtLgrTotalStateCb, void*> myTotalStateCallbacks;
353  std::map<DtLgrLgrHeartbeatCb, void*> myHeartbeatCallbacks;
354  std::map<DtLgrConnectionAddedCb, void*> myConnectionAddedCallbacks;
355  std::map<DtLgrConnectionRemovedCb, void*> myConnectionRemovedCallbacks;
356  std::map<DtLgrConnectionTimedOutCb, void*> myConnectionTimedOutCallbacks;
357  std::map<DtLgrCommandAcceptedCb, void*> myCommandAcceptedCallbacks;
358  std::map<DtLgrCommandRejectedCb, void*> myCommandRejectedCallbacks;
359  std::map<DtLgrCommandTimedOutCb, void*> myCommandTimedOutCallbacks;
360 
367 
368  protected:
369  static const DtU16 theAddressWildcard = ((1<<16)-1); // 65535 or 0xFFFF
370  static const DtEntityIdentifier theWildcardAddress;
371 
372  };
373 }
The logger command which contains the command type and its parameters.
Definition: lgrCommand.h:110
std::map< DtLgrLgrHeartbeatCb, void * > myHeartbeatCallbacks
Definition: remoteControlInterface.h:353
DtSequenceNumber mySequenceNumber
Definition: remoteControlInterface.h:331
int myNumberOfLoggers
Definition: remoteControlInterface.h:343
DtInetBuffer myBackChannelBuffer
Definition: remoteControlInterface.h:329
void(* DtLgrConnectionRemovedCb)(const DtRemoteLoggerConnection &loggerConnection, void *usr)
Definition: remoteControlInterface.h:61
DtRemoteControlSimulationInterface * mySimulationInterface
Definition: remoteControlInterface.h:365
std::map< DtSequenceNumber, DtPendingAcknowledge > DtPendingAcknowledgeList
Definition: remoteControlInterface.h:318
std::list< DtLgrControlPdu * > DtPduList
Definition: remoteControlInterface.h:322
std::map< DtSequenceNumber, DtTime > DtRejectCommandList
Definition: remoteControlInterface.h:319
std::set< DtEntityIdentifier > DtEntityIdSet
Definition: remoteControlInterface.h:52
Instances of DtLgrTotalStatePdu are used to convey to a remote logger- controller the total current s...
Definition: lcTotalState.h:43
DtEntityIdSet myRejectedLoggerIds
Definition: remoteControlInterface.h:335
Instances of DtRemoteLoggerConnection are a family of messages used to control a remote instance of t...
Definition: lcRemoteLoggerConnection.h:27
DtRemoteLoggerMap myRemoteLoggers
Definition: remoteControlInterface.h:333
DtClock myClock
Definition: remoteControlInterface.h:345
Instances of DtLgrDisconnectPdu are used to convey to a remote logger- controller the total current s...
Definition: lcDisconnect.h:25
DtRemoteControlSystemInterface * mySystemInterface
Definition: remoteControlInterface.h:361
#define DT_DLL_LGR_RCI
Definition: lgrRemoteControlInterface.h:18
static const DtEntityIdentifier theWildcardAddress
Definition: remoteControlInterface.h:370
std::map< DtLgrConnectionRemovedCb, void * > myConnectionRemovedCallbacks
Definition: remoteControlInterface.h:355
Contains DtRemoteLoggerConnection.
bool myAcceptAnyId
Definition: remoteControlInterface.h:336
DtTime myConnectionTimeout
Definition: remoteControlInterface.h:337
int myBackChannelTickBudget
Definition: remoteControlInterface.h:342
void(* DtLgrResponseCb)(DtLgrResponsePdu *connect, void *usr)
Definition: remoteControlInterface.h:58
DtRemoteControlPlaybackInterface * myPlaybackInterface
Definition: remoteControlInterface.h:362
std::map< DtLgrCommandTimedOutCb, void * > myCommandTimedOutCallbacks
Definition: remoteControlInterface.h:359
std::map< DtLgrCommandRejectedCb, void * > myCommandRejectedCallbacks
Definition: remoteControlInterface.h:358
Primary interface to remote loggers.
Definition: remoteControlInterface.h:73
DtTime timeout
Definition: remoteControlInterface.h:314
DtRejectCommandList myRejectedCommands
Definition: remoteControlInterface.h:340
DtEntityIdSet myRemoteLoggerIds
Definition: remoteControlInterface.h:334
void(* DtLgrLgrHeartbeatCb)(DtLgrLgrHeartbeatPdu *connect, void *usr)
Definition: remoteControlInterface.h:56
DtAcknowledgeDomainMap myAcknowledgeInterface
Definition: remoteControlInterface.h:344
void(* DtLgrConnectCb)(DtLgrConnectPdu *connect, void *usr)
Definition: remoteControlInterface.h:54
void(* DtLgrConnectionAddedCb)(const DtRemoteLoggerConnection &loggerConnection, void *usr)
Definition: remoteControlInterface.h:60
Responsible for invoking simulation commands and processing simulation responses. ...
Definition: remoteControlSimulationInterface.h:21
DtRemoteControlRecordInterface * myRecordInterface
Definition: remoteControlInterface.h:363
DtU32 DtSequenceNumber
Definition: remoteControlInterface.h:48
std::map< DtLgrConnectCb, void * > myConnectCallbacks
Definition: remoteControlInterface.h:348
Base class for handling commands and responses.
Definition: remoteControlDomainInterface.h:27
DtExerciseConn * myExerciseCon
Definition: remoteControlInterface.h:327
std::map< DtLgrAcknowledgeCb, void * > myAcknowledgeCallbacks
Definition: remoteControlInterface.h:350
void(* DtLgrConnectionTimedOutCb)(const DtRemoteLoggerConnection &loggerConnection, void *usr)
Definition: remoteControlInterface.h:62
Entry for pending acknowledgment.
Definition: remoteControlInterface.h:312
Instances of DtLgrControlPdu are a family of messages used to control a remote instance of the MAK-Lo...
Definition: lcPdu.h:140
DtPendingAcknowledgeList myPendingAcknowledgements
Definition: remoteControlInterface.h:339
DtEntityIdSet pending
Definition: remoteControlInterface.h:315
DtTime myNextTimeoutCheck
Definition: remoteControlInterface.h:338
Instances of DtLgrLgrHeartbeatPdu are used for fault tolerance indicating that the logger is still ac...
Definition: lcLgrHeartbeat.h:18
std::map< DtLgrConnectionAddedCb, void * > myConnectionAddedCallbacks
Definition: remoteControlInterface.h:354
std::set< DtSequenceNumber > DtSequenceNumberSet
Definition: remoteControlInterface.h:51
void(* DtLgrCommandAcceptedCb)(DtSequenceNumber sequenceNumber, void *usr)
Definition: remoteControlInterface.h:64
class DT_DLL_MATREX_TSPI_FOM_MAP DtInteraction
Definition: matrexTspiTagModifier.h:20
void(* DtLgrTotalStateCb)(DtLgrTotalStatePdu *connect, void *usr)
Definition: remoteControlInterface.h:59
DtPduList myPduList
Definition: remoteControlInterface.h:332
bool myPassivelyAccepting
Definition: remoteControlInterface.h:346
DtInetSocket * myBackChannelConnection
Definition: remoteControlInterface.h:328
DtRemoteControlSharedInterface * mySharedInterface
Definition: remoteControlInterface.h:366
DtTime MyAcknowledgeTimeout
Definition: remoteControlInterface.h:341
class DT_DLL_LGRUTIL DtAbsoluteTime
Definition: absoluteTime.h:22
std::map< DtSequenceNumber, DtRemoteControlDomainInterface * > DtAcknowledgeDomainMap
Definition: remoteControlInterface.h:320
std::map< DtLgrTotalStateCb, void * > myTotalStateCallbacks
Definition: remoteControlInterface.h:352
Instances of DtLgrResponsePdu are to respond to a remote controller with the result of a logger comma...
Definition: lcResponse.h:19
std::map< DtLgrResponseCb, void * > myResponseCallbacks
Definition: remoteControlInterface.h:351
std::map< DtEntityIdentifier, DtRemoteLoggerConnection > DtRemoteLoggerMap
Collection of remote logger connections.
Definition: lcRemoteLoggerConnection.h:210
Responsible for invoking editor commands and processing editor responses.
Definition: remoteControlEditorInterface.h:27
Responsible for invoking shared commands and processing shared responses.
Definition: remoteControlSharedInterface.h:22
void(* DtLgrAcknowledgeCb)(DtLgrAcknowledgePdu *connect, void *usr)
Definition: remoteControlInterface.h:57
Instances of DtLgrAcknowledgePdu are to respond to a remote controller with the result of a logger co...
Definition: lcAcknowledge.h:24
Contains lgrRemoteControlInterface library definitions.
std::map< DtLgrDisconnectCb, void * > myDisconnectCallbacks
Definition: remoteControlInterface.h:349
std::map< DtLgrConnectionTimedOutCb, void * > myConnectionTimedOutCallbacks
Definition: remoteControlInterface.h:356
Responsible for invoking system commands and processing system responses.
Definition: remoteControlSystemInterface.h:21
Responsible for invoking playback commands and processing playback responses.
Definition: remoteControlPlaybackInterface.h:29
DtEntityIdentifier myId
Definition: remoteControlInterface.h:330
void(* DtLgrDisconnectCb)(DtLgrDisconnectPdu *connect, void *usr)
Definition: remoteControlInterface.h:55
void(* DtLgrCommandRejectedCb)(const DtEntityIdentifier &source, DtSequenceNumber sequenceNumber, void *usr)
Definition: remoteControlInterface.h:65
DtRemoteControlEditorInterface * myEditorInterface
Definition: remoteControlInterface.h:364
void(* DtLgrCommandTimedOutCb)(DtSequenceNumber sequenceNumber, void *usr)
Definition: remoteControlInterface.h:66
std::map< DtLgrCommandAcceptedCb, void * > myCommandAcceptedCallbacks
Definition: remoteControlInterface.h:357
Instances of DtLgrConnectPdu are used to convey to a remote logger- controller the total current stat...
Definition: lcConnect.h:26
Responsible for invoking record commands and processing record responses.
Definition: remoteControlRecordInterface.h:26

Document ID: Generated on Tue Nov 17 15:25:07 EST 2026 from SVN revision 298446
Copyright © 2026 MAK Technologies. All Rights Reserved (www.mak.com)