MAK Data Logger API Documentation for DIS
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
libsrc
lgrCore
lgrCommandFunctor.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 1992-2010 VT MAK
3
** All rights reserved.
4
******************************************************************************/
5
10
11
#ifndef lgrCommandFunctor_H_
12
#define lgrCommandFunctor_H_
13
14
#include <vlutil/vlSmartPointers.h>
15
16
namespace
MAKLogger
17
{
18
22
class
DT_DLL_LGRCORE
DtCommandFunctor
23
{
24
public
:
26
virtual
~DtCommandFunctor
() {}
28
virtual
DtResponse
operator()(
const
DtCommand
& command) = 0;
29
};
30
34
class
DT_DLL_LGRCORE
DtResponseFunctor
35
{
36
public
:
38
virtual
~DtResponseFunctor
(){}
40
virtual
void
operator()(
DtResponse
command) = 0;
41
};
42
43
45
typedef
DtBoost::shared_ptr<DtCommandFunctor>
DtCommandFunctorSP
;
46
typedef
DtBoost::shared_ptr<DtResponseFunctor>
DtResponseFunctorSP
;
47
48
51
52
template
<
typename
T>
53
class
DtLgrCommandHandlerFunctor
:
public
DtCommandFunctor
54
{
55
public
:
57
typedef
DtResponse
(T::*
ProcCmdFunction
)(
const
DtCommand
& command);
58
73
DtLgrCommandHandlerFunctor
(T*
object
,
ProcCmdFunction
function
);
74
76
virtual
~DtLgrCommandHandlerFunctor
();
77
80
virtual
DtResponse
operator()
(
const
DtCommand
& command);
81
82
protected
:
84
T*
myObject
;
86
ProcCmdFunction
myFunction
;
87
};
88
91
92
template
<
typename
T>
93
class
DtCommandInterfaceFunctor
:
public
DtResponseFunctor
94
{
95
public
:
97
typedef
void (T::*
ProcCmdFunction
)(
DtResponse
command);
98
113
DtCommandInterfaceFunctor
(T*
object
,
ProcCmdFunction
function
);
114
115
117
virtual
~DtCommandInterfaceFunctor
();
118
121
virtual
void
operator()
(
DtResponse
command);
122
123
protected
:
125
T*
myObject
;
127
ProcCmdFunction
myFunction
;
128
};
129
132
template
<
typename
T>
133
DtCommandFunctorSP
createHandler
(T*
const
object
,
134
typename
DtLgrCommandHandlerFunctor<T>::ProcCmdFunction
function
);
135
138
template
<
typename
T>
139
DtResponseFunctorSP
createHandler
(T*
const
object
,
140
typename
DtCommandInterfaceFunctor<T>::ProcCmdFunction
function
);
141
142
#define lgrCommandFunctor_inl_
143
#include "lgrCommandFunctor.inl"
144
#undef lgrCommandFunctor_inl_
145
146
}
147
148
#endif
149
Document ID: Generated on Thu Apr 11 12:13:00 EDT 2013 from SVN revision 126011
Copyright © 2005-2012 VT MÄK. All Rights Reserved (
www.mak.com
)