VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vrfEntityPublisher.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 #include <vl/entityPublisher.h>
9 #ifdef DtDIS
10 #include <vl/diGuyCustomPduEncoder.h>
11 #endif
14 #include <vl/dataInteraction.h>
15 
16 #ifdef DtDIS
17 typedef DtEntityStateEncoder DtEntPublisherEncoder;
18 typedef DtEntityStateDecoder DtEntPublisherDecoder;
19 #elif DtHLA
22 #endif
23 
25 class DtEntityType;
26 class DtBaseEntityStateRepository;
27 class DtSimulationAddress;
29 
45 {
46 
47 public:
55  const DtEntityType& type,
56  DtExerciseConn* conn,
57 #if DtHLA
58  const DtGlobalObjectDesignator& glId = DtGlobalObjectDesignator::nullId(),
59 #endif
60  const DtEntityIdentifier& entId = DtEntityIdentifier::nullId()
61  );
62 
64  virtual ~DtVrfEntityPublisher();
65 
66 public:
75  virtual void tick();
76 
79  virtual DtExtEntityStateRepository* entityProcessStateRep();
80  virtual DtExtEntityStateRepository* entityStateRep();
81 
83  virtual DtExtEntityStateRepository* ensr();
84 
85 #ifdef DtHLA
86 
87 
88 
89  virtual DtEntPublisherDecoder* decoder();
90 
93  virtual DtEntPublisherEncoder* encoder();
94 #endif
95 
96  virtual void setPublishesDiGuyInfo(bool has);
97  virtual bool publishesDiGuyInfo();
98 
99 #ifdef DtDIS
100 
101  virtual void setSendDiGuyPdus(bool yesNo);
102 
104  virtual bool sendDiGuyPdus() const;
105 
107  virtual void createAndSendDiGuyPdus();
108 #endif
109 
112  {
113  return myPublisher->sr();
114  }
115 
116 #if DtHLA
117  const DtString& name() const
118  {
119  return myPublisher->name();
120  }
121 #endif
122 
125  virtual DtString getVrfUUID();
126 
128  virtual const DtObjectId& id() const;
129 
131  virtual const DtObjectId& localId() const;
132 
134  virtual const DtGlobalObjectDesignator& globalId() const;
135 
138  virtual void forceUpdate();
139 
141  virtual bool sendVrfObjectData();
142 
144  virtual DtEntityPublisher* entityPublisher();
145 
146 public:
147  // Sets the time to update the vrf data message. The message will
148  // be sent on this time (default is five seconds) or if the data
149  // as seen by remote is different that the current time. If time
150  // is set to be -1, it will only be sent if the data is different
151  static void setVrfDataTimeThreshold(DtTime time);
152  static DtTime vrfDataTimeThreshold();
153 
154 private:
157  DtVrfEntityPublisher& operator=(const DtVrfEntityPublisher&);
158 
159 protected:
161  virtual bool sendVrfDataUpdate();
162 
166  virtual bool needsVrfObjectDataUpdate();
167 
172  virtual bool sendMessage(const DtSimulationAddress& receiver,
173  DtSimInterfaceContent* message);
175  virtual bool setContentForNet(DtDataInteraction* dataInter,
176  DtSimInterfaceContent* content) const;
178  virtual void sendMessageInteraction(const DtSimulationAddress& receiver,
179  DtDataInteraction& data);
180 
181 protected:
184  static void dataInteractionCallback(DtDataInteraction* i, void* usr);
185 
188  virtual void processSendVrfObjectDataMessage(DtDataInteraction* interaction);
189 
190 public:
192  virtual void processDataInteraction(DtDataInteraction* i);
193 
194 protected:
195  DtEntityPublisher* myPublisher;
196 
197  // For heartbeating for DtIfVrfObjectData messages
200  bool myPublishesDIGuyInfo; // true if there is DI-Guy info to be published
201 
202  static bool myDiGuyEncodersSetup;
203 };

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)