MAK Data Logger API Documentation for DIS
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
libsrc
lgrCmds
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
#pragma once
12
13
// No export declaration as these classes are inline and templates.
14
#include <vlutil/vlSmartPointers.h>
15
16
namespace
MAKLogger
17
{
18
22
class
DtCommandFunctor
23
{
24
public
:
26
DtCommandFunctor
() {};
28
virtual
~DtCommandFunctor
() {}
30
virtual
DtResponse
operator()
(
const
DtCommand
& command) = 0;
31
};
32
36
class
DtResponseFunctor
37
{
38
public
:
40
DtResponseFunctor
() {};
42
virtual
~DtResponseFunctor
(){}
44
virtual
void
operator()
(
DtResponse
command) = 0;
45
};
46
47
49
typedef
DtBoost::shared_ptr<DtCommandFunctor>
DtCommandFunctorSP
;
50
typedef
DtBoost::shared_ptr<DtResponseFunctor>
DtResponseFunctorSP
;
51
52
55
56
template
<
typename
T>
57
class
DtLgrCommandHandlerFunctor
:
public
DtCommandFunctor
58
{
59
public
:
61
typedef
DtResponse
(T::*
ProcCmdFunction
)(
const
DtCommand
& command);
62
77
DtLgrCommandHandlerFunctor
(T*
object
,
ProcCmdFunction
function
);
78
80
virtual
~DtLgrCommandHandlerFunctor
();
81
84
virtual
DtResponse
operator()
(
const
DtCommand
& command);
85
86
protected
:
88
T*
myObject
;
90
ProcCmdFunction
myFunction
;
91
};
92
95
96
template
<
typename
T>
97
class
DtCommandInterfaceFunctor
:
public
DtResponseFunctor
98
{
99
public
:
101
typedef
void (T::*
ProcCmdFunction
)(
DtResponse
command);
102
117
DtCommandInterfaceFunctor
(T*
object
,
ProcCmdFunction
function
);
118
119
121
virtual
~DtCommandInterfaceFunctor
();
122
125
virtual
void
operator()
(
DtResponse
command);
126
127
protected
:
129
T*
myObject
;
131
ProcCmdFunction
myFunction
;
132
};
133
136
template
<
typename
T>
137
DtCommandFunctorSP
createHandler
(T*
const
object
,
138
typename
DtLgrCommandHandlerFunctor<T>::ProcCmdFunction
function
);
139
142
template
<
typename
T>
143
DtResponseFunctorSP
createHandler
(T*
const
object
,
144
typename
DtCommandInterfaceFunctor<T>::ProcCmdFunction
function
);
145
146
#define lgrCommandFunctor_inl_
147
#include "lgrCommandFunctor.inl"
148
#undef lgrCommandFunctor_inl_
149
150
}
Document ID: Generated on Mon Jan 19 08:20:14 EST 2015 from SVN revision 149581
Copyright © 2005-2012 VT MÄK. All Rights Reserved (
www.mak.com
)