CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
ContinuousProcess.hpp
1 /*
2  * (c) Copyright 2021 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 
13 
14 namespace corsika {
15 
19  template <class TProcess, typename TReturn, typename TArg1, typename TArg2>
21  : public detail::has_method_signature<TReturn, TArg1, TArg2, bool> {
22 
25 
27  template <class T>
28  static std::false_type test(...);
29 
31  template <class T>
32  static decltype(testSignature(&T::template doContinuous<TArg1, TArg2>)) test(
33  std::nullptr_t);
34 
36  template <class T>
37  static decltype(testSignature(&T::doContinuous)) test(std::nullptr_t);
38 
39  public:
44  using type = decltype(test<std::decay_t<TProcess>>(nullptr));
45  static const bool value = type::value;
47  };
48 
51  template <class TProcess, typename TReturn, typename TArg1, typename TArg2>
52  bool constexpr has_method_doContinuous_v =
54 
59  template <class TProcess, typename TReturn, typename... TArgs>
61  : public detail::has_method_signature<TReturn, TArgs...> {
62 
64  using detail::has_method_signature<TReturn, TArgs...>::testSignature;
65 
67  template <class T>
68  static std::false_type test(...);
69 
71  template <class T>
72  static decltype(testSignature(&T::template getMaxStepLength<TArgs...>)) test(
73  std::nullptr_t);
74 
76  template <class T>
77  static decltype(testSignature(&T::getMaxStepLength)) test(std::nullptr_t);
78 
79  public:
84  using type = decltype(test<std::decay_t<TProcess>>(nullptr));
85  static const bool value = type::value;
87  };
88 
90  template <class TProcess, typename TReturn, typename... TArgs>
92  has_method_getMaxStepLength<TProcess, TReturn, TArgs...>::value;
93 
94 } // namespace corsika
static decltype(testSignature(&T::getMaxStepLength)) test(std::nullptr_t)
non templated option
bool constexpr has_method_getMaxStepLength_v
value traits type
static decltype(testSignature(&T::doContinuous)) test(std::nullptr_t)
non templated parameter option
static decltype(testSignature(&T::template getMaxStepLength< TArgs... >)) test(std::nullptr_t)
templated option
`, since they are used everywhere as integral part of the framework.
Helper traits class (partial) for static compile time checking.
static decltype(testSignature(&T::template doContinuous< TArg1, TArg2 >)) test(std::nullptr_t)
templated parameter option
traits test for ContinuousProcess::doContinuous method
traits test for ContinuousProcess::getMaxStepLength method