MAK Data Logger API Documentation for DIS
 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
137 class DT_DLL_LOGGERCONTROL DtLgrControlPdu : public DtPdu
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 
202  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_

Document ID: Generated on Thu Jul 23 15:05:27 EDT 2020 from SVN revision 215371
Copyright © 2020 MAK Technologies. All Rights Reserved (www.mak.com)