From 91576eb2c5953b829cc863f15fa6af2ea05a9b1a Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Tue, 10 Nov 2020 10:10:19 +0100 Subject: [PATCH] added missing file --- Environment/IEmpty.hpp | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Environment/IEmpty.hpp diff --git a/Environment/IEmpty.hpp b/Environment/IEmpty.hpp new file mode 100644 index 000000000..e4e65da2c --- /dev/null +++ b/Environment/IEmpty.hpp @@ -0,0 +1,45 @@ +/* + * (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 <corsika/units/PhysicalUnits.h> +#include <corsika/geometry/Trajectory.h> + +namespace corsika::environment { + + /** + * \class IEmpty + * + * intended for usage as default template argument for environments + * with no properties. For now, the ArclengthFromGrammage is + * mandatory, since it is used even in the most simple Cascade code. + * + * - IEmpty is the interface definition. + * - Empty<IEmpty> is a possible model implementation + * + **/ + + class IEmpty { + public: + virtual corsika::units::si::LengthType ArclengthFromGrammage( + corsika::geometry::LineTrajectory const&, + corsika::units::si::GrammageType) const = 0; + }; + + template <typename TModel = IEmpty> + class Empty : public TModel { + public: + corsika::units::si::LengthType ArclengthFromGrammage( + corsika::geometry::LineTrajectory const&, + corsika::units::si::GrammageType) const { + return 0. * corsika::units::si::meter; + } + }; + +} // namespace corsika::environment -- GitLab