From 11d3010d36a1a921863c70572630d6a234cd31e2 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Fri, 12 Oct 2018 23:04:42 +0200 Subject: [PATCH] extra BaseProcess header --- Framework/ProcessSequence/BaseProcess.h | 25 +++++++++++++++++++++ Framework/ProcessSequence/CMakeLists.txt | 1 + Framework/ProcessSequence/ProcessSequence.h | 20 ++++------------- Processes/StackInspector/StackInspector.h | 2 +- 4 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 Framework/ProcessSequence/BaseProcess.h diff --git a/Framework/ProcessSequence/BaseProcess.h b/Framework/ProcessSequence/BaseProcess.h new file mode 100644 index 000000000..5f6012202 --- /dev/null +++ b/Framework/ProcessSequence/BaseProcess.h @@ -0,0 +1,25 @@ +#ifndef _include_corsika_baseprocess_h_ +#define _include_corsika_baseprocess_h_ + +#include <corsika/process/ProcessReturn.h> // for convenience + +namespace corsika::process { + + /** + \class BaseProcess + + The structural base type of a process object in a + ProcessSequence. Both, the ProcessSequence and all its elements + are of type BaseProcess<T> + + */ + + template <typename derived> + struct BaseProcess { + derived& GetRef() { return static_cast<derived&>(*this); } + const derived& GetRef() const { return static_cast<const derived&>(*this); } + }; + +} + +#endif diff --git a/Framework/ProcessSequence/CMakeLists.txt b/Framework/ProcessSequence/CMakeLists.txt index 9852db42b..f0e14f729 100644 --- a/Framework/ProcessSequence/CMakeLists.txt +++ b/Framework/ProcessSequence/CMakeLists.txt @@ -10,6 +10,7 @@ set ( #header files of this library set ( CORSIKAprocesssequence_HEADERS + BaseProcess.h ProcessSequence.h ProcessReturn.h ) diff --git a/Framework/ProcessSequence/ProcessSequence.h b/Framework/ProcessSequence/ProcessSequence.h index 4b2fc83c2..9afe793f2 100644 --- a/Framework/ProcessSequence/ProcessSequence.h +++ b/Framework/ProcessSequence/ProcessSequence.h @@ -12,6 +12,7 @@ #ifndef _include_ProcessSequence_h_ #define _include_ProcessSequence_h_ +#include <corsika/process/BaseProcess.h> #include <corsika/process/ProcessReturn.h> #include <cmath> @@ -20,21 +21,6 @@ namespace corsika::process { - /** - \class BaseProcess - - The structural base type of a process object in a - ProcessSequence. Both, the ProcessSequence and all its elements - are of type BaseProcess<T> - - */ - - template <typename derived> - struct BaseProcess { - derived& GetRef() { return static_cast<derived&>(*this); } - const derived& GetRef() const { return static_cast<const derived&>(*this); } - }; - /** \class ProcessSequence @@ -69,6 +55,7 @@ namespace corsika::process { return std::min(A.MinStepLength(d), B.MinStepLength(d)); } + /* template <typename Particle, typename Trajectory> inline Trajectory Transport(Particle& p, double& length) const { A.Transport(p, length); // todo: maybe check (?) if there is more than one Transport @@ -76,7 +63,8 @@ namespace corsika::process { return B.Transport( p, length); // need to do this also to decide which Trajectory to return!!!! } - + */ + template <typename Particle, typename Stack> void DoDiscrete(Particle& p, Stack& s) const { A.DoDiscrete(p, s); diff --git a/Processes/StackInspector/StackInspector.h b/Processes/StackInspector/StackInspector.h index 312717769..1d9436cb1 100644 --- a/Processes/StackInspector/StackInspector.h +++ b/Processes/StackInspector/StackInspector.h @@ -1,7 +1,7 @@ #ifndef _Physics_StackInspector_StackInspector_h_ #define _Physics_StackInspector_StackInspector_h_ -#include <corsika/process/ProcessSequence.h> +#include <corsika/process/BaseProcess.h> namespace corsika::process { -- GitLab