IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 11d3010d authored by ralfulrich's avatar ralfulrich
Browse files

extra BaseProcess header

parent c8d72192
No related branches found
No related tags found
No related merge requests found
#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
......@@ -10,6 +10,7 @@ set (
#header files of this library
set (
CORSIKAprocesssequence_HEADERS
BaseProcess.h
ProcessSequence.h
ProcessReturn.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);
......
#ifndef _Physics_StackInspector_StackInspector_h_
#define _Physics_StackInspector_StackInspector_h_
#include <corsika/process/ProcessSequence.h>
#include <corsika/process/BaseProcess.h>
namespace corsika::process {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment