VR-Exchange 2.1 API Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
include
disBroker
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>
31
class
DtTranslatorFactory
32
{
33
public
:
34
35
typedef
ProducedType* (*DtObjectTranslatorCreatorFunction)(
DtDisBroker
*);
36
37
public
:
38
40
DtTranslatorFactory
();
41
43
virtual
~DtTranslatorFactory
();
44
45
private
:
46
48
DtTranslatorFactory
(
const
DtTranslatorFactory
& other);
49
51
DtTranslatorFactory
&
operator=
(
const
DtTranslatorFactory
& other);
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
100
StringOtcMap
myNamedCreatorMap
;
101
};
102
104
typedef
DtTranslatorFactory<DtObjectTranslator>
DtObjectTranslatorFactory
;
105
107
typedef
DtTranslatorFactory<DtInteractionTranslator>
DtInteractionTranslatorFactory
;
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
)