VR-Exchange 2.1 API Documentation
hlaTrans.h
Go to the documentation of this file.
1 /*********************************************************************
2  ** Copyright (c) 2012 VT MAK
3  *********************************************************************/
4 
5 #pragma once
6 
9 #include <hlaBroker/hlaBroker.h>
10 #include <portal/pMacros.h>
11 #include <portal/pMessageKinds.h>
12 #include <hlaBroker/hMacros.h>
13 
14 namespace DtHlaBrokerNamespace = DtVREXCHANGE_NAMESPACE::DtHLA_BROKER_NAMESPACE;
15 
16 // All HLA Translators must have the following template arguments:
17 // The integer define of the DtPortalMessageKind,
18 // The PortalObject this message translates,
19 // The Reflected Portal Object class the message translates
20 // The Reflected HLA Object class
21 // The list class of all reflected ball objects
22 // The state repository class of the HLA Object
23 // The publisher class of the HLA Object
24 #define HLA_TEMPLATE_LIST \
25  template \
26  < class T_PortalObject \
27  , class T_PortalReflectedObject \
28  , class T_HlaReflectedObject \
29  , class T_HlaReflectedObjectList \
30  , class T_HlaObjectStateRepository \
31  , class T_HlaObjectPublisher>
32 
34 class DtHlaTranslator : public DtHlaBrokerNamespace::DtObjectTranslator
35 {
36 public:
37 
38  DtHlaTranslator(class DtHlaBrokerNamespace::DtHlaBroker *broker, MAKVrExchange::DtPortalMessageKind messageKind);
39  virtual ~DtHlaTranslator();
40 
41 private:
42 
43  // Copy Constructor not implemented -- do not copy!
44  DtHlaTranslator(const DtHlaTranslator& other);
45 
46  // Assignment Operator not implemented -- do not copy!
48 
49 public:
50 
51  // Keep the same name as the original translator, this lets us override the class
52  // in the factory.
53  static const char* translatorName() { return "HLA Translator"; };
54 
55  virtual T_PortalObject* translate(
56  T_PortalObject* destination,
57  const T_HlaObjectStateRepository& source,
58  const DtReflectedObject& reflectedObject = *(DtReflectedObject*)NULL ) = 0;
59 
60  virtual T_HlaObjectStateRepository* translate(
61  T_HlaObjectStateRepository* destination,
62  const T_PortalObject& source,
63  const MAKVrExchange::DtPortalReflectedObject& reflectedObject =
65 
67  virtual void enableTranslator(bool enabled);
68 
69  virtual void tick();
70 
71 protected:
72 
73  DT_DECLARE_HLA_CALLBACKS(T_HlaReflectedObject);
74  DT_DECLARE_PORTAL_CALLBACKS(MAKVrExchange::DtHlaBroker,T_PortalReflectedObject);
75 
76 
77 protected:
79  T_HlaReflectedObjectList *myHlaReflectedList;
81 };
82 
83 
84 #define hlaTranslator_INL_
85 #include "hlaTrans.inl"
86 #undef hlaTranslator_INL_
87 
88 
89 

Document ID: Generated on Tue Aug 7 22:07:13 EDT 2012 from SVN revision 117874
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)