1 #ifndef ORG_EEROS_CONTROL_CONSTANT_HPP_ 2 #define ORG_EEROS_CONTROL_CONSTANT_HPP_ 11 template <
typename T =
double >
21 this->
out.getSignal().setValue(
value);
34 friend std::ostream& operator<<(std::ostream& os, Constant<X>& c);
40 template <
typename S>
typename std::enable_if<std::is_integral<S>::value>::type _clear() {
41 value = std::numeric_limits<int32_t>::min();
43 template <
typename S>
typename std::enable_if<std::is_floating_point<S>::value>::type _clear() {
44 value = std::numeric_limits<double>::quiet_NaN();
46 template <
typename S>
typename std::enable_if<!std::is_arithmetic<S>::value && std::is_integral<typename S::value_type>::value>::type _clear() {
47 value.fill(std::numeric_limits<int32_t>::min());
49 template <
typename S>
typename std::enable_if< !std::is_arithmetic<S>::value && std::is_floating_point<typename S::value_type>::value>::type _clear() {
50 value.fill(std::numeric_limits<double>::quiet_NaN());
56 std::ostream& operator<<(std::ostream& os, Constant<T>& c) {
57 os <<
"Block constant: '" << c.getName() <<
"' init val = " << c.value;
Constant()
Definition: Constant.hpp:14
T value
Definition: Constant.hpp:37
Definition: Block1o.hpp:12
Definition: Config.hpp:14
static uint64_t getTimeNs()
Definition: System_POSIX.cpp:41
Definition: Constant.hpp:12
Output< T > out
Definition: Block1o.hpp:23
virtual void setValue(T newValue)
Definition: Constant.hpp:25
virtual void run()
Definition: Constant.hpp:20
virtual T getValue()
Definition: Constant.hpp:29
Constant(T v)
Definition: Constant.hpp:18