WebLVC 1.7d API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rprBroker/rprBroker/entityTranslator.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2017 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
13 #include <vl/reflectedEntityList.h>
14 #include <vl/entityPublisher.h>
15 #include <map>
16 
17 class DtReflectedEntity;
18 class DtReflectedEntityList;
19 class DtReflectedDIGuyObject;
20 class DtEntityStateRepository;
21 class DtReflectedDIGuyObjectList;
22 class DtDIGuyObjectStateRepository;
23 
24 #define ENTITY_TEMPLATE_ARGS \
25  DtPortalEntity, DtPortalReflectedEntity, \
26  DtReflectedEntity, DtReflectedEntityList, \
27  DtEntityStateRepository, DtEntityPublisher
28 
29 namespace MAKVrExchange
30 {
31 
32  class DtPortalEntity;
33 
34  namespace DtRprBroker
35  {
36 
39  template <>
40  DT_DLL_RPRBROKER DtEntityPublisher*
42  const DtPortalReflectedEntity* refObj, const DtString& name );
43 
47  : public DtRprObjectTranslator<ENTITY_TEMPLATE_ARGS>
48  {
49  public:
50 
52  Dt_DEF_TRANSLATOR_NAME( "Entity State" );
53 
55  DtEntityTranslator( DtBroker* broker );
56 
58  virtual ~DtEntityTranslator();
59 
63 
64  virtual void initializePortalCallbacks();
65  virtual void removePortalCallbacks();
66 
68 
69  virtual void tick();
70 
71  protected:
72 
75 
78  static bool portalDiGuyDiscoveryCriteria( const DtPortalReflectedObject* object, void* usr );
79 
81  static void portalDiGuyAddedCb( const DtPortalReflectedDiGuy& obj, void* usr );
82 
84  static void portalDiGuyUpdatedCb( const DtPortalReflectedDiGuy& obj, void* usr );
85 
87  static void portalDiGuyDeletedCb( const DtPortalReflectedDiGuy& obj, void* usr );
88 
90 
93 
95  virtual bool isPortalPublishable( const DtBrokerObject* brokerObj );
96 
98 
101 
103  virtual void discoverRprObject( DtReflectedEntity& refObj );
104 
108  virtual bool isRprPublishable( DtBrokerObject* brokerObj,
109  const DtPortalReflectedEntity* refObj );
110 
114  virtual void discoverPortalObject( const DtPortalReflectedEntity& refObj );
115 
118  virtual void discoverPortalDiGuy( const DtPortalReflectedDiGuy& obj );
119 
121  virtual void receivePortalDiGuyUpdate( const DtPortalReflectedDiGuy& obj );
122 
125  virtual void updateRprBrokerObject( DtBrokerObject* brokerObj,
126  const DtEntityStateRepository& sr );
127 
130  virtual void updatePortalBrokerObject( DtBrokerObject* brokerObj,
131  const DtPortalEntity& sr );
132 
135  virtual void updateFilteredState( DtBrokerObject* brokerObj,
136  DtPortalEntityPublisher* publisher, DtReflectedEntity* refObj );
137 
144  virtual void updateFilteredState( DtBrokerObject* brokerObj,
145  const DtPortalReflectedEntity* refObj );
146 
150  virtual DtString rprObjectName( const DtPortalReflectedEntity* refObj ) const;
151 
154  virtual void fillOutgoingIds( DtEntityPublisher* publisher,
155  const DtString& name );
156 
159  virtual void createRprPublisher( DtBrokerObject* brokerObject );
160 
163  virtual void removeRprObject( const DtReflectedObject& refObj );
164 
167  virtual void removePortalObject( const DtPortalReflectedEntity& reflectedObj );
168 
170  virtual void removePortalDiGuy( const DtPortalReflectedDiGuy& obj );
171 
173 
176 
179  virtual bool hasDiGuyAttributes( const DtEntityStateRepository& entity );
180 
182  virtual void syncRprArtParts( DtBrokerObject* brokerObject );
183 
185  virtual void syncRprDeadReckonedValues( DtBrokerObject* brokerObject );
186 
188  virtual void syncPortalDeadReconedValues( DtBrokerObject* brokerObject );
189 
191  virtual DtEntityStateRepository* translate(
192  DtEntityStateRepository* destination, const DtPortalEntity& source,
193  const DtPortalReflectedEntity& refObj );
194 
196  virtual DtPortalEntity* translate( DtPortalEntity* destination,
197  const DtEntityStateRepository& source, const DtReflectedEntity& refObj );
198 
200  virtual DtPortalDiGuy* translate( DtPortalDiGuy* destination,
201  const DtEntityStateRepository& source );
202 
204  virtual DtEntityStateRepository* translate(
205  DtEntityStateRepository* destination, const DtPortalDiGuy& source );
206 
208  protected:
209 
210  typedef std::map<DtEntityIdentifier,DtBrokerObject*> EntityByEntityIdMap;
213 
214  typedef std::map<DtEntityIdentifier,const DtPortalReflectedDiGuy*> DiGuyWaitList;
216 
217  typedef std::map<DtEntityIdentifier,DtPortalDiGuyPublisher*> PortalDiGuyPublisherMap;
219 
221 
222  };
223 
224  }
225 }
Manages collections of ReflectedObjects of Type T_ReflectedObject.
Definition: pReflectedObjectManager.h:38
Provides container to hold pointers to Protocol/Portal objects.
Definition: brokerObject.h:24
std::map< DtEntityIdentifier, DtBrokerObject * > EntityByEntityIdMap
Definition: rprBroker/rprBroker/entityTranslator.h:210
Provides Entity State object translation between HLA and the VR-Exchange Portal.
Definition: rprBroker/rprBroker/entityTranslator.h:46
PortalDiGuyPublisherMap myPortalDiGuyPublisherMap
Definition: rprBroker/rprBroker/entityTranslator.h:218
A simple template class to hold different types of State Repositories.
Definition: pObjectPublisher.h:68
An abstract interface for reflected objects.
Definition: pReflectedObject.h:31
Base class for all RPR object translators.
Definition: rprTranslator.h:93
virtual T_RprObjectPublisher * instantiateRprPublisher(const T_PortalReflectedObject *refObj, const DtString &name)
Instantiates the publisher for the given reflected object.
std::map< DtEntityIdentifier, DtPortalDiGuyPublisher * > PortalDiGuyPublisherMap
Definition: rprBroker/rprBroker/entityTranslator.h:217
Base class for all broker objects.
Definition: broker.h:58
A template to create reflected object types for each type of object message.
Definition: pReflectedObject.h:58
DiGuyWaitList myDiGuyWaitList
Definition: rprBroker/rprBroker/entityTranslator.h:215
DtPortalReflectedObjectTemplate< DtPortalEntity > DtPortalReflectedEntity
An Entity Reflected Object template instance.
Definition: pReflectedObjectTypes.h:84
EntityByEntityIdMap myPortalEntityByEntityIdMap
Definition: rprBroker/rprBroker/entityTranslator.h:211
Contains the DtRprObjectTranslator and DtRprInteractionTranslator base classes.
#define DT_DLL_RPRBROKER
Definition: brokers/rprBroker/rprBroker/dllExport.h:22
#define Dt_DEF_TRANSLATOR_NAME(strname)
Definition: translator.h:16
EntityByEntityIdMap myHlaEntityByEntityIdMap
Definition: rprBroker/rprBroker/entityTranslator.h:212
std::map< DtEntityIdentifier, const DtPortalReflectedDiGuy * > DiGuyWaitList
Definition: rprBroker/rprBroker/entityTranslator.h:214
Messages which represent DI-Guys with state.
Definition: pDiGuy.h:29
DtPortalReflectedDiGuyManager * myPortalReflectedDiGuyManager
Definition: rprBroker/rprBroker/entityTranslator.h:220
Messages which represent Entities with state.
Definition: pEntity.h:26

Document ID: Generated on Wed Jun 21 15:05:44 EDT 2023 from SVN revision 256253
Copyright © 2005-2023 MAK Technologies. All Rights Reserved (www.mak.com)