cisst-saw
Loading...
Searching...
No Matches
mtsFunctionRead.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): Peter Kazanzides, Anton Deguet
7
8 (C) Copyright 2007-2014 Johns Hopkins University (JHU), All Rights Reserved.
9
10--- begin cisst license - do not edit ---
11
12This software is provided "as is" under an open source license, with
13no warranty. The complete license can be found in license.txt and
14http://www.cisst.org/cisst/license.txt.
15
16--- end cisst license ---
17*/
18
19
24
25#ifndef _mtsFunctionRead_h
26#define _mtsFunctionRead_h
27
28
33
34// Always include last
36
38public:
40protected:
42
43#ifndef SWIG
44 template <typename _userType, bool>
46 public:
47 static mtsExecutionResult Call(const mtsFunctionRead * function, _userType & argument) {
48 mtsGenericObjectProxyRef<_userType> argumentWrapped(argument);
49 return function->ExecuteGeneric(argumentWrapped);
50 }
51 };
52 template <typename _userType>
53 class ConditionalWrap<_userType, true> {
54 public:
55 static mtsExecutionResult Call(const mtsFunctionRead * function, _userType & argument) {
56 return function->ExecuteGeneric(argument);
57 }
58 };
59#endif
60
61public:
65
68
69 // documented in base class
70 bool Detach(void);
71
72 // documented in base class
73 bool IsValid(void) const;
74
80 bool Bind(CommandType * command);
81
85 { return ExecuteGeneric(argument); }
86
88
89#ifndef SWIG
91 template <class _userType>
98#endif
99
101 CommandType * GetCommand(void) const;
102
105
107 void ToStream(std::ostream & outputStream) const;
108
109};
110
111#endif // _mtsFunctionRead_h
Definition mtsCommandRead.h:42
Definition mtsExecutionResult.h:34
@ FUNCTION_NOT_BOUND
Definition mtsExecutionResult.h:44
static mtsExecutionResult Call(const mtsFunctionRead *function, _userType &argument)
Definition mtsFunctionRead.h:55
Definition mtsFunctionRead.h:45
static mtsExecutionResult Call(const mtsFunctionRead *function, _userType &argument)
Definition mtsFunctionRead.h:47
mtsExecutionResult operator()(mtsGenericObject &argument) const
Definition mtsFunctionRead.h:84
bool Detach(void)
mtsExecutionResult ExecuteGeneric(mtsGenericObject &argument) const
void ToStream(std::ostream &outputStream) const
CommandType * Command
Definition mtsFunctionRead.h:41
CommandType * GetCommand(void) const
bool Bind(CommandType *command)
mtsCommandRead CommandType
Definition mtsFunctionRead.h:39
const mtsGenericObject * GetArgumentPrototype(void) const
virtual ~mtsFunctionRead()
mtsExecutionResult operator()(_userType &argument) const
Definition mtsFunctionRead.h:92
bool IsValid(void) const
Base class for data object in cisstMultiTask.
Definition mtsGenericObject.h:52
Definition mtsGenericObjectProxy.h:491
#define CISST_EXPORT
Definition cmnExportMacros.h:50
Defines a command with one argument.
Rules of exporting.
Forward declarations and #define for cisstMultiTask.
Defines a base function object to allow heterogeneous containers of functions.