ECCE @ 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-2018 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 
11 #include <type_traits>
12 #include <utility>
13 
15 
16 namespace Acts {
18 // forward declaration
19 template <ParID_t... params>
20 class ParameterSet;
22 
24 namespace detail {
31 struct full_parset {
32  template <ParID_t v, typename C>
33  struct add_to_value_container;
34 
35  template <ParID_t v, ParID_t... others>
36  struct add_to_value_container<v, std::integer_sequence<ParID_t, others...>> {
37  using type = std::integer_sequence<ParID_t, others..., v>;
38  };
39 
40  template <typename T, unsigned int N>
41  struct tparam_generator {
42  using type = typename add_to_value_container<
43  static_cast<T>(N), typename tparam_generator<T, N - 1>::type>::type;
44  };
45 
46  template <typename T>
47  struct tparam_generator<T, 0> {
48  using type = std::integer_sequence<T, static_cast<T>(0)>;
49  };
50 
51  template <typename T>
52  struct converter;
53 
54  template <ParID_t... values>
55  struct converter<std::integer_sequence<ParID_t, values...>> {
56  using type = ParameterSet<values...>;
57  };
58 
59  using type = typename converter<
60  typename tparam_generator<ParID_t, eBoundParametersSize - 1>::type>::type;
61 };
62 } // namespace detail
64 } // namespace Acts