diff --git a/corsika/detail/framework/process/BoundaryCrossingProcess.hpp b/corsika/detail/framework/process/BoundaryCrossingProcess.hpp new file mode 100644 index 0000000000000000000000000000000000000000..caf26852393b1bb01a522c4d7f7afe5ec7ded85e --- /dev/null +++ b/corsika/detail/framework/process/BoundaryCrossingProcess.hpp @@ -0,0 +1,45 @@ +/* + * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu + * + * This software is distributed under the terms of the GNU General Public + * Licence version 3 (GPL Version 3). See file LICENSE for a full version of + * the license. + */ + +#pragma once + +#include <corsika/framework/process/ProcessTraits.hpp> + +namespace corsika { + + // test for doBoundaryCrossing method + + template <class TProcess, typename TReturn, typename... TArg> + struct has_method_doBoundaryCrossing : public detail::has_method_signature<TReturn, TArg...> { + + using detail::has_method_signature<TReturn, TArg...>::testSignature; + + // the default value + template <class T> + static std::false_type test(...); + + // templated parameter option + template <class T> + static decltype(testSignature(&T::template doBoundaryCrossing<TArg...>)) test( + std::nullptr_t); + + // non templated parameter option + template <class T> + static decltype(testSignature(&T::doBoundaryCrossing)) test(std::nullptr_t); + + public: + using type = decltype(test<std::decay_t<TProcess>>(nullptr)); + static const bool value = type::value; + }; + + template <class TProcess, typename TReturn, typename... TArg> + bool constexpr has_method_doBoundaryCrossing_v = + has_method_doBoundaryCrossing<TProcess, TReturn, TArg...>::value; + + +} // namespace corsika diff --git a/corsika/detail/framework/process/ContinuousProcess.hpp b/corsika/detail/framework/process/ContinuousProcess.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c9180591417d1cd17010306c5489a32dd0aff0b5 --- /dev/null +++ b/corsika/detail/framework/process/ContinuousProcess.hpp @@ -0,0 +1,74 @@ +/* + * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu + * + * This software is distributed under the terms of the GNU General Public + * Licence version 3 (GPL Version 3). See file LICENSE for a full version of + * the license. + */ + +#pragma once + +#include <corsika/framework/process/ProcessTraits.hpp> + +namespace corsika { + + // test for doContinuous method + + template <class TProcess, typename TReturn, typename TArg1, typename TArg2> + struct has_method_doContinuous : public detail::has_method_signature<TReturn, TArg1, TArg2, bool> { + + using detail::has_method_signature<TReturn, TArg1, TArg2, bool>::testSignature; + + // the default value + template <class T> + static std::false_type test(...); + + // templated parameter option + template <class T> + static decltype(testSignature(&T::template doContinuous<TArg1, TArg2>)) test( + std::nullptr_t); + + // non templated parameter option + template <class T> + static decltype(testSignature(&T::doContinuous)) test(std::nullptr_t); + + public: + using type = decltype(test<std::decay_t<TProcess>>(nullptr)); + static const bool value = type::value; + }; + + template <class TProcess, typename TReturn, typename TArg1, typename TArg2> + bool constexpr has_method_doContinuous_v = + has_method_doContinuous<TProcess, TReturn, TArg1, TArg2>::value; + + // test for getMaxStepLength method + + template <class TProcess, typename TReturn, typename... TArgs> + struct has_method_getMaxStepLength + : public detail::has_method_signature<TReturn, TArgs...> { + + using detail::has_method_signature<TReturn, TArgs...>::testSignature; + + // the default value + template <class T> + static std::false_type test(...); + + // templated option + template <class T> + static decltype(testSignature(&T::template getMaxStepLength<TArgs...>)) test( + std::nullptr_t); + + // non templated option + template <class T> + static decltype(testSignature(&T::getMaxStepLength)) test(std::nullptr_t); + + public: + using type = decltype(test<std::decay_t<TProcess>>(nullptr)); + static const bool value = type::value; + }; + + template <class TProcess, typename TReturn, typename... TArgs> + bool constexpr has_method_getMaxStepLength_v = + has_method_getMaxStepLength<TProcess, TReturn, TArgs...>::value; + +} // namespace corsika diff --git a/corsika/detail/framework/process/DecayProcess.hpp b/corsika/detail/framework/process/DecayProcess.hpp new file mode 100644 index 0000000000000000000000000000000000000000..661d0aeb1132637dd3d202f8730b6f013b92dab9 --- /dev/null +++ b/corsika/detail/framework/process/DecayProcess.hpp @@ -0,0 +1,75 @@ +/* + * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu + * + * This software is distributed under the terms of the GNU General Public + * Licence version 3 (GPL Version 3). See file LICENSE for a full version of + * the license. + */ + +#pragma once + +#include <corsika/framework/process/ProcessTraits.hpp> + +namespace corsika { + + // doDecay + + template <class TProcess, typename TReturn, typename... TArgs> + struct has_method_doDecay : public detail::has_method_signature<TReturn, TArgs...> { + + typedef std::decay_t<TProcess> process_type; + + using detail::has_method_signature<TReturn, TArgs...>::testSignature; + + // the default value + template <class T> + static std::false_type test(...); + + // signature of templated method + template <class T> + static decltype(testSignature(&T::template doDecay<TArgs...>)) test( + std::nullptr_t); + + // signature of non-templated method + template <class T> + static decltype(testSignature(&T::doDecay)) test(std::nullptr_t); + + public: + using type = decltype(test<process_type>(nullptr)); + static const bool value = type::value; + }; + + template <class TProcess, typename TReturn, typename... TArgs> + bool constexpr has_method_doDecay_v = + has_method_doDecay<TProcess, TReturn, TArgs...>::value; + + + // getLifetime + + template <class TProcess, typename TReturn, typename... TArgs> + struct has_method_getLifetime + : public detail::has_method_signature<TReturn, TArgs...> { + + using detail::has_method_signature<TReturn, TArgs...>::testSignature; + + // the default value + template <class T> + static std::false_type test(...); + + template <class T> + static decltype(testSignature(&T::template getLifetime<TArgs...>)) test( + std::nullptr_t); + + template <class T> + static decltype(testSignature(&T::getLifetime)) test(std::nullptr_t); + + public: + using type = decltype(test<std::decay_t<TProcess>>(nullptr)); + static const bool value = type::value; + }; + + template <class TProcess, typename TReturn, typename... TArgs> + bool constexpr has_method_getLifetime_v = + has_method_getLifetime<TProcess, TReturn, TArgs...>::value; + +} // namespace corsika diff --git a/corsika/detail/framework/process/SecondariesProcess.hpp b/corsika/detail/framework/process/SecondariesProcess.hpp new file mode 100644 index 0000000000000000000000000000000000000000..26990ce68a185dbb31a77f86b2f7e76843200116 --- /dev/null +++ b/corsika/detail/framework/process/SecondariesProcess.hpp @@ -0,0 +1,45 @@ +/* + * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu + * + * This software is distributed under the terms of the GNU General Public + * Licence version 3 (GPL Version 3). See file LICENSE for a full version of + * the license. + */ + +#pragma once + +#include <corsika/framework/process/ProcessTraits.hpp> + +namespace corsika { + + // test for doSecondaries method + + template <class TProcess, typename TReturn, typename... TArg> + struct has_method_doSecondaries : public detail::has_method_signature<TReturn, TArg...> { + + using detail::has_method_signature<TReturn, TArg...>::testSignature; + + // the default value + template <class T> + static std::false_type test(...); + + // templated parameter option + template <class T> + static decltype(testSignature(&T::template doSecondaries<TArg...>)) test( + std::nullptr_t); + + // non templated parameter option + template <class T> + static decltype(testSignature(&T::doSecondaries)) test(std::nullptr_t); + + public: + using type = decltype(test<std::decay_t<TProcess>>(nullptr)); + static const bool value = type::value; + }; + + template <class TProcess, typename TReturn, typename... TArg> + bool constexpr has_method_doSecondaries_v = + has_method_doSecondaries<TProcess, TReturn, TArg...>::value; + + +} // namespace corsika diff --git a/corsika/detail/framework/process/StackProcess.hpp b/corsika/detail/framework/process/StackProcess.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1eea73409e5edfbbe8b5d0c69a7fd76f7ed65571 --- /dev/null +++ b/corsika/detail/framework/process/StackProcess.hpp @@ -0,0 +1,48 @@ +/* + * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu + * + * This software is distributed under the terms of the GNU General Public + * Licence version 3 (GPL Version 3). See file LICENSE for a full version of + * the license. + */ + +#pragma once + +#include <corsika/framework/process/ProcessTraits.hpp> + +namespace corsika { + + // test method doStack + + template <class TProcess, typename TReturn, typename... TArgs> + struct has_method_doStack : public detail::has_method_signature<TReturn, TArgs...> { + + using detail::has_method_signature<TReturn, TArgs...>::testSignature; + + // the default value + template <class T> + static std::false_type test(...); + + // templated parameter option + template <class T> + static decltype(testSignature(&T::template doStack<TArgs...>)) test( + std::nullptr_t); + + // non-templated parameter option + template <template <typename> typename T> + static decltype(testSignature(&T<TArgs...>::template doStack)) test( + std::nullptr_t); + + template <class T> + static decltype(testSignature(&T::doStack)) test(std::nullptr_t); + + public: + using type = decltype(test<std::decay_t<TProcess>>(nullptr)); + static const bool value = type::value; + }; + + template <class TProcess, typename TReturn, typename... TArgs> + bool constexpr has_method_doStack_v = + has_method_doStack<TProcess, TReturn, TArgs...>::value; + +} // namespace corsika