VR-Forces Development_Version 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>
11 #include <vl/dataInteraction.h>
12 
13 #ifdef DtDIS
14 typedef DtEntityStateEncoder DtEntPublisherEncoder;
15 typedef DtEntityStateDecoder DtEntPublisherDecoder;
16 #elif DtHLA
19 #endif
20 
22 class DtEntityType;
23 class DtBaseEntityStateRepository;
24 class DtSimulationAddress;
26 
38 {
39 
40 public:
48  const DtEntityType& type,
49  DtExerciseConn* conn,
50 #if DtHLA
51  const DtGlobalObjectDesignator& glId = DtGlobalObjectDesignator::nullId(),
52 #endif
53  const DtEntityIdentifier& entId = DtEntityIdentifier::nullId()
54  );
55 
57  virtual ~DtVrfEntityPublisher();
58 
59 public:
68  virtual void tick();
69 
72  virtual DtExtEntityStateRepository* entityProcessStateRep();
73  virtual DtExtEntityStateRepository* entityStateRep();
74 
76  virtual DtExtEntityStateRepository* ensr();
77 
78 #ifdef DtHLA
79 
80 
81 
82  virtual DtEntPublisherDecoder* decoder();
83 
86  virtual DtEntPublisherEncoder* encoder();
87 #endif
88 
89 #ifdef DtDIS
90 
91  virtual void setSendDiGuyPdus(bool yesNo);
92 
94  virtual bool sendDiGuyPdus() const;
95 #endif
96 
98  virtual const DtObjectId& id() const;
99 
101  virtual const DtObjectId& localId() const;
102 
104  virtual const DtGlobalObjectDesignator& globalId() const;
105 
108  virtual void forceUpdate();
109 
111  virtual bool sendVrfObjectData();
112 
114  virtual DtEntityPublisher* entityPublisher();
115 
116 public:
117  // Sets the time to update the vrf data message. The message will
118  // be sent on this time (default is five seconds) or if the data
119  // as seen by remote is different that the current time. If time
120  // is set to be -1, it will only be sent if the data is different
121  static void setVrfDataTimeThreshold(DtTime time);
122  static DtTime vrfDataTimeThreshold();
123 
124 private:
127  DtVrfEntityPublisher& operator=(const DtVrfEntityPublisher&);
128 
129 protected:
131  virtual bool sendVrfDataUpdate();
132 
136  virtual bool needsVrfObjectDataUpdate();
137 
142  virtual bool sendMessage(const DtSimulationAddress& receiver,
143  DtSimInterfaceContent* message);
145  virtual bool setContentForNet(DtDataInteraction* dataInter,
146  DtSimInterfaceContent* content) const;
148  virtual void sendMessageInteraction(const DtSimulationAddress& receiver,
149  DtDataInteraction& data);
150 
151 protected:
154  static void dataInteractionCallback(DtDataInteraction* i, void* usr);
155 
158  virtual void processSendVrfObjectDataMessage(DtDataInteraction* interaction);
159 
160 public:
162  virtual void processDataInteraction(DtDataInteraction* i);
163 
164 protected:
165  DtEntityPublisher* myPublisher;
166 
167  // For heartbeating for DtIfVrfObjectData messages
170 };

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)