CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
ProcessTraits.hpp
Go to the documentation of this file.
1 /*
2  * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
15 #include <type_traits>
16 #include <cstddef>
17 
18 namespace corsika {
19 
23  template <typename TProcess, typename TEnable = void>
24  struct is_process : std::false_type {};
25 
26  template <typename TProcess>
27  bool constexpr is_process_v = is_process<TProcess>::value;
28 
32  template <typename TProcess, typename Enable = void>
33  struct is_continuous_process : std::false_type {};
34 
35  template <typename TProcess>
36  bool constexpr is_continuous_process_v = is_continuous_process<TProcess>::value;
37 
41  template <typename TProcess, typename Enable = void>
42  struct is_decay_process : std::false_type {};
43 
44  template <typename TProcess>
45  bool constexpr is_decay_process_v = is_decay_process<TProcess>::value;
46 
50  template <typename TProcess, typename Enable = void>
51  struct is_stack_process : std::false_type {};
52 
53  template <typename TProcess>
54  bool constexpr is_stack_process_v = is_stack_process<TProcess>::value;
55 
59  template <typename TProcess, typename Enable = void>
60  struct is_cascade_equations_process : std::false_type {};
61 
62  template <typename TProcess>
63  bool constexpr is_cascade_equations_process_v =
65 
69  template <typename TProcess, typename Enable = void>
70  struct is_secondaries_process : std::false_type {};
71 
72  template <typename TProcess>
73  bool constexpr is_secondaries_process_v = is_secondaries_process<TProcess>::value;
74 
78  template <typename TProcess, typename Enable = void>
79  struct is_boundary_process : std::false_type {};
80 
81  template <typename TProcess>
82  bool constexpr is_boundary_process_v = is_boundary_process<TProcess>::value;
83 
87  template <typename TProcess, typename Enable = void>
88  struct is_interaction_process : std::false_type {};
89 
90  template <typename TProcess>
91  bool constexpr is_interaction_process_v = is_interaction_process<TProcess>::value;
92 
96  template <typename TClass>
97  struct contains_stack_process : std::false_type {};
98 
99  template <typename TClass>
100  bool constexpr contains_stack_process_v = contains_stack_process<TClass>::value;
101 
105  template <typename TProcess, int N = 0, typename Enable = void>
107  static size_t constexpr count = N;
108  };
109 
110 } // namespace corsika
A traits marker to identify CascadeEquationsProcess.
traits class to count any type of Process, general version.
A traits marker to identify BaseProcess, thus any type of process.
A traits marker to identify InteractionProcess.
A traits marker to identify StackProcess.
`, since they are used everywhere as integral part of the framework.
A traits marker to identify DecayProcess.
A traits marker to identify ContinuousProcess.
A traits marker to identify ProcessSequence that contain a StackProcess.
A traits marker to identify BoundaryProcess.
A traits marker to identify SecondariesProcess.