rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
type_rule_accessors.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/operation/type_rule/type_pivot_source.hpp>
6
7#include <rexlib/core/meta/type_list.hpp>
8#include <rexlib/core/numerical/numerical_type.hpp>
9#include <rexlib/core/platform/constexpr.hpp>
10
11#include <array>
12#include <cstddef>
13#include <type_traits>
14
15namespace rexlib
16{
17
18namespace detail
19{
20
21template <typename Pivots>
23
24template <>
26{
27 using type = type_list<>;
28};
29
30template <typename Head, typename... Tail>
32{
33 using tail_type = typename operation_pivot_list<type_list<Tail...>>::type;
34 using type = typename std::conditional<
35 Head::source == type_pivot_source::operation,
37 tail_type
38 >::type;
39};
40
41} // namespace detail
42
53template <typename Rule>
55{
56 using operation_pivot_list_type = typename detail::operation_pivot_list<
57 typename Rule::pivot_list_type
58 >::type;
59
60 static REXLIB_CONST_CONSTEXPR std::size_t operation_pivot_count =
62
63 using operation_data_type_array_type =
64 std::array<numerical_type, operation_pivot_count>;
65
74 template <typename Parameters>
75 static operation_data_type_array_type get_operation_data_types(
77 ) noexcept;
78};
79
80} // namespace rexlib
81
82#include "type_rule_accessors.inl"
Container for multidimensional numeric data.
Definition array.hpp:31
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
@ operation
Supplied by the operation instance at runtime.
Definition type_rule_accessors.hpp:22
Utility class to prepend a type to the front of a type_list.
Definition type_list.hpp:63
Utility class to obtain the size of a type_list.
Definition type_list.hpp:28
Helper class to pass a heterogeneous sequence of types to a function.
Definition type_list.hpp:20
Read the data types a typing rule depends on from the parameters of an operation instance.
Definition type_rule_accessors.hpp:55
static operation_data_type_array_type get_operation_data_types(const Parameters &parameters) noexcept
Read every data type the operation supplies.