MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lgrPublisherInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2026 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <lgrSim/lgrSim.h>
12 
13 #include <vlutil/vlTime.h>
14 #if DtHLA
15 #include <vl/region.h>
16 #include <lgrSim/lgrHlaAttribute.h>
17 #endif
18 
19 class DtStateMsg;
20 class DtPdu;
21 
22 #if DtHLA
23 class DtHlaObjectWithStateRep;
24 #endif
25 
26 namespace MAKLogger
27 {
28  class DtAbsoluteTime;
29  class DtPacket;
30 
31 #if DtHLA
32  class DtLgrHlaSimulationManager;
33 #else
34  class DtLgrDisSimulationManager;
35 #endif
36 
40  {
41  public:
42 
43 #if DtHLA
44  DtLgrPublisherInterface(DtLgrHlaSimulationManager& simMgr,
45  DtLgrHlaHandle loggerObjectId, DtLgrHlaHandle loggerClassHandle);
46 #else
48 #endif
49 
51  virtual ~DtLgrPublisherInterface();
52 
53  public:
54 
56 #if DtHLA
57  virtual void update(const DtStateMsg& msg, const DtAbsoluteTime& updateTime,
58  bool isTimeFromPast, bool isStateUpdate, double scaling, bool isStatic, bool sendFlag) = 0;
59 #else
60  virtual void update( const DtPdu& pdu, const DtAbsoluteTime& updateTime, bool isTimeFromPast,
61  bool isStateUpdate, double scaling, bool isStatic, bool sendFlag) = 0;
62 #endif
63 
66  virtual DtPacket* createUpdatePacket(const DtAbsoluteTime& time);
67 
69  virtual void sendUpdateAtScaleChangePoint(double oldScale, double newScale,
70  bool wasStatic, bool isStatic) = 0;
71 
73  virtual void tick(double scaling, bool isStatic) = 0;
74 
78  virtual bool timeoutNow();
79 
80 #if DtDIS
81  virtual void setExerciseId(unsigned char exerciseId);
83 
85  virtual unsigned char exerciseId() const;
86 #endif
87 
88 #if DtHLA
89 
95  virtual bool updateRegion(const DtStateMsg& msg);
96 
98  virtual void setRegion(const DtDDMRegionSet& region) = 0;
99 
101  virtual const DtDDMRegionSet& publishingRegions() const = 0;
102 
105  virtual void setStaticRegionFlag(bool enabled);
106 
108  virtual bool staticRegionFlag() const;
109 
112  virtual bool publishingToRegion( DtDDMRegionSP region ) = 0;
113 
117  virtual void setWaitingForRegionData(bool waitForData);
118 
121  virtual bool waitingForRegionData();
122 
124 #if DtHLA_1516
125  virtual void addUpdatedAttributes(const RTI::AttributeHandleValueMap& handleValues);
126 #else
127  virtual void addUpdatedAttributes(const RTI::AttributeHandleValuePairSet& handleValues);
128 #endif
129 
131  virtual const RTI::AttributeHandleSet* updatedAttributes() const;
132 #endif
133 
134  protected:
135 
136 #if DtDIS
137  // Adjust exercise connection exercise ID with publisher's exercise ID,
138  // when Logger configured to use exercise ID of 0
139  virtual void adjustConnectionExerciseId();
140 
141  // Reset exercise connection exercise ID with publisher's exercise ID,
142  // when Logger configured to use exercise ID of 0
143  virtual void resetConnectionExerciseId();
144 
146  virtual const DtStateMsg& lastState() const = 0;
147 
148  //Adjust DtProtocolVersionToSend to match the version recorded in the Logger tape
149  //when Logger is not configured to use DIS version override.
150  virtual void adjustProtocolVersionToSend();
151 
152  //Reset DtProtocolVersionToSend to the default value.
153  virtual void resetProtocolVersionToSend();
154 
155  virtual void setInitialDISVersion(int version);
156 #endif
157 
158 #if DtHLA
159  // HLA
160 
162  virtual DtHlaObjectWithStateRep* pubHlaObject() = 0;
163 
166  virtual void sendTheseAttrs(const RTI::AttributeHandleSet& attrs, double scale, bool isStatic) = 0;
167 
170  virtual void sendAttributes(const DtStateMsg& msg, double scaling, bool isStatic);
171 
173  virtual bool sendAllNextTick();
174 
177  virtual void setSendAllNextTick(bool yesNo = true);
178 
179 #endif
180 
181  protected:
182 
184 #if DtDIS
186  unsigned char myExConnExerciseId;
187  unsigned char myExerciseId;
190 #endif
191 
192 #if DtHLA
193  DtLgrHlaHandle myLoggerObjectId;
194  DtLgrHlaHandle myLoggerClassHandle;
196  DtLgrHlaSimulationManager& mySimMgr;
197  bool myWaitingForRegionData;
198  bool myStaticRegionFlag;
199  RTI::AttributeHandleSet* myUpdatedAttributes;
201  bool mySendAllNextTick;
202 #endif
203  };
204 
205 }
Defines IMPORT/EXPORT macros for lgrSim library.
#define DT_DLL_LGRSIM
Definition: lgrSim.h:21
The DIS Simulation manager manages the DIS simulation settings.
Definition: lgrDisSimManager.h:45
Contains MAKLogger::DtLgrHlaHandle typedef and MAKLogger::DtLgrValueReference and MAKLogger::DtLgrVal...
int myInitialDISVersion
Definition: lgrPublisherInterface.h:188
unsigned char myExConnExerciseId
Definition: lgrPublisherInterface.h:186
Responsible for defining the interface that Object publishers must have.
Definition: lgrPublisherInterface.h:39
unsigned char myExerciseId
Definition: lgrPublisherInterface.h:187
A generic packed of typed binary data.
Definition: packet.h:41
int myDefaultDISVersion
Definition: lgrPublisherInterface.h:189
class DT_DLL_LGRUTIL DtAbsoluteTime
Definition: absoluteTime.h:22
DtLgrDisSimulationManager & mySimMgr
Definition: lgrPublisherInterface.h:185
DtTime myLastUpdateTime
Definition: lgrPublisherInterface.h:183
Absolute Time, a particular measured instance in time, could be thought of as a set of relative times...
Definition: absoluteTime.h:82

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)