VR-Forces 4.1 Class Documentation
vrfEntityPub.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2006 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: vrfEntityPub.h,v $ $Revision: 1.11 $ $State: Exp $
7 *******************************************************************************/
8 
9 #ifndef VRFENTITYPUB_H
10 #define VRFENTITYPUB_H
11 
12 #include <vl/entityPub.h>
15 #include <vl/dataInter.h>
16 
17 #ifdef DtDIS
18 typedef DtEntityStateEncoder DtEntPublisherEncoder;
19 typedef DtEntityStateDecoder DtEntPublisherDecoder;
20 #elif DtHLA
21 typedef DtHlaStateEncoder DtEntPublisherEncoder;
22 typedef DtHlaStateDecoder DtEntPublisherDecoder;
23 #endif
24 
26 class DtEntityType;
27 class DtBaseEntityStateRepository;
28 class DtSimulationAddress;
30 
42 {
43 
44 public:
52  const DtEntityType& type,
53  DtExerciseConn* conn,
54  const DtGlobalObjectDesignator& id = DtVrfObjectIdGenerator::nullId()
55  );
56 
58  virtual ~DtVrfEntityPublisher();
59 
60 public:
69  virtual void tick();
70 
73  virtual DtExtEntityStateRepository* entityProcessStateRep();
74  virtual DtExtEntityStateRepository* entityStateRep();
75 
77  virtual DtExtEntityStateRepository* ensr();
78 
79 #ifdef DtHLA
80 
81 
82 
83  virtual DtEntPublisherDecoder* decoder();
84 
87  virtual DtEntPublisherEncoder* encoder();
88 #endif
89 
90 #ifdef DtDIS
91 
92  virtual void setSendDiGuyPdus(bool yesNo);
93 
95  virtual bool sendDiGuyPdus() const;
96 #endif
97 
99  virtual const DtObjectId& id() const;
100 
102  virtual const DtObjectId& localId() const;
103 
105  virtual const DtGlobalObjectDesignator& globalId() const;
106 
109  virtual void forceUpdate();
110 
112  virtual bool sendVrfObjectData();
113 
115  virtual DtEntityPublisher* entityPublisher();
116 
117 public:
118  // Sets the time to update the vrf data message. The message will
119  // be sent on this time (default is five seconds) or if the data
120  // as seen by remote is different that the current time. If time
121  // is set to be -1, it will only be sent if the data is different
122  static void setVrfDataTimeThreshold(DtTime time);
123  static DtTime vrfDataTimeThreshold();
124 
125 private:
128  DtVrfEntityPublisher& operator=(const DtVrfEntityPublisher&);
129 
130 protected:
132  virtual bool sendVrfDataUpdate();
133 
137  virtual bool needsVrfObjectDataUpdate();
138 
143  virtual bool sendMessage(const DtSimulationAddress& receiver,
144  DtSimInterfaceContent* message);
146  virtual bool setContentForNet(DtDataInteraction* dataInter,
147  DtSimInterfaceContent* content) const;
149  virtual void sendMessageInteraction(const DtSimulationAddress& receiver,
150  DtDataInteraction& data);
151 
152 protected:
155  static void dataInteractionCallback(DtDataInteraction* i, void* usr);
156 
159  virtual void processSendVrfObjectDataMessage(DtDataInteraction* interaction);
160 
161 public:
163  virtual void processDataInteraction(DtDataInteraction* i);
164 
165 protected:
166  DtEntityPublisher* myPublisher;
167 
168  // For heartbeating for DtIfVrfObjectData messages
170  static DtTime theVrfDataTimeThreshold;
171 };
172 
173 #endif

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)