diff --git a/Framework/Analytics/ClassTimer.h b/Framework/Analytics/ClassTimer.h index 3d1102afd096bfd2b1c0cdf978e5c2fc4f717c68..638a46dbac2173c2df79b8ff12d1d9e9de404cc3 100644 --- a/Framework/Analytics/ClassTimer.h +++ b/Framework/Analytics/ClassTimer.h @@ -17,12 +17,12 @@ namespace corsika::analytics { template <typename TType, TType> - class timeClass; + class ClassTimer; // Specialisation for normal member functions template <typename TType, typename TRet, typename... TArgs, TRet (TType::*TFuncPtr)(TArgs...)> - class timeClass<TRet (TType::*)(TArgs...), TFuncPtr> { + class ClassTimer<TRet (TType::*)(TArgs...), TFuncPtr> { private: using TClock = std::chrono::high_resolution_clock; using TDuration = std::chrono::microseconds; @@ -33,7 +33,7 @@ namespace corsika::analytics { TDuration vDiff; public: - timeClass(TType& obj) + ClassTimer(TType& obj) : vObj(obj) {} TRet call(TArgs... args) { @@ -48,7 +48,7 @@ namespace corsika::analytics { // Specialisation for member functions without return value template <typename TType, typename... TArgs, void (TType::*TFuncPtr)(TArgs...)> - class timeClass<void (TType::*)(TArgs...), TFuncPtr> { + class ClassTimer<void (TType::*)(TArgs...), TFuncPtr> { private: using TClock = std::chrono::high_resolution_clock; using TDuration = std::chrono::microseconds; @@ -59,7 +59,7 @@ namespace corsika::analytics { TDuration vDiff; public: - timeClass(TType& obj) + ClassTimer(TType& obj) : vObj(obj) {} void call(TArgs... args) { @@ -76,7 +76,7 @@ namespace corsika::analytics { template <typename TType, typename TRet, typename... TArgs, TRet (TType::*TFuncPtr)(TArgs...) const> - class timeClass<TRet (TType::*)(TArgs...) const, TFuncPtr> { + class ClassTimer<TRet (TType::*)(TArgs...) const, TFuncPtr> { private: using TClock = std::chrono::high_resolution_clock; using TDuration = std::chrono::microseconds; @@ -87,7 +87,7 @@ namespace corsika::analytics { TDuration vDiff; public: - timeClass(TType& obj) + ClassTimer(TType& obj) : vObj(obj) {} TRet call(TArgs... args) { @@ -103,28 +103,28 @@ namespace corsika::analytics { // Specialisation for const member functions without return value template <typename TType, typename... TArgs, void (TType::*TFuncPtr)(TArgs...) const> - class timeClass<void (TType::*)(TArgs...) const, TFuncPtr> { + class ClassTimer<void (TType::*)(TArgs...) const, TFuncPtr> { private: using TClock = std::chrono::high_resolution_clock; using TDuration = std::chrono::microseconds; - const TType& vObj; + const TType& obj_; - typename TClock::time_point vStart; - TDuration vDiff; + typename TClock::time_point start_; + TDuration timeDiff_; public: - timeClass(TType& obj) - : vObj(obj) {} + ClassTimer(TType& obj) + : obj_(obj) {} void call(TArgs... args) { - vStart = TClock::now(); - (vObj.*TFuncPtr)(std::forward<TArgs>(args)...); - vDiff = std::chrono::duration_cast<TDuration>(TClock::now() - vStart); + start_ = TClock::now(); + (obj_.*TFuncPtr)(std::forward<TArgs>(args)...); + timeDiff_ = std::chrono::duration_cast<TDuration>(TClock::now() - start_); return; } - inline TDuration getTime() const { return vDiff; } + inline TDuration getTime() const { return timeDiff_; } }; } // namespace corsika::analytics \ No newline at end of file diff --git a/Framework/Analytics/FunctionTimer.h b/Framework/Analytics/FunctionTimer.h index 323cf173cffda0d9d2df7e48f3f4d612c5454f15..8488dd2de1e45173022cdeebc2cf847610c4daef 100644 --- a/Framework/Analytics/FunctionTimer.h +++ b/Framework/Analytics/FunctionTimer.h @@ -18,51 +18,26 @@ namespace corsika::analytics { template <typename TFunc, typename TClock = std::chrono::high_resolution_clock, typename TDuration = std::chrono::microseconds> - class timeFunction { + class FunctionTimer { private: - typename TClock::time_point vStart; - TDuration vDiff; + typename TClock::time_point start_; + TDuration timeDiff_; - TFunc vFunction; + TFunc function_; public: - timeFunction(TFunc f) - : vFunction(f) {} + FunctionTimer(TFunc f) + : function_(f) {} template <typename... TArgs> auto operator()(TArgs&&... args) -> std::invoke_result_t<TFunc, TArgs...> { - vStart = TClock::now(); - auto tmp = vFunction(std::forward<TArgs>(args)...); - vDiff = std::chrono::duration_cast<TDuration>(TClock::now() - vStart); + start_ = TClock::now(); + auto tmp = function_(std::forward<TArgs>(args)...); + timeDiff_ = std::chrono::duration_cast<TDuration>(TClock::now() - start_); return tmp; } - inline TDuration getTime() const { return vDiff; } + inline TDuration getTime() const { return timeDiff_; } }; - /* - template <typename TClass, typename TClock = std::chrono::high_resolution_clock, - typename TDuration = std::chrono::microseconds> - class timeProxy : public TClass { - private: - typename TClock::time_point vStart; - TDuration vDiff; - - TClass& vObj; - - //template <typename F, typename... Args> - //decltype(auto) call_func(F func, Args&&... args) { - // return (vObj.*func)(std::forward<Args>(args)...); - //} - - public: - template<typename ... TArgs> - timeProxy(TArgs args) : TClass<TArgs...>(std::forward<TArgs>(args)...) - {} - - auto operator->() {return 2;} - - inline TDuration getTime() const { return vDiff; } - };*/ - } // namespace corsika::analytics diff --git a/Framework/Analytics/testClassTimer.cc b/Framework/Analytics/testClassTimer.cc index 6e53a93630efab1ba34874fe4eb9ea4f7529ca7d..290eabc0e3e8362c126ca2b6a13ee3b47e1b19b8 100644 --- a/Framework/Analytics/testClassTimer.cc +++ b/Framework/Analytics/testClassTimer.cc @@ -35,7 +35,7 @@ public: return 31415; } - void bar2(int i) { + void bar2(int) { std::this_thread::sleep_for(std::chrono::milliseconds(100)); return; } @@ -46,7 +46,7 @@ public: } int inside() { - auto tc = corsika::analytics::timeClass<int (_foo1::*)(int), &_foo1::inside>(*this); + auto tc = corsika::analytics::ClassTimer<int (_foo1::*)(int), &_foo1::inside>(*this); auto r = tc.call(1); @@ -61,13 +61,13 @@ template <typename TType, typename TRet, typename... TArgs, TRet (TType::*TFuncPtr)(TArgs...)> class timeMin<TRet (TType::*)(TArgs...), TFuncPtr> { private: - TType& vObj; + TType& obj_; public: timeMin(TType& obj) - : vObj(obj) {} + : obj_(obj) {} - TRet call(TArgs... args) { return (vObj.*TFuncPtr)(std::forward<TArgs>(args)...); } + TRet call(TArgs... args) { return (obj_.*TFuncPtr)(std::forward<TArgs>(args)...); } }; // quasi processor @@ -106,7 +106,7 @@ TEST_CASE("Analytics", "[Timer]") { SECTION("Measure runtime of a function without arguments") { auto test = foo(); - auto tc = corsika::analytics::timeClass<decltype(&foo::bar), &foo::bar>(test); + auto tc = corsika::analytics::ClassTimer<decltype(&foo::bar), &foo::bar>(test); tc.call(); @@ -116,7 +116,7 @@ TEST_CASE("Analytics", "[Timer]") { SECTION("Measure runtime of a function with arguments") { auto test = foo(); - auto tc = corsika::analytics::timeClass<decltype(&foo::bar2), &foo::bar2>(test); + auto tc = corsika::analytics::ClassTimer<decltype(&foo::bar2), &foo::bar2>(test); tc.call(1); @@ -127,7 +127,7 @@ TEST_CASE("Analytics", "[Timer]") { auto test = foo(); auto tc = - corsika::analytics::timeClass<decltype(&foo::bar_const), &foo::bar_const>(test); + corsika::analytics::ClassTimer<decltype(&foo::bar_const), &foo::bar_const>(test); tc.call(); diff --git a/Framework/Analytics/testFunctionTimer.cc b/Framework/Analytics/testFunctionTimer.cc index b822bd94a9dc5df0c11dce3dc905f929348e206c..fcdb08d0b043a144bac4a062029d3ae40281709c 100644 --- a/Framework/Analytics/testFunctionTimer.cc +++ b/Framework/Analytics/testFunctionTimer.cc @@ -21,7 +21,7 @@ int testFunc() { return 31415; } -class testClass { +class TestClass { public: int operator()() { @@ -33,15 +33,15 @@ public: TEST_CASE("Analytics", "[Timer]") { SECTION("Measure runtime of a free function") { - auto test = corsika::analytics::timeFunction(testFunc); + auto test = corsika::analytics::FunctionTimer(testFunc); std::cout << test() << std::endl; std::cout << test.getTime().count() << std::endl; } SECTION("Measure runtime of a class functor") { - testClass testC; - auto test = corsika::analytics::timeFunction(testC); + TestClass testC; + auto test = corsika::analytics::FunctionTimer(testC); std::cout << test() << std::endl; std::cout << test.getTime().count() << std::endl; diff --git a/Framework/ProcessSequence/BaseProcess.h b/Framework/ProcessSequence/BaseProcess.h index b1294d64fbba7a2d082b8f6ea72de5c484d06d42..193b6db287e74c41784dbfc0ea61545d38bd5120 100644 --- a/Framework/ProcessSequence/BaseProcess.h +++ b/Framework/ProcessSequence/BaseProcess.h @@ -35,6 +35,9 @@ namespace corsika::process { TDerived& GetRef() { return static_cast<TDerived&>(*this); } const TDerived& GetRef() const { return static_cast<const TDerived&>(*this); } + + public: + using TProcessType = TDerived; }; } // namespace corsika::process diff --git a/Framework/ProcessSequence/BoundaryCrossingProcess.h b/Framework/ProcessSequence/BoundaryCrossingProcess.h index b5906f4d9d1782907fbe516269ec89bba4dcc5ce..3aeb9ab3a50d62602235ab621ae179d47c7f0713 100644 --- a/Framework/ProcessSequence/BoundaryCrossingProcess.h +++ b/Framework/ProcessSequence/BoundaryCrossingProcess.h @@ -19,8 +19,7 @@ namespace corsika::process { class BoundaryCrossingProcess : public BaseProcess<TDerived> { private: protected: - public: - using _TDerived = TDerived; + public: /** * This method is called when a particle crosses the boundary between the nodes diff --git a/Framework/ProcessSequence/ContinuousProcess.h b/Framework/ProcessSequence/ContinuousProcess.h index 9969e149ea460998a636908ca05afdc678c6e350..6c45a07a77ed921ae8e9a89f1f6e4c05472ab0b6 100644 --- a/Framework/ProcessSequence/ContinuousProcess.h +++ b/Framework/ProcessSequence/ContinuousProcess.h @@ -27,8 +27,7 @@ namespace corsika::process { class ContinuousProcess : public BaseProcess<TDerived> { private: protected: - public: - using _TDerived = TDerived; + public: // here starts the interface part // -> enforce TDerived to implement DoContinuous... diff --git a/Framework/ProcessSequence/DecayProcess.h b/Framework/ProcessSequence/DecayProcess.h index 26995467a509baa8a529080a03c3e520b7fce2ea..24a9c455c3346a9561661328b45a040074143b04 100644 --- a/Framework/ProcessSequence/DecayProcess.h +++ b/Framework/ProcessSequence/DecayProcess.h @@ -26,8 +26,7 @@ namespace corsika::process { template <typename TDerived> struct DecayProcess : BaseProcess<TDerived> { - public: - using _TDerived = TDerived; + public: using BaseProcess<TDerived>::GetRef; diff --git a/Framework/ProcessSequence/InteractionProcess.h b/Framework/ProcessSequence/InteractionProcess.h index 4cc3f74430547597a0e051c943662144b8e0c251..ba12d030476fd6926af6c962aa7059725f0f8cc5 100644 --- a/Framework/ProcessSequence/InteractionProcess.h +++ b/Framework/ProcessSequence/InteractionProcess.h @@ -26,8 +26,7 @@ namespace corsika::process { template <typename TDerived> class InteractionProcess : public BaseProcess<TDerived> { - public: - using _TDerived = TDerived; + public: using BaseProcess<TDerived>::GetRef; diff --git a/Framework/ProcessSequence/SecondariesProcess.h b/Framework/ProcessSequence/SecondariesProcess.h index 604551333b0bb3dcbec09c5d01fea38d1dc66322..03b2ca82b57049d64d4e4b270946df88345241d8 100644 --- a/Framework/ProcessSequence/SecondariesProcess.h +++ b/Framework/ProcessSequence/SecondariesProcess.h @@ -27,8 +27,7 @@ namespace corsika::process { template <typename TDerived> class SecondariesProcess : public BaseProcess<TDerived> { public: - using _TDerived = TDerived; - + /// here starts the interface-definition part // -> enforce TDerived to implement DoSecondaries... template <typename TSecondaries> diff --git a/Framework/ProcessSequence/StackProcess.h b/Framework/ProcessSequence/StackProcess.h index 3cb33952f9c6a1a0b1b9770fa64e9affcba33ccc..f5713ff675e45f2b3b66eda4b80344b13315a1cb 100644 --- a/Framework/ProcessSequence/StackProcess.h +++ b/Framework/ProcessSequence/StackProcess.h @@ -29,8 +29,7 @@ namespace corsika::process { private: protected: public: - using _TDerived = TDerived; - + StackProcess() = delete; StackProcess(const unsigned int nStep) : fNStep(nStep) {} diff --git a/Processes/AnalyticProcessors/CMakeLists.txt b/Processes/AnalyticProcessors/CMakeLists.txt index e019694c7a62f7ab0056308c82341c76ee1ec454..874c714de11efbd3665cf30f93ed7a150ce3a527 100644 --- a/Processes/AnalyticProcessors/CMakeLists.txt +++ b/Processes/AnalyticProcessors/CMakeLists.txt @@ -5,6 +5,7 @@ set ( set ( MODEL_HEADERS ExecTime.h + ExecTimeImpl.h ImplBoundary.h ImplContinuous.h ImplDecay.h diff --git a/Processes/AnalyticProcessors/ExecTime.h b/Processes/AnalyticProcessors/ExecTime.h index 8f40bc31d3d1cbc9f380c1ec1af759723dacd7bb..d8faaddfebc40a70b8c1d7ac7beb1b9e56e985c6 100644 --- a/Processes/AnalyticProcessors/ExecTime.h +++ b/Processes/AnalyticProcessors/ExecTime.h @@ -29,89 +29,33 @@ namespace corsika::process { namespace analytic_processors { - template <typename T> - class _ExecTimeImpl : protected T { - private: - std::chrono::high_resolution_clock::time_point startTime_; - std::chrono::duration<double, std::micro> cumulatedTime_; - volatile double mean_; - volatile double mean2_; - volatile double min_; - volatile double max_; - volatile long long n_; - - protected: - public: - using _T = T; - - _ExecTimeImpl() { - min_ = std::numeric_limits<double>::max(); - cumulatedTime_ = std::chrono::duration<double, std::micro>(0); - max_ = 0; - mean_ = 0; - mean2_ = 0; - n_ = 0; - } - - inline void start() { startTime_ = std::chrono::high_resolution_clock::now(); } - inline void stop() { - auto end = std::chrono::high_resolution_clock::now(); - std::chrono::duration<double, std::micro> timeDiv = - std::chrono::duration_cast<std::chrono::duration<double, std::micro> >( - end - startTime_); - - this->update(timeDiv); - } - - void update(std::chrono::duration<double, std::micro> timeDif) { - - cumulatedTime_ += timeDif; - n_ = n_ + 1; - - if (max_ < timeDif.count()) max_ = timeDif.count(); - - if (timeDif.count() < min_) min_ = timeDif.count(); - - double delta = timeDif.count() - mean_; - mean_ += delta / static_cast<double>(n_); - - double delta2 = timeDif.count() - mean_; - - mean2_ += delta * delta2; - } - - inline double mean() const { return mean_; } - inline double min() const { return min_; } - inline double max() const { return max_; } - inline double var() const { return mean2_ / n_; } - inline double sumTime() const { return cumulatedTime_.count(); } - }; - template <typename T> class ExecTime : public Boundary<T, std::is_base_of<corsika::process::BoundaryCrossingProcess< - typename T::_TDerived>, + typename T::TProcessType>, T>::value>, public Continuous< T, - std::is_base_of<corsika::process::ContinuousProcess<typename T::_TDerived>, + std::is_base_of<corsika::process::ContinuousProcess<typename T::TProcessType>, T>::value>, public Decay< - T, std::is_base_of<corsika::process::DecayProcess<typename T::_TDerived>, + T, std::is_base_of<corsika::process::DecayProcess<typename T::TProcessType>, T>::value>, public Interaction< T, - std::is_base_of<corsika::process::InteractionProcess<typename T::_TDerived>, + std::is_base_of<corsika::process::InteractionProcess<typename T::TProcessType>, T>::value>, public Secondaries< T, - std::is_base_of<corsika::process::SecondariesProcess<typename T::_TDerived>, - T>::value> { - static_assert(std::is_base_of<corsika::process::_BaseProcess,T>::value, "error message"); + std::is_base_of<corsika::process::SecondariesProcess<typename T::TProcessType>, + T>::value> { + static_assert(std::is_base_of<corsika::process::_BaseProcess, T>::value, + "error message"); public: - ~ExecTime(){ - C8LOG_INFO("Accumulated time spend in process {} is {} µs", typeid(T).name(), this->sumTime()); + ~ExecTime() { + C8LOG_INFO("Accumulated time spend in process {} is {} µs", typeid(T).name(), + this->sumTime()); } }; } // namespace analytic_processors diff --git a/Processes/AnalyticProcessors/ExecTimeImpl.h b/Processes/AnalyticProcessors/ExecTimeImpl.h new file mode 100644 index 0000000000000000000000000000000000000000..11a11ebd901c8a1c22b2606a71cc69ba0dec8254 --- /dev/null +++ b/Processes/AnalyticProcessors/ExecTimeImpl.h @@ -0,0 +1,95 @@ +/* + * (c) Copyright 2020 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 <chrono> +#include <type_traits> + +#include <corsika/logging/Logging.h> + +#include <corsika/process/BoundaryCrossingProcess.h> +#include <corsika/process/ContinuousProcess.h> +#include <corsika/process/DecayProcess.h> +#include <corsika/process/InteractionProcess.h> +#include <corsika/process/SecondariesProcess.h> +#include <corsika/process/StackProcess.h> + +#include <corsika/process/analytic_processors/ImplBoundary.h> +#include <corsika/process/analytic_processors/ImplContinuous.h> +#include <corsika/process/analytic_processors/ImplDecay.h> +#include <corsika/process/analytic_processors/ImplInteraction.h> +#include <corsika/process/analytic_processors/ImplSecondaries.h> + +namespace corsika::process { + namespace analytic_processors { + + namespace detail { + + template <typename T> + class ExecTimeImpl : protected T { + private: + std::chrono::high_resolution_clock::time_point startTime_; + std::chrono::duration<double, std::micro> cumulatedTime_; + volatile double mean_; + volatile double mean2_; + volatile double min_; + volatile double max_; + volatile long long n_; + + protected: + public: + using _T = T; + + ExecTimeImpl() { + min_ = std::numeric_limits<double>::max(); + cumulatedTime_ = std::chrono::duration<double, std::micro>(0); + max_ = 0; + mean_ = 0; + mean2_ = 0; + n_ = 0; + } + + inline void start() { startTime_ = std::chrono::high_resolution_clock::now(); } + inline void stop() { + auto end = std::chrono::high_resolution_clock::now(); + std::chrono::duration<double, std::micro> timeDiv = + std::chrono::duration_cast<std::chrono::duration<double, std::micro> >( + end - startTime_); + + this->update(timeDiv); + } + + void update(std::chrono::duration<double, std::micro> timeDif) { + + cumulatedTime_ += timeDif; + n_ = n_ + 1; + + if (max_ < timeDif.count()) max_ = timeDif.count(); + + if (timeDif.count() < min_) min_ = timeDif.count(); + + double delta = timeDif.count() - mean_; + mean_ += delta / static_cast<double>(n_); + + double delta2 = timeDif.count() - mean_; + + mean2_ += delta * delta2; + } + + inline double mean() const { return mean_; } + inline double min() const { return min_; } + inline double max() const { return max_; } + inline double var() const { return mean2_ / n_; } + inline double sumTime() const { return cumulatedTime_.count(); } + }; + + } // namespace detail + + } // namespace analytic_processors +} // namespace corsika::process \ No newline at end of file diff --git a/Processes/AnalyticProcessors/ImplBoundary.h b/Processes/AnalyticProcessors/ImplBoundary.h index ff491fc3a66a8d42d2cb1a0016b6156eeee2bafa..accdf0d44f91d23709f8f3574bcca8445a6d3e89 100644 --- a/Processes/AnalyticProcessors/ImplBoundary.h +++ b/Processes/AnalyticProcessors/ImplBoundary.h @@ -7,15 +7,17 @@ */ #pragma once -#include <corsika/process/analytic_processors/ExecTime.h> +#include <corsika/process/analytic_processors/ExecTimeImpl.h> #include <corsika/analytics/ClassTimer.h> namespace corsika::process { namespace analytic_processors { - template <typename T> - class _ExecTimeImpl; + namespace detail { + template <typename T> + class ExecTimeImpl; + } template <class T, bool TCheck> class Boundary; @@ -24,16 +26,16 @@ namespace corsika::process { class Boundary<T, false> {}; template <class T> - class Boundary<T, true> : public _ExecTimeImpl<T> { + class Boundary<T, true> : public detail::ExecTimeImpl<T> { private: public: - template <typename Particle, typename VTNType> EProcessReturn DoBoundaryCrossing(Particle& p, VTNType const& from, - VTNType const& to) { - auto tc = corsika::analytics::timeClass< - EProcessReturn (_ExecTimeImpl<T>::_T::*)(Particle&, VTNType const&, VTNType const&), - &_ExecTimeImpl<T>::_T::template DoBoundaryCrossing<Particle, VTNType>>(*this); + VTNType const& to) { + auto tc = corsika::analytics::ClassTimer< + EProcessReturn (detail::ExecTimeImpl<T>::_T::*)(Particle&, VTNType const&, + VTNType const&), + &detail::ExecTimeImpl<T>::_T::template DoBoundaryCrossing<Particle, VTNType>>(*this); EProcessReturn r = tc.call(p, from, to); this->update( diff --git a/Processes/AnalyticProcessors/ImplContinuous.h b/Processes/AnalyticProcessors/ImplContinuous.h index 21b21ad6b9e84076da8ceab74e3d114a1c023add..9ff63149189fe9c4ce1e3316a622f14158ce345f 100644 --- a/Processes/AnalyticProcessors/ImplContinuous.h +++ b/Processes/AnalyticProcessors/ImplContinuous.h @@ -8,12 +8,15 @@ #pragma once #include <corsika/process/ContinuousProcess.h> -#include <corsika/process/analytic_processors/ExecTime.h> +#include <corsika/process/analytic_processors/ExecTimeImpl.h> namespace corsika::process { namespace analytic_processors { - template <typename T> - class _ExecTimeImpl; + + namespace detail { + template <typename T> + class ExecTimeImpl; + } template <class T, bool TCheck> class Continuous; @@ -22,13 +25,13 @@ namespace corsika::process { class Continuous<T, false> {}; template <class T> - class Continuous<T, true> : public _ExecTimeImpl<T> { + class Continuous<T, true> : public detail::ExecTimeImpl<T> { private: public: template <typename Particle, typename Track> EProcessReturn DoContinuous(Particle& p, Track const& t) { this->start(); - auto r = _ExecTimeImpl<T>::DoContinuous(p, t); + auto r = detail::ExecTimeImpl<T>::DoContinuous(p, t); this->stop(); return r; } diff --git a/Processes/AnalyticProcessors/ImplDecay.h b/Processes/AnalyticProcessors/ImplDecay.h index e24ec159ffa3fb02b1a991ff190142192129f492..786b1a951ae251b0a53f431d0bf67d1e6f661c3e 100644 --- a/Processes/AnalyticProcessors/ImplDecay.h +++ b/Processes/AnalyticProcessors/ImplDecay.h @@ -8,12 +8,15 @@ #pragma once #include <corsika/process/DecayProcess.h> -#include <corsika/process/analytic_processors/ExecTime.h> +#include <corsika/process/analytic_processors/ExecTimeImpl.h> namespace corsika::process { namespace analytic_processors { - template <typename T> - class _ExecTimeImpl; + + namespace detail { + template <typename T> + class ExecTimeImpl; + } template <class T, bool TCheck> class Decay; @@ -22,13 +25,13 @@ namespace corsika::process { class Decay<T, false> {}; template <class T> - class Decay<T, true> : public _ExecTimeImpl<T> { + class Decay<T, true> : public detail::ExecTimeImpl<T> { private: public: template <typename Particle> EProcessReturn DoDecay(Particle& p) { this->start(); - auto r = _ExecTimeImpl<T>::DoDecay(p); + auto r = detail::ExecTimeImpl<T>::DoDecay(p); this->stop(); return r; } diff --git a/Processes/AnalyticProcessors/ImplInteraction.h b/Processes/AnalyticProcessors/ImplInteraction.h index cf67865417d8dfee4c7ab80bc9b1de345e8cb6e6..7b9977fa62ef93a022ce790759d43621e391422e 100644 --- a/Processes/AnalyticProcessors/ImplInteraction.h +++ b/Processes/AnalyticProcessors/ImplInteraction.h @@ -8,12 +8,15 @@ #pragma once #include <corsika/process/InteractionProcess.h> -#include <corsika/process/analytic_processors/ExecTime.h> +#include <corsika/process/analytic_processors/ExecTimeImpl.h> namespace corsika::process { namespace analytic_processors { - template <typename T> - class _ExecTimeImpl; + + namespace detail { + template <typename T> + class ExecTimeImpl; + } template <class T, bool TCheck> class Interaction; @@ -22,13 +25,13 @@ namespace corsika::process { class Interaction<T, false> {}; template <class T> - class Interaction<T, true> : public _ExecTimeImpl<T> { + class Interaction<T, true> : public detail::ExecTimeImpl<T> { private: public: template <typename Particle> EProcessReturn DoInteraction(Particle& p) { this->start(); - auto r = _ExecTimeImpl<T>::DoInteraction(p); + auto r = detail::ExecTimeImpl<T>::DoInteraction(p); this->stop(); return r; } diff --git a/Processes/AnalyticProcessors/ImplSecondaries.h b/Processes/AnalyticProcessors/ImplSecondaries.h index 42ceea871a15df5a3f1b4b830de1f4a30e28cacd..9e104a945037f5ab1ea26af61a7b3000abcb7b8b 100644 --- a/Processes/AnalyticProcessors/ImplSecondaries.h +++ b/Processes/AnalyticProcessors/ImplSecondaries.h @@ -8,12 +8,15 @@ #pragma once #include <corsika/process/SecondariesProcess.h> -#include <corsika/process/analytic_processors/ExecTime.h> +#include <corsika/process/analytic_processors/ExecTimeImpl.h> namespace corsika::process { namespace analytic_processors { - template <typename T> - class _ExecTimeImpl; + + namespace detail { + template <typename T> + class ExecTimeImpl; + } template <class T, bool TCheck> class Secondaries; @@ -22,13 +25,13 @@ namespace corsika::process { class Secondaries<T, false> {}; template <class T> - class Secondaries<T, true> : public _ExecTimeImpl<T> { + class Secondaries<T, true> : public detail::ExecTimeImpl<T> { private: public: template <typename Secondaries> inline EProcessReturn DoSecondaries(Secondaries& sec) { this->start(); - auto r = _ExecTimeImpl<T>::DoSecondaries(sec); + auto r = detail::ExecTimeImpl<T>::DoSecondaries(sec); this->stop(); return r; }