VR-Exchange 2.4 API Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
portal
pMessageFactory.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1992-2010 VT MAK
3
** All rights reserved.
4
*********************************************************************/
5
6
#ifndef pMessageFactory_H_
7
#define pMessageFactory_H_
8
12
13
14
#include <
portal/pMessage.h
>
15
16
namespace
MAKVrExchange
{
17
21
//
26
class
DT_DLL_LIBPORTAL
DtPortalMessageFactory
27
{
28
public
:
29
30
DtPortalMessageFactory
();
31
virtual
~
DtPortalMessageFactory
();
32
33
private
:
34
36
DtPortalMessageFactory
(
const
DtPortalMessageFactory
&);
37
39
DtPortalMessageFactory
& operator=(
const
DtPortalMessageFactory
&);
40
41
public
:
42
47
DtPortalMessage
*create(
const
void
*message)
const
;
48
57
template
<
typename
T_Message>
58
void
registerCreator(
const
T_Message &msg);
59
60
61
typedef
DtPortalMessage
*(*ShmMessageCreator)();
62
void
registerCreator(
const
DtPortalMessageKind
& kind,
63
const
ShmMessageCreator& creator );
64
65
66
protected
:
67
68
typedef
std::map<DtPortalMessageKind, ShmMessageCreator>
KindCreateFunctionMap
;
69
KindCreateFunctionMap
myCreatorFunctionMap
;
70
};
71
72
template
<
typename
T_Message>
73
inline
void
DtPortalMessageFactory::registerCreator
(
const
T_Message &)
74
{
75
myCreatorFunctionMap
[T_Message::theKind] =
T_Message::create
;
76
}
77
78
inline
void
DtPortalMessageFactory::registerCreator
(
const
DtPortalMessageKind
& kind,
79
const
ShmMessageCreator& creator )
80
{
81
myCreatorFunctionMap
[kind] = creator;
82
}
83
84
85
}
86
87
#endif //end #ifndef pMessageFactory_H_
Document ID: Generated on Thu Jul 23 10:25:22 EDT 2015 from SVN revision 155065
Copyright © 2005-2014 VT MÄK. All Rights Reserved (
www.mak.com
)