Lodestar
An integrated real-time control package in C++
|
|
5 #ifndef LODESTAR_SIGNUMBLOCK_HPP
6 #define LODESTAR_SIGNUMBLOCK_HPP
8 #include "Lodestar/blocks/Block.hpp"
13 template<
typename TType,
typename TOutput =
int>
17 ::std::tuple<TOutput>,
24 ::std::tuple<TOutput>,
33 bool isPositive()
const
35 return (this->
template o<0>() > 0);
38 bool isNegative()
const
40 return (this->
template o<0>() < 0);
45 return (this->
template o<0>() == 0);
48 bool isNonNegative()
const
50 return (this->
template o<0>() >= 0);
53 bool isNonPositive()
const
55 return (this->
template o<0>() <= 0);
61 this->equation = ::std::bind(
63 ::std::placeholders::_1);
66 void triggerFunction(
Base &b)
68 b.template o<0>() = (b.template i<0>() == 0 ? 0 : (
69 b.template i<0>() < 0 ? -1 : 1));
74 template<
typename TType,
typename TOutput>
91 static const ::std::array<::std::string, kIns>
inTypes;
92 static const ::std::array<::std::string, kOuts>
outTypes;
93 static const ::std::array<::std::string, kPars>
parTypes;
98 template<
typename TType,
typename TOutput>
100 {demangle(
typeid(TType).name())};
102 template<
typename TType,
typename TOutput>
103 const ::std::array<::std::string, BlockTraits<std::SignumBlock<TType, TOutput>>::kOuts> BlockTraits<std::SignumBlock<TType, TOutput>>::outTypes =
104 {demangle(
typeid(TOutput).name())};
106 template<
typename TType,
typename TOutput>
107 const ::std::array<::std::string, BlockTraits<std::SignumBlock<TType, TOutput>>::kPars> BlockTraits<std::SignumBlock<TType, TOutput>>::parTypes =
110 template<
typename TType,
typename TOutput>
111 const ::std::array<::std::string, 2> BlockTraits<std::SignumBlock<TType, TOutput>>::templateTypes =
112 {demangle(
typeid(TType).name()), demangle(
typeid(TOutput).name())};
117 #endif //LODESTAR_SIGNUMBLOCK_HPP
static constexpr const bool directFeedthrough
Whether or not the block has direct feedthrough.
Definition: BlockTraits.hpp:44
A traits object that exposes information about TBlock.
Definition: BlockTraits.hpp:37
static const ::std::array<::std::string, kIns > inTypes
Input types (as strings).
Definition: BlockTraits.hpp:59
BlockType
Block type information.
Definition: BlockType.hpp:25
@ SignumBlock
Signum block.
Main Lodestar code.
Definition: BilinearTransformation.hpp:12
Definition: SignumBlock.hpp:14
static const ::std::array<::std::string, kOuts > outTypes
Output types (as strings).
Definition: BlockTraits.hpp:61
static constexpr const BlockType blockType
Block type.
Definition: BlockTraits.hpp:42
static const ::std::array<::std::string, 1 > templateTypes
Template parameter types (as strings).
Definition: BlockTraits.hpp:66
Generic base template class for all tuple-based Block instances.
Definition: Block.hpp:45
static const constexpr int kIns
Number of input slots.
Definition: BlockTraits.hpp:52
static const ::std::array<::std::string, kPars > parTypes
Parameter types (as strings).
Definition: BlockTraits.hpp:63
static const constexpr int kPars
Number of parameters.
Definition: BlockTraits.hpp:56
static const constexpr int kOuts
Number of output slots.
Definition: BlockTraits.hpp:54