MAK Data Logger API Documentation for HLA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lcPdu.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #ifndef lcPdu_h_
6 #define lcPdu_h_
7 
10 
11 #pragma once
12 
13 #include "loggerControlDefines.h"
14 #include "packets/lgrControlP.h"
15 #include <vlutil/vlMachineTypes.h>
16 #include <vlutil/vlPrintUtil.h>
17 #include <matrix/LibMatrix.h>
18 #include <matrix/vlMath.h>
19 #include <vlpi/parseEnum.h>
20 #include <vl/interaction.h>
21 #include <vl/exerciseConn.h>
22 #include <vl/hostStructs.h>
23 #include <vl/pdu.h>
24 
25 
27 
29 {
30  DtLgrBeginExtension = 22, // DtLgrTotalState+1
31  DtLgrEmpty = 22,
39 };
40 
43 {
45  DtLGR_DIS = 1,
49 #if !DtHLA
51 #elif DtHLA_1516_EVOLVED
53 #elif DtHLA_1516
54  DtLGR_PROTOCOL_IN_USE = DtLGR_HLA_1516,
55 #else
56  DtLGR_PROTOCOL_IN_USE = DtLGR_HLA_13
57 #endif
58 };
59 
60 
63 {
70 };
71 
72 
75 {
80 };
81 
82 
85 {
90 };
91 
92 
94 {
97 };
98 
99 
102 {
106 };
107 
108 
111 {
120 };
121 
122 #if DtDIS
123 
126 
128 typedef void (*DtLgrControlInteractionCb)
129  ( DtLgrControlInteraction* inter, void* usr );
130 
131 #endif
132 
136 #if DtHLA
138 #else
140 #endif
141 {
142 public:
143 
145  DtLgrControlPdu( DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, int pduSize=sizeof(DtNetLgrControlPdu) );
146 
148  DtLgrControlPdu( const DtNetLgrControlPdu* initial,
149  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0 );
150 
152  virtual ~DtLgrControlPdu();
153 
155  DtLgrControlPdu( const DtLgrControlPdu& src );
156 
159 
161  virtual const DtEntityIdentifier& receiverId() const;
162  virtual void setReceiverId( const DtEntityIdentifier& id );
163 
165  virtual const DtEntityIdentifier& senderId() const;
166  virtual void setSenderId( const DtEntityIdentifier& id );
167 
169  virtual DtLgrCommand lgrCommand() const;
170 
172  virtual DtU16 lctVersion() const;
174  void setLctVersion(DtU16 versionNumber);
175 
177  virtual DtU32 sequence() const;
178  virtual void setSequence(DtU32 sequenceNumber);
179 
181  virtual void printDataToStream(std::ostream& stream) const;
182 
184  virtual bool checkVersion() const;
185 
186 public:
188  static DtPdu* create( const DtNetPacket* initial,
189  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0 );
190 
192  static DtLgrControlPdu* create( DtLgrCommand command );
193 
195  static DtLgrControlPdu* create( DtLgrCommandExt command );
196 
198  static bool checkVersion(DtNetLgrControlPdu* header);
199 
200 #if DtDIS
201  static void addCallback( DtExerciseConn* conn,
203  DtLgrControlInteractionCb cb, void* usr );
204  static void removeCallback( DtExerciseConn* conn,
205  DtLgrControlInteractionCb cb, void* usr );
206 #endif
207 
209  static DtU16 addressWildcard();
210 
212  static const DtEntityIdentifier& wildcardAddress();
213 
215  static const char* lgrModeEnum2string( DtLgrMode md );
216 
218  static const char* lgrFilePosEnum2string( DtLgrFilePosition pos );
219 
221  static const char* lgrStateFlag2string( DtLgrCtrlFlagStates flg );
222 
223 public:
224 
225  // Prior to version 12.2 release 8, some subclasses performed initPdu that zeroed out the version.
226  // This flag allows the version check to be disabled so these subclasses sent from older versions
227  // will not be rejected.
230 
231 protected:
233  virtual void setLgrCommand( DtLgrCommand com );
235  virtual void setLgrCommand( DtLgrCommandExt com );
236 
239 
241  virtual DtNetLgrControlPdu* controlHeader() const;
242 
244  DtPduKind internalGetPduKind() const { return DtLgrControlPduKind; }
245 
246 protected:
248  DtEntityIdentifier mySenderId;
249  DtEntityIdentifier myReceiverId;
250 
251 protected:
252  static const DtU16 theAddressWildcard = ((1<<16)-1); // 65535 or 0xFFFF
253  static const DtEntityIdentifier theWildcardAddress;
254 };
255 
257 DT_DLL_LOGGERCONTROL const char *DtLgrCommandEnumString(DtLgrCommand param);
258 
259 #endif // lcPdu_h_
Definition: lcPdu.h:118
DtLgrCommandExt
Definition: lcPdu.h:28
Definition: lcPdu.h:34
DtLgrMode
General operation modes.
Definition: lcPdu.h:62
virtual DtNetLgrControlPdu * controlHeader()
Access to the payload as control pdu header.
virtual const DtEntityIdentifier & senderId() const
Get/set identifier of sender, if applicable.
Definition: lcPdu.h:96
Definition: lcPdu.h:47
void setLctVersion(DtU16 versionNumber)
Called in constructor so not virtual.
Definition: lcPdu.h:33
Definition: lcPdu.h:89
static bool theDisableCheckVersion
Enable/Disable version check.
Definition: lcPdu.h:229
virtual void setSequence(DtU32 sequenceNumber)
Definition: lcPdu.h:113
DtPduKind internalGetPduKind() const
Identity for use by toolkit.
Definition: lcPdu.h:244
Definition: lgrControlP.h:61
DtLgrDirection
Play forwards or backwards when in LGR_PLAY mode.
Definition: lcPdu.h:74
Definition: lcPdu.h:88
Definition: lcPdu.h:64
Definition: lcPdu.h:69
static const char * lgrFilePosEnum2string(DtLgrFilePosition pos)
The name (as a string) of a &#39;DtLgrFilePosition&#39;-type enum (from value)
static DtU16 addressWildcard()
Wildcard value for addresses.
Definition: lcPdu.h:68
virtual DtU16 lctVersion() const
Get/set version.
Definition: lcPdu.h:115
static const DtEntityIdentifier theWildcardAddress
Definition: lcPdu.h:253
virtual bool checkVersion() const
Check that this PDU&#39;s LCT version is compatible.
virtual DtLgrCommand lgrCommand() const
Get message-type for proper casting to a subclass.
DtLgrFilePosition
Location status.
Definition: lcPdu.h:84
DtLgrCtrlFlagStates
Controlling runtime-settable flags and options of the Logger.
Definition: lcPdu.h:110
DT_DLL_LOGGERCONTROL const char * DtLgrCommandEnumString(DtLgrCommand param)
Handles extensions to logger commands.
virtual const DtEntityIdentifier & receiverId() const
Get/set identifier of intended recipient (logger).
Definition: lcPdu.h:117
Definition: lcPdu.h:77
static const DtEntityIdentifier & wildcardAddress()
Wildcard address.
Definition: lcPdu.h:48
Definition: lcPdu.h:35
DtLgrControlPdu & operator=(const DtLgrControlPdu &src)
assignment operator
Definition: lcPdu.h:32
Definition: lcPdu.h:45
Instances of DtLgrControlInteraction are used to represent LgrControl Interactions in HLA...
Definition: hLcInter.h:28
Definition: lcPdu.h:30
Instances of DtLgrControlPdu are a family of messages used to control a remote instance of the MAK-Lo...
Definition: lcPdu.h:137
Definition: lcPdu.h:38
Definition: lcPdu.h:114
static DtPdu * create(const DtNetPacket *initial, DtBufferPtr buffer=DtUSE_INTERNAL_BUFFER, DtPduFactory *pduFactory=0)
Create a PDU representation from a network packet.
DtEntityIdentifier mySenderId
Parameter.
Definition: lcPdu.h:248
Definition: lcPdu.h:66
virtual void setSenderId(const DtEntityIdentifier &id)
void(* DtLgrControlInteractionCb)(DtLgrControlInteraction *inter, void *usr)
LgrControl interaction callback function signature.
Definition: hLcInter.h:22
DtLgrControlPdu(DtBufferPtr buffer=DtUSE_INTERNAL_BUFFER, int pduSize=sizeof(DtNetLgrControlPdu))
(default) constructor
Definition: lcPdu.h:37
Definition: lcPdu.h:95
virtual DtU32 sequence() const
Get/set sequence number.
static const char * lgrStateFlag2string(DtLgrCtrlFlagStates flg)
The name (as a string) of a &#39;DtLgrCtrlFlagStates&#39;-type enum (from value)
Definition: lcPdu.h:65
static const char * lgrModeEnum2string(DtLgrMode md)
The name (as a string) of a &#39;DtLgrMode&#39;-type enum (from value)
class DT_DLL_MATREX_TSPI_FOM_MAP DtInteraction
Definition: matrexTspiTagModifier.h:20
Definition: lcPdu.h:87
Definition: lcPdu.h:78
Definition: lcPdu.h:67
Contains network data structures for logger control PDUs.
virtual void setReceiverId(const DtEntityIdentifier &id)
Definition: lcPdu.h:44
Definition: lcPdu.h:46
Definition: lcPdu.h:76
DtLgrProcess
Receiving application may filter lcPdu based on this start-up flag.
Definition: lcPdu.h:101
Contains export defines for logger control toolkit.
virtual void setLgrCommand(DtLgrCommand com)
Set is done by constructing the proper subclass.
DtLgrProtocol
Protocols.
Definition: lcPdu.h:42
Definition: lcPdu.h:79
Definition: lcPdu.h:105
Definition: lcPdu.h:104
Definition: lcPdu.h:112
Definition: lcPdu.h:36
Definition: lcPdu.h:119
Definition: lcPdu.h:116
Definition: lcPdu.h:54
Definition: lcPdu.h:103
DtLgrStyle
Definition: lcPdu.h:93
virtual void printDataToStream(std::ostream &stream) const
Print contents.
Definition: lcPdu.h:86
virtual ~DtLgrControlPdu()
destructor
Definition: lcPdu.h:31
DtEntityIdentifier myReceiverId
Definition: lcPdu.h:249
#define DT_DLL_LOGGERCONTROL
Include vlconfig.h to get relivant platform info like if we need declspec stuff or not...
Definition: loggerControlDefines.h:31

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)