cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstMultiTask
mtsCallableVoidFunction.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4
/*
5
6
Author(s): Anton Deguet
7
Created on: 2010-09-26
8
9
(C) Copyright 2010 Johns Hopkins University (JHU), All Rights
10
Reserved.
11
12
--- begin cisst license - do not edit ---
13
14
This software is provided "as is" under an open source license, with
15
no warranty. The complete license can be found in license.txt and
16
http://www.cisst.org/cisst/license.txt.
17
18
--- end cisst license ---
19
*/
20
21
#ifndef _mtsCallableVoidFunction_h
22
#define _mtsCallableVoidFunction_h
23
28
35
class
mtsCallableVoidFunction:
public
mtsCallableVoidBase
{
36
37
public
:
38
typedef
mtsCallableVoidBase
BaseType
;
39
41
typedef
mtsCallableVoidFunction
ThisType
;
42
44
typedef
void(*
ActionType
)(void);
45
46
private
:
48
inline
mtsCallableVoidFunction
(
const
ThisType
&
CMN_UNUSED
(other));
49
50
protected
:
52
ActionType
Action
;
53
54
public
:
56
mtsCallableVoidFunction
():
BaseType
(),
Action
(0) {}
57
62
mtsCallableVoidFunction
(
ActionType
action):
63
BaseType
(),
64
Action
(action)
65
{}
66
68
virtual
~mtsCallableVoidFunction
() {}
69
70
/* documented in base class */
71
inline
mtsExecutionResult
Execute
(
void
) {
72
(*Action)();
73
return
mtsExecutionResult::COMMAND_SUCCEEDED
;
74
}
75
76
/* documented in base class */
77
inline
void
ToStream
(std::ostream & outputStream)
const
{
78
outputStream <<
"function based callable object"
;
79
}
80
81
};
82
83
84
#endif
// _mtsCallableVoidFunction_h
85
mtsCallableVoidBase::mtsCallableVoidBase
mtsCallableVoidBase(void)
Definition
mtsCallableVoidBase.h:44
mtsCallableVoidFunction::mtsCallableVoidFunction
mtsCallableVoidFunction(ActionType action)
Definition
mtsCallableVoidFunction.h:62
mtsCallableVoidFunction::Execute
mtsExecutionResult Execute(void)
Definition
mtsCallableVoidFunction.h:71
mtsCallableVoidFunction::ThisType
mtsCallableVoidFunction ThisType
Definition
mtsCallableVoidFunction.h:41
mtsCallableVoidFunction::Action
ActionType Action
Definition
mtsCallableVoidFunction.h:52
mtsCallableVoidFunction::~mtsCallableVoidFunction
virtual ~mtsCallableVoidFunction()
Definition
mtsCallableVoidFunction.h:68
mtsCallableVoidFunction::mtsCallableVoidFunction
mtsCallableVoidFunction()
Definition
mtsCallableVoidFunction.h:56
mtsCallableVoidFunction::BaseType
mtsCallableVoidBase BaseType
Definition
mtsCallableVoidFunction.h:38
mtsCallableVoidFunction::ToStream
void ToStream(std::ostream &outputStream) const
Definition
mtsCallableVoidFunction.h:77
mtsCallableVoidFunction::ActionType
void(*) ActionType(void)
Definition
mtsCallableVoidFunction.h:44
mtsExecutionResult
Definition
mtsExecutionResult.h:34
mtsExecutionResult::COMMAND_SUCCEEDED
@ COMMAND_SUCCEEDED
Definition
mtsExecutionResult.h:44
CMN_UNUSED
#define CMN_UNUSED(argument)
Definition
cmnPortability.h:497
Generated by
1.18.0