SimpleITK
1.1.0
SimpleITK
Code
Common
include
sitkFunctionCommand.h
Go to the documentation of this file.
1
/*=========================================================================
2
*
3
* Copyright Insight Software Consortium
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0.txt
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*=========================================================================*/
18
#ifndef sitkFunctionCommand_h
19
#define sitkFunctionCommand_h
20
21
22
#include "
sitkCommand.h
"
23
24
#include "
nsstd/functional.h
"
25
26
namespace
itk
{
27
namespace
simple {
28
33
class
SITKCommon_EXPORT
FunctionCommand
:
34
public
Command
35
{
36
public
:
37
38
typedef
FunctionCommand
Self
;
39
40
41
virtual
~
FunctionCommand
();
42
43
FunctionCommand
();
44
45
virtual
void
Execute(
void
);
46
50
template
<
class
T>
51
void
SetCallbackFunction
( T *
object
,
void
(T::* pMemberFunction )() )
52
{
53
m_Function = nsstd::bind(pMemberFunction,
object
);
54
}
55
57
void
SetCallbackFunction (
void
(* pFunction )() );
58
64
void
SetCallbackFunction(
void
(* pFunction )(
void
*),
void
*clientData );
65
66
private
:
67
68
typedef
nsstd::function<void()>
FunctionObjectType
;
69
FunctionObjectType
m_Function
;
70
71
};
72
73
}
// end namespace simple
74
}
// end namespace itk
75
76
#endif
itk::simple::FunctionCommand::m_Function
FunctionObjectType m_Function
Definition:
sitkFunctionCommand.h:69
itk::simple::Command
An implementation of the Command design pattern for callback.
Definition:
sitkCommand.h:44
itk::simple::FunctionCommand::SetCallbackFunction
void SetCallbackFunction(T *object, void(T::*pMemberFunction)())
Definition:
sitkFunctionCommand.h:51
itk::simple::FunctionCommand::Self
FunctionCommand Self
Definition:
sitkFunctionCommand.h:38
SITKCommon_EXPORT
#define SITKCommon_EXPORT
Definition:
sitkCommon.h:41
itk::simple::FunctionCommand
A Command class which allows setting an external function, or member function.
Definition:
sitkFunctionCommand.h:33
functional.h
itk
itk::simple::FunctionCommand::FunctionObjectType
nsstd::function< void()> FunctionObjectType
Definition:
sitkFunctionCommand.h:68
sitkCommand.h
Generated on Fri Mar 6 2020 16:06:35 for SimpleITK by
1.8.17