VR-Exchange 2.1 API Documentation
disBroker/translatorFactory.h
Go to the documentation of this file.
1 /*********************************************************************
2  ** Copyright (c) 1992-2010 VT MAK
3  ** All rights reserved.
4  *********************************************************************/
5 
6 #ifndef translatorFactory_H_
7 #define translatorFactory_H_
8 
12 
13 #include "objectTrans.h"
14 #include "interactionTrans.h"
15 
16 #include <map>
17 #include <vlutil/vlPrint.h>
18 #include <vlutil/vlString.h>
19 
20 namespace MAKVrExchange { namespace DtDisBroker {
21 
22 class DtDisBroker;
23 
27 //
30 template <typename ProducedType>
32 {
33 public:
34 
35  typedef ProducedType* (*DtObjectTranslatorCreatorFunction)(DtDisBroker *);
36 
37 public:
38 
41 
43  virtual ~DtTranslatorFactory();
44 
45 private:
46 
49 
52 
53 
54 public:
55 
56 
59  ProducedType *createInstance(const DtString &transName, DtDisBroker *broker) const;
60 
61 
64  template<typename T>
65  void removeCreator();
66 
69  void removeCreator(const DtString& translatorName);
70 
72  void removeAllCreators();
73 
77  template<typename T>
78  void addCreator();
79 
82  template<typename T>
83  void addCreator(const DtString& translatorName, DtObjectTranslatorCreatorFunction fn);
84 
86  std::set<DtString> creatorNames() const;
87 
88 protected:
89 
91  template <typename T>
92  static ProducedType *instanceFactory(DtDisBroker *broker);
93 
94 protected:
95 
96  typedef std::map<DtString, DtObjectTranslatorCreatorFunction> StringOtcMap;
97 
98 protected:
99 
101 };
102 
105 
108 
109 }}
110 
111 #define translatorFactory_INL_
112 #include "translatorFactory.inl"
113 #undef translatorFactory_INL_
114 
115 #endif //end #ifndef translatorFactory_H_

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)