VR-Exchange 2.10 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
translator.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2015 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <broker/dllExport.h>
13 #include <portal/pMessageKinds.h>
14 #include <vlutil/vlString.h>
15 
16 #define Dt_DEF_TRANSLATOR_NAME( strname )\
17  static const DtString& translatorName()\
18  {\
19  static DtString tName = strname;\
20  return tName;\
21  }
22 
23 
24 namespace MAKVrExchange
25 {
26 
27  class DtBroker;
28 
36  {
37 
38  template <typename ProducedType>
39  friend class DtTranslatorFactory;
40 
41  public:
42 
47  DtTranslator( DtBroker* broker, const DtString& name, DtPortalMessageKind kind );
48 
50  virtual ~DtTranslator();
51 
53  virtual DtString name() const;
54 
56  virtual void enableReflectTranslator( bool enabled );
57  virtual void enablePublishTranslator( bool enabled );
58 
59  virtual bool isReflectEnabled() const;
60  virtual bool isPublishEnabled() const;
61 
64 
65  virtual void initializePortalCallbacks() = 0;
66  virtual void removePortalCallbacks() = 0;
67 
69 
71  virtual void shutdown() = 0;
72 
75  virtual void tick() {};
76 
80  inline DtBroker* broker() const { return myBroker; }
81 
82  private:
83 
85  DtTranslator( const DtTranslator& other );
86 
88  DtTranslator& operator = ( const DtTranslator& other );
89 
90  protected:
91 
97 
98  };
99 
100 }
DtBroker * myBroker
Definition: translator.h:94
DtPortalMessageKind myPortalMessageKind
Definition: translator.h:93
bool myPublishEnabled
Definition: translator.h:96
Responsible for converting a specific message type between two protocols.
Definition: translator.h:35
#define DT_DLL_BROKER
Definition: include/broker/dllExport.h:20
DtBroker * broker() const
Broker Accessor.
Definition: translator.h:80
virtual void tick()
Needs to be implemented for every translator, this is called every frame to allow the translator to d...
Definition: translator.h:75
Base class for all broker objects.
Definition: broker.h:58
A factory class for Translators.
Definition: translatorFactory.h:26
Contains the DtPortalMessageKind type enumerations.
DtPortalMessageKind
A List of message kinds distributed with the Portal.
Definition: pMessageKinds.h:23
bool myReflectEnabled
Definition: translator.h:95
DtString myTranslatorName
Definition: translator.h:92

Document ID: Generated on Mon May 25 18:45:12 EDT 2026 from SVN revision 289111
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)