VR-Forces 4.1 Class Documentation
DtEntitySimDataProcessor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtVrlinkEntitySimDataProcessor.h,v $ $Revision: 1.12 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtVrlinkEntitySimDataProcessor_H_
14 #define DtVrlinkEntitySimDataProcessor_H_
15 
16 #include <vrvVrl/vrvVrl.h>
18 #include <vrvCore/DtEntityState.h>
22 
23 #include <vlutil/vlPerformanceStats.h>
24 
25 #include <boost/bind.hpp>
26 
27 #ifndef DT_PROTOCOL_NAMESPACE
28 #error Namespace Protocol Macro DT_PROTOCOL_NAMESPACE not defined.
29 #endif
30 
31 namespace makVrv
32 {
33  class DtEntityStateObjectAgent;
34  class DtSimEntryObjectAgent;
35  class DtEntityStateListener;
36 
37  namespace DT_PROTOCOL_NAMESPACE
38  {
39  class DtEntityExistenceListener;
41 
45  {
46  public:
47 
49  static DtEntitySimDataProcessor* findInstance(DtVrlinkConnection& sim);
50 
52  static void registerInstance(DtVrlinkConnection& sim,DtEntitySimDataProcessor*);
53 
56 
58  virtual ~DtEntitySimDataProcessor();
59 
61  void postDrainInput();
62 
64  void setObjectUpdateRate(DtUniqueID uniqueId, DtSimEntryUpdater::UpdateRate rate);
65 
67  void forceObjectUpdate(DtUniqueID uniqueId);
68 
70  void entityDiscovered(DtVrlinkEntityStateListener& listener);
71 
73  void entityToBeDeleted(DtEntityStateListener& listener);
74 
76  virtual void createAndSendState(DtEntityStateListener& listener,
77  DtEntityStateObjectAgent& objectDriver);
78 
79  protected:
80 
82  static void postDrainInput(void* usr);
83  virtual void slot_postUpdateCallback(DtEntityStateListener&);
84  virtual void setState(DtVrlinkEntityStateListener& listener, DtVrlinkSimulatedEntityState& state);
85 
86  protected:
87 
88  //A Listener and a driver which will be updated with it.
90  {
91  public:
92 
94  DtEntityStateObjectAgent& driver, DtEntitySimDataProcessor& processor);
95 
97 
98  EntityStateUpdater& operator=(const EntityStateUpdater& orig);
99 
100  //Are the updaters equal
101  bool operator==(const EntityStateUpdater& orig) const;
102 
104  void update(double timeT);
105 
106  protected:
107 
109  DtEntityStateObjectAgent* myObjectAgent;
111  };
112 
113  typedef std::vector<DtUniqueID> EntityIdList;
114 
116  {
118  DtEntityStateObjectAgent* myAgent;
120  };
121 
122  typedef std::map<DtUniqueID,EntitySimDataInstance > EntityAgentMap;
123 
125  typedef std::map<DtSimEntryUpdater::UpdateRate,EntityUpdaterGroup>
127 
128  protected:
129 
131 
134  DtTimedSection myTimer;
135  DtSimEntryObjectAgent* mySimEntryAgent;
136 
140 
141  };
142  }
143 }
144 
145 #endif
146 

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)