Lodestar
An integrated real-time control package in C++
|
|
5 #ifndef LODESTAR_BLOCKTRAITS_HPP
6 #define LODESTAR_BLOCKTRAITS_HPP
8 #include "BlockType.hpp"
9 #include "BlockProto.hpp"
10 #include "Lodestar/aux/DemangledType.hpp"
11 #include <type_traits>
36 template<
typename TBlock =
void>
38 static_assert(!::std::is_same<TBlock, TBlock>::value,
39 "BlockTraits is not defined for this type.");
49 using Base =
typename type::Base;
52 static const constexpr
int kIns = type::Base::kIns;
54 static const constexpr
int kOuts = type::Base::kOuts;
56 static const constexpr
int kPars = type::Base::kPars;
59 static const ::std::array<::std::string, kIns>
inTypes;
61 static const ::std::array<::std::string, kOuts>
outTypes;
63 static const ::std::array<::std::string, kPars>
parTypes;
74 template<typename TType, typename ::std::enable_if<::std::is_base_of<BlockProto, typename ::std::decay<TType>::type>::value>
::type* =
nullptr>
80 template<typename TType, typename ::std::enable_if<!::std::is_base_of<BlockProto, typename ::std::decay<TType>::type>::value>
::type* =
nullptr>
84 ::std::is_base_of<
BlockProto, typename ::std::decay<TType>::type>::value,
85 "All elements in BlockPack must be derived from BlockProto."
93 #endif //LODESTAR_BLOCKTRAITS_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
Main Lodestar code.
Definition: BilinearTransformation.hpp:12
TBlock type
Current class.
Definition: BlockTraits.hpp:47
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
static const constexpr int kIns
Number of input slots.
Definition: BlockTraits.hpp:52
@ UnknownBlock
Unknown block.
static const ::std::array<::std::string, kPars > parTypes
Parameter types (as strings).
Definition: BlockTraits.hpp:63
Definition: BlockProto.hpp:20
static const constexpr int kPars
Number of parameters.
Definition: BlockTraits.hpp:56
typename type::Base Base
Base Block class.
Definition: BlockTraits.hpp:49
static const constexpr int kOuts
Number of output slots.
Definition: BlockTraits.hpp:54