cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
36 
37 public:
39 
42 
44  typedef void(*ActionType)(void);
45 
46 private:
48  inline mtsCallableVoidFunction(const ThisType & CMN_UNUSED(other));
49 
50 protected:
53 
54 public:
57 
63  BaseType(),
64  Action(action)
65  {}
66 
69 
70  /* documented in base class */
71  inline mtsExecutionResult Execute(void) {
72  (*Action)();
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 
mtsCallableVoidFunction ThisType
Definition: mtsCallableVoidFunction.h:41
mtsExecutionResult Execute(void)
Definition: mtsCallableVoidFunction.h:71
void(* ActionType)(void)
Definition: mtsCallableVoidFunction.h:44
#define CMN_UNUSED(argument)
Definition: cmnPortability.h:479
mtsCallableVoidFunction()
Definition: mtsCallableVoidFunction.h:56
Definition: mtsCallableVoidBase.h:39
mtsCallableVoidBase BaseType
Definition: mtsCallableVoidFunction.h:38
virtual ~mtsCallableVoidFunction()
Definition: mtsCallableVoidFunction.h:68
mtsCallableVoidFunction(ActionType action)
Definition: mtsCallableVoidFunction.h:62
Definition: mtsExecutionResult.h:34
void ToStream(std::ostream &outputStream) const
Definition: mtsCallableVoidFunction.h:77
ActionType Action
Definition: mtsCallableVoidFunction.h:52
Definition: mtsCallableVoidFunction.h:35
Definition: mtsExecutionResult.h:44