EEROS
0.4.1.0
API for the EEROS Real-Time Robotics Framework
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Input.hpp
Go to the documentation of this file.
1
#ifndef ORG_EEROS_CONTROL_INPUT_HPP_
2
#define ORG_EEROS_CONTROL_INPUT_HPP_
3
4
#include <
eeros/control/Signal.hpp
>
5
#include <
eeros/control/Output.hpp
>
6
7
namespace
eeros {
8
namespace
control {
9
10
template
<
typename
T =
double
>
11
class
Input
{
12
public
:
13
Input
() :
connectedOutput
(nullptr) { }
14
15
virtual
bool
connect
(
Output<T>
& output) {
16
if
(
connectedOutput
!=
nullptr
)
return
false
;
17
connectedOutput
= &output;
18
return
true
;
19
}
20
21
virtual
bool
connect
(
Output<T>
* output) {
22
if
(
connectedOutput
!=
nullptr
)
return
false
;
23
connectedOutput
= output;
24
return
true
;
25
}
26
27
virtual
void
disconnect
() {
28
connectedOutput
=
nullptr
;
29
}
30
31
virtual
bool
isConnected
()
const
{
32
return
connectedOutput
!=
nullptr
;
33
}
34
35
virtual
Signal<T>
&
getSignal
() {
36
if
(
isConnected
())
return
connectedOutput
->getSignal();
37
// TODO error message or throw exception
38
return
Signal<T>::getIllegalSignal
();
39
}
40
41
protected
:
42
Output<T>
*
connectedOutput
;
43
};
44
45
};
46
};
47
48
#endif
/* ORG_EEROS_CONTROL_INPUT_HPP_ */
eeros::control::Input::connect
virtual bool connect(Output< T > *output)
Definition:
Input.hpp:21
eeros::control::Input::isConnected
virtual bool isConnected() const
Definition:
Input.hpp:31
eeros::control::Input::Input
Input()
Definition:
Input.hpp:13
eeros::control::Output
Definition:
Output.hpp:10
Signal.hpp
eeros::control::Input::connectedOutput
Output< T > * connectedOutput
Definition:
Input.hpp:42
eeros::control::Signal::getIllegalSignal
static Signal< T > & getIllegalSignal()
Definition:
Signal.hpp:82
eeros::control::Input::getSignal
virtual Signal< T > & getSignal()
Definition:
Input.hpp:35
eeros::control::Signal
Definition:
Signal.hpp:14
eeros::control::Input
Definition:
Input.hpp:11
eeros::control::Input::connect
virtual bool connect(Output< T > &output)
Definition:
Input.hpp:15
eeros::control::Input::disconnect
virtual void disconnect()
Definition:
Input.hpp:27
Output.hpp
includes
eeros
control
Input.hpp
Generated on Wed Jul 8 2015 11:18:07 for EEROS by
1.8.6