EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
full_parameter_set.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file full_parameter_set.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
12 
13 #include <type_traits>
14 #include <utility>
15 
16 namespace Acts {
17 
18 // forward declaration
19 template <typename parameter_indices_t, parameter_indices_t... params>
21 
22 namespace detail {
23 
30 template <typename parameter_indices_t>
31 struct full_parset {
32  template <parameter_indices_t v, typename C>
34 
35  template <parameter_indices_t v, parameter_indices_t... others>
37  v, std::integer_sequence<parameter_indices_t, others...>> {
38  using type = std::integer_sequence<parameter_indices_t, others..., v>;
39  };
40 
41  template <typename T, unsigned int N>
43  using type = typename add_to_value_container<
44  static_cast<T>(N), typename tparam_generator<T, N - 1>::type>::type;
45  };
46 
47  template <typename T>
48  struct tparam_generator<T, 0> {
49  using type = std::integer_sequence<T, static_cast<T>(0)>;
50  };
51 
52  template <typename T>
53  struct converter;
54 
55  template <parameter_indices_t... values>
56  struct converter<std::integer_sequence<parameter_indices_t, values...>> {
57  using type = ParameterSet<parameter_indices_t, values...>;
58  };
59 
60  using type = typename converter<typename tparam_generator<
61  parameter_indices_t,
62  kParametersSize<parameter_indices_t> - 1>::type>::type;
63 };
64 
65 } // namespace detail
66 } // namespace Acts