VR-Exchange 2.7 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sEntityTrans.h
Go to the documentation of this file.
1 /*********************************************************************
2  ** Copyright (c) 2005 VT MAK
3  *********************************************************************/
4 #pragma once
5 
6 // Classes can not be forward declared because they are templated
7 #include <portal/pEntity.h>
10 
11 // Class Forwards
12 class DtExerciseConn;
13 class DtReflectedObject;
14 class DtReflectedEntityList;
15 class DtReflectedEntity;
16 class DtEntityPublisher;
17 
18 namespace MAKVrExchange {
19 class DtPortalConnection;
20 }
21 
22 // A helper class responsible for the translation of Entity State PDUs to
23 // Entity Data Exchange (portal) objects. This is not the same class (or even
24 // close to) the same class in the HLA Broker. This simple class is provided
25 // to show the VR-Exchange API. It does not actually translate DIS entities
26 // in any useful way.
28 {
29 
30 public:
31 
32  // Default CTOR, takes a reference to the disConn and the PortalConnection
33  DtEntityTranslator(DtExerciseConn& disConn, MAKVrExchange::DtPortalConnection& portalConn);
34 
35  // Default DTOR
36  virtual ~DtEntityTranslator();
37 
38  // Process any required updates
39  virtual void tick();
40 
41  // Process discover messages from DIS
42  virtual void discoverDisObject(const DtReflectedEntity &obj);
43  // Process discover messages from the Portal
45 
46  // Process updates from DIS
47  virtual void receiveDisUpdate(const DtReflectedEntity &obj);
48  // Process updates from the Portal
50 
51  // process removal messages from DIS
52  virtual void processDisRemoval(const DtReflectedEntity &obj);
53  // process removal messages from the Portal
55 
56 protected:
57  // A function which is called to find out if this DIS object is fit to be
58  // discovered, and hence published.
59  static bool disDiscoveryCriteria(DtReflectedObject* obj, void *usr);
60 
61  // A function which is called to find out if this Portal object is fit to be
62  // discovered, and hence published.
63  static bool portalDiscoveryCriteria(
64  const MAKVrExchange::DtPortalReflectedObject *obj, void *usr);
65 
66  static void disObjectAddedCb(DtReflectedEntity *obj, void *usrData);
67  static void disObjectUpdatedCb(DtReflectedEntity *obj, void *usrData);
68  static void disObjectDeletedCb(DtReflectedEntity *obj, void *usrData);
69 
70  static void portalObjectAddedCb(const MAKVrExchange::DtPortalReflectedEntity& obj, void *usrData);
71  static void portalObjectUpdatedCb(const MAKVrExchange::DtPortalReflectedEntity& obj, void *usrData);
72  static void portalObjectDeletedCb(const MAKVrExchange::DtPortalReflectedEntity& obj, void *usrData);
73 
74 private:
75 
76  // A connection to the portal exercise connection and the DIS (VR-Link)
77  // exercise connection
78  DtExerciseConn &myDisConn;
80 
81  // Pointers to reflected lists, or containers of reflected objects.
82  DtReflectedEntityList *myDisReflectedList;
84 
85  DtEntityPublisher *myDisEntityPublisher;
87 
88 
89 };
Contains the templated DtPortalReflectedObjectManager types.
Manages collections of ReflectedObjects of Type T_ReflectedObject.
Definition: pReflectedObjectManager.h:38
virtual ~DtEntityTranslator()
MAKVrExchange::DtPortalEntityPublisher * myPortalEntityPublisher
Definition: sEntityTrans.h:86
static void portalObjectUpdatedCb(const MAKVrExchange::DtPortalReflectedEntity &obj, void *usrData)
Definition: sEntityTrans.h:27
virtual void discoverDisObject(const DtReflectedEntity &obj)
virtual void processDisRemoval(const DtReflectedEntity &obj)
virtual void discoverPortalObject(const MAKVrExchange::DtPortalReflectedEntity &obj)
A simple template class to hold different types of State Repositories.
Definition: pObjectPublisher.h:68
DtReflectedEntityList * myDisReflectedList
Definition: sEntityTrans.h:82
An abstract interface for reflected objects.
Definition: pReflectedObject.h:31
virtual void processProtalRemoval(const MAKVrExchange::DtPortalReflectedEntity &obj)
static bool portalDiscoveryCriteria(const MAKVrExchange::DtPortalReflectedObject *obj, void *usr)
static void portalObjectDeletedCb(const MAKVrExchange::DtPortalReflectedEntity &obj, void *usrData)
MAKVrExchange::DtPortalConnection & myPortalConn
Definition: sEntityTrans.h:79
DtExerciseConn & myDisConn
Definition: sEntityTrans.h:78
static void disObjectAddedCb(DtReflectedEntity *obj, void *usrData)
virtual void tick()
A template to create reflected object types for each type of object message.
Definition: pReflectedObject.h:58
Contains the DtPortalEntity class declaration.
static void disObjectUpdatedCb(DtReflectedEntity *obj, void *usrData)
MAKVrExchange::DtPortalReflectedEntityManager * myPortalReflectedManager
Definition: sEntityTrans.h:83
DtEntityTranslator(DtExerciseConn &disConn, MAKVrExchange::DtPortalConnection &portalConn)
Template Instances of DtPortalObjectPublisherTemplate.
static void portalObjectAddedCb(const MAKVrExchange::DtPortalReflectedEntity &obj, void *usrData)
DtEntityPublisher * myDisEntityPublisher
Definition: sEntityTrans.h:85
Connects a broker to the Portal Data Exchange.
Definition: pConnection.h:49
virtual void receivePortalUpdate(const MAKVrExchange::DtPortalReflectedEntity &obj)
static void disObjectDeletedCb(DtReflectedEntity *obj, void *usrData)
virtual void receiveDisUpdate(const DtReflectedEntity &obj)
static bool disDiscoveryCriteria(DtReflectedObject *obj, void *usr)

Document ID: Generated on Mon Apr 19 15:55:22 EDT 2021 from SVN revision 227909
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)