VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfComponentProcessorInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
6 #pragma once
7 
9 #include <tbb/spin_rw_mutex.h>
10 
11 namespace makVrv
12 {
13  class DtSimEntryObjectAgent;
14  class DtSimStateObjectAgent;
15  class DtBaseConnection;
16 }
17 
18 namespace makVrf
19 {
20  class DtSimDataProcessorManager;
21  class DtStateComponent;
22 
24  {
25  public:
26  virtual void createAndSendState(const std::set<const DtFrameStateInterface*>&, makVrv::DtSimStateObjectAgent&,
27  bool force = false) = 0;
28  };
29 
30  template <typename T_Agent, typename T_Component>
32  {
33  public:
34 
37 
39  virtual ~DtVrfComponentProcessor();
40 
41 
45 
48  virtual void queueStateComponentRemoved(const DtStateComponent*);
49 
51  virtual void queueFunction(const boost::function<void ()>& function);
52 
54  virtual bool componentDiscovered(const DtFrameStateInterface*);
55  virtual void componentRemoved(UInt64, const DtFrameStateInterface*);
56 
58  virtual void stateComponentDiscovered(const DtStateComponent*);
60 
61  protected:
62  void setupComponentData();
63 
64  virtual void slot_frameAdvanced();
65  virtual bool shouldForceObjectUpdate(const DtFrameStateInterface*) const;
66  virtual void componentUpdated(const DtFrameStateInterface*);
67 
70 
72 
74 
75  //A Listener and a driver which will be updated with it.
77  {
78  public:
79 
80  ComponentUpdater(const std::set<const DtFrameStateInterface*>& listener,
81  makVrv::DtSimStateObjectAgent& driver,
83  : myFrameStateInterfaces(listener)
84  , myObjectAgent(&driver)
85  , myDataProcessorInterface(&iface)
86  {
87  }
88 
93  {
94  }
95 
97  {
101 
102  return *this;
103  }
104 
105  //Are the updaters equal
106  bool operator==(const ComponentUpdater& orig) const
107  {
108  return (myObjectAgent == orig.myObjectAgent);
109  }
110 
111  void update(double)
112  {
113  if (myFrameStateInterfaces.size() &&
114  (myDataProcessorInterface->vantageIdFromLegionId((*myFrameStateInterfaces.begin())->legionGlobalId()) != 0))
115  {
117  }
118  }
119 
120  protected:
121  std::set<const DtFrameStateInterface*> myFrameStateInterfaces;
122  makVrv::DtSimStateObjectAgent* myObjectAgent;
124  };
125 
126  virtual void dataDiscoveredByLegionId(Legion::UInt64 lid);
127 
128  protected:
132 
134  makVrv::DtSimEntryObjectAgent* mySimEntryAgent;
135 
137  typedef std::map<makVrv::DtSimEntryUpdater::UpdateRate, UpdaterGroup> UpdateGroupMap;
138 
140 
141  typedef std::set<makVrv::DtUniqueID> EntityIdList;
143 
148  {
149  std::set<const DtFrameStateInterface*> myFrameStateInterfaces;
150  makVrv::DtSimStateObjectAgent* myAgent;
152  };
153 
154  typedef std::map<makVrv::DtUniqueID, ComponentInstance> AgentMap;
156 
157  boost::signals2::connection myVantageToLegionIdMapperConnection;
158 
159  std::set<makVrv::DtUniqueID> myAwaitingValidId;
161  tbb::spin_rw_mutex myMutex;
162  };
163 }
makVrv::DtBalancedUpdater< ComponentUpdater > UpdaterGroup
Definition: vrfComponentProcessorInterface.h:136
DtSimDataProcessorManager * mySimDataProcessorManager
Definition: vrfComponentProcessorInterface.h:160
makVrv::DtSimStateObjectAgent * myObjectAgent
Definition: vrfComponentProcessorInterface.h:122
virtual void componentRemoved(UInt64, const DtFrameStateInterface *)
DtSimDataProcessorManager * simDataProcessorManager()
In theory, the state data should have a big blob of data for all components – the state data entries ...
Definition: vrfComponentProcessorInterface.h:147
UpdateRate
Definition: DtSimEntryUpdater.h:31
makVrv::DtBaseConnection & mySimulation
Definition: vrfComponentProcessorInterface.h:131
virtual void queueStateComponentRemoved(const DtStateComponent *)
virtual makVrv::DtUniqueID vantageIdFromLegionId(Legion::UInt64) const
This class will manage the data processors. It will be the spot that the data processors can post mes...
Definition: simDataProcessorManager.h:25
DtStateDataManager * myStateDataManager
Definition: vrfComponentProcessorInterface.h:129
std::set< const DtFrameStateInterface * > myFrameStateInterfaces
Definition: vrfComponentProcessorInterface.h:149
std::set< makVrv::DtUniqueID > myAwaitingValidId
Definition: vrfComponentProcessorInterface.h:159
virtual makVrv::DtUniqueID idForStateComponent(const DtFrameStateInterface *)
makVrv::DtSimEntryObjectAgent * mySimEntryAgent
Definition: vrfComponentProcessorInterface.h:134
makVrv::DtSignalConnectionManager myConnectionManager
Definition: vrfComponentProcessorInterface.h:130
Definition: vrfDataProcessorInterface.h:35
virtual void forceObjectUpdate(makVrv::DtUniqueID)
The DtBaseConnection is an abstract class.
Definition: DtBaseConnection.h:39
bool operator==(const ComponentUpdater &orig) const
Definition: vrfComponentProcessorInterface.h:106
virtual bool componentDiscovered(const DtFrameStateInterface *)
Creates/removes agents for data.
makVrv::DtSimEntryUpdater::UpdateRate myRate
Definition: vrfComponentProcessorInterface.h:151
tbb::spin_rw_mutex myMutex
Definition: vrfComponentProcessorInterface.h:161
std::set< const DtFrameStateInterface * > myFrameStateInterfaces
Definition: vrfComponentProcessorInterface.h:121
virtual ~DtVrfComponentProcessor()
DTOR.
virtual void queueFunction(const boost::function< void()> &function)
Put a function in the sim function queue, for threadsafe calling.
ComponentUpdater(const ComponentUpdater &orig)
Definition: vrfComponentProcessorInterface.h:89
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
unsigned long long UInt64
Definition: stateDataTypes.h:17
DtBalanacedUpdater updates updatee classes at a desired rate in a fair (each instance gets the same n...
Definition: DtBalancedUpdater.h:26
virtual bool shouldForceObjectUpdate(const DtFrameStateInterface *) const
void update(double)
Definition: vrfComponentProcessorInterface.h:111
DtTimedSection myTimer
Definition: vrfComponentProcessorInterface.h:133
ComponentUpdater(const std::set< const DtFrameStateInterface * > &listener, makVrv::DtSimStateObjectAgent &driver, DtComponentProcessorInterface &iface)
Definition: vrfComponentProcessorInterface.h:80
Definition: stateComponent.h:51
virtual void dataDiscoveredByLegionId(Legion::UInt64 lid)
#define DT_DLL_vrfGuiNetworkCommon
This file is used to determine how to build.
Definition: vrfGuiNetworkCommonDefines.h:24
UpdateGroupMap myRefreshRateGroups
Definition: vrfComponentProcessorInterface.h:139
makVrv::DtSimStateObjectAgent * myAgent
Definition: vrfComponentProcessorInterface.h:150
virtual void vantageIdMapped(makVrv::DtUniqueID, Legion::UInt64)
virtual void componentUpdated(const DtFrameStateInterface *)
virtual void setObjectUpdateRate(makVrv::DtUniqueID uniqueId, makVrv::DtSimEntryUpdater::UpdateRate rate)
Set a particular object update.
virtual void createAndSendState(const std::set< const DtFrameStateInterface * > &, makVrv::DtSimStateObjectAgent &, bool force=false)=0
EntityIdList myForceUpdateList
Definition: vrfComponentProcessorInterface.h:142
std::map< makVrv::DtSimEntryUpdater::UpdateRate, UpdaterGroup > UpdateGroupMap
Definition: vrfComponentProcessorInterface.h:137
boost::signals2::connection myVantageToLegionIdMapperConnection
Definition: vrfComponentProcessorInterface.h:157
virtual void stateComponentDiscovered(const DtStateComponent *)
Calls DtFrameStateInterface versions.
virtual void stateComponentRemoved(UInt64, const DtFrameStateInterface *)
AgentMap myAgents
Definition: vrfComponentProcessorInterface.h:155
std::map< makVrv::DtUniqueID, ComponentInstance > AgentMap
Definition: vrfComponentProcessorInterface.h:154
virtual void queueStateComponentDiscovered(const DtStateComponent *)
Call this method to queue a state component discovered or removed.
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:282
DtVrfComponentProcessor(DtStateDataManager *, makVrv::DtBaseConnection &)
CTOR.
Definition: vrfComponentProcessorInterface.h:76
virtual makVrv::DtUniqueID vantageIdFromLegionId(Legion::UInt64 lid) const =0
Definition: vrfComponentProcessorInterface.h:23
ComponentUpdater & operator=(const ComponentUpdater &orig)
Definition: vrfComponentProcessorInterface.h:96
DtComponentProcessorInterface * myDataProcessorInterface
Definition: vrfComponentProcessorInterface.h:123
Definition: vrfComponentProcessorInterface.h:31
This class holds the state data that represents each simulation object in the system.
Definition: stateDataManager.h:71
std::set< makVrv::DtUniqueID > EntityIdList
Definition: vrfComponentProcessorInterface.h:141

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)