| 112 | |
| 113 | template <typename Robot> |
| 114 | struct ArrayInput |
| 115 | { |
| 116 | using Type = typename Robot::ConfigurationArray; |
| 117 | |
| 118 | using Configuration = typename Robot::Configuration; |
| 119 | using ConfigurationArray = typename Robot::ConfigurationArray; |
| 120 | template <std::size_t rake> |
| 121 | using ConfigurationBlock = typename Robot::template ConfigurationBlock<rake>; |
| 122 | |
| 123 | inline static auto from(const Configuration &c) -> Type |
| 124 | { |
| 125 | Type a; |
| 126 | auto c_arr = c.to_array(); |
| 127 | for (auto i = 0U; i < Robot::dimension; ++i) |
| 128 | { |
| 129 | a[i] = c_arr[i]; |
| 130 | } |
| 131 | |
| 132 | return a; |
| 133 | }; |
| 134 | |
| 135 | inline static auto to(const Type &a) -> Configuration |
| 136 | { |
| 137 | return Configuration(a); |
| 138 | }; |
| 139 | |
| 140 | inline static auto array(const Type &a) -> ConfigurationArray |
| 141 | { |
| 142 | return a; |
| 143 | } |
| 144 | |
| 145 | template <std::size_t rake> |
| 146 | inline static auto block(const Type &a) -> ConfigurationBlock<rake> |
| 147 | { |
| 148 | ConfigurationBlock<rake> out; |
| 149 | for (auto i = 0U; i < Robot::dimension; ++i) |
| 150 | { |
| 151 | out[i] = a[i]; |
| 152 | } |
| 153 | |
| 154 | return out; |
| 155 | } |
| 156 | }; |
| 157 | |
| 158 | template <typename Robot, typename Input> |
| 159 | struct Helper |
nothing calls this directly
no outgoing calls
no test coverage detected