VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtEntitySimDataProcessor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef DtVrlinkEntitySimDataProcessor_H_
11 #define DtVrlinkEntitySimDataProcessor_H_
12 
13 #include <vrvVrl/vrvVrl.h>
15 #include <vrvCore/DtEntityState.h>
19 
20 #include <vlutil/vlPerformanceStats.h>
21 
22 #include <boost/bind.hpp>
23 
24 #ifndef DT_PROTOCOL_NAMESPACE
25 #error Namespace Protocol Macro DT_PROTOCOL_NAMESPACE not defined.
26 #endif
27 
28 namespace makVrv
29 {
30  class DtEntityStateObjectAgent;
31  class DtSimEntryObjectAgent;
32  class DtEntityStateListener;
33 
34  namespace DT_PROTOCOL_NAMESPACE
35  {
36  class DtEntityExistenceListener;
38 
42  {
43  public:
44 
46  static DtEntitySimDataProcessor* findInstance(DtVrlinkConnection& sim);
47 
49  static void registerInstance(DtVrlinkConnection& sim,DtEntitySimDataProcessor*);
50 
53 
55  virtual ~DtEntitySimDataProcessor();
56 
58  void postDrainInput();
59 
61  virtual void setObjectUpdateRate(DtUniqueID uniqueId, DtSimEntryUpdater::UpdateRate rate);
62 
64  virtual void forceObjectUpdate(DtUniqueID uniqueId);
65 
67  void entityDiscovered(DtVrlinkEntityStateListener& listener);
68 
70  void entityToBeDeleted(DtEntityStateListener& listener);
71 
73  virtual void createAndSendState(DtEntityStateListener& listener,
74  DtEntityStateObjectAgent& objectDriver);
75 
76  protected:
77 
79  static void postDrainInput(void* usr);
80  virtual void slot_postUpdateCallback(DtEntityStateListener&);
81  virtual void setState(DtVrlinkEntityStateListener& listener, DtVrlinkSimulatedEntityState& state);
82 
83  protected:
84 
85  //A Listener and a driver which will be updated with it.
87  {
88  public:
89 
91  DtEntityStateObjectAgent& driver, DtEntitySimDataProcessor& processor);
92 
94 
95  EntityStateUpdater& operator=(const EntityStateUpdater& orig);
96 
97  //Are the updaters equal
98  bool operator==(const EntityStateUpdater& orig) const;
99 
101  void update(double timeT);
102 
103  protected:
104 
106  DtEntityStateObjectAgent* myObjectAgent;
108  };
109 
110  typedef std::vector<DtUniqueID> EntityIdList;
111 
113  {
115  DtEntityStateObjectAgent* myAgent;
117  };
118 
119  typedef std::map<DtUniqueID,EntitySimDataInstance > EntityAgentMap;
120 
122  typedef std::map<DtSimEntryUpdater::UpdateRate,EntityUpdaterGroup>
124 
125  protected:
126 
128 
131  DtTimedSection myTimer;
132  DtSimEntryObjectAgent* mySimEntryAgent;
133 
137 
138  };
139  }
140 }
141 
142 #endif
143 

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)