CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
BaseVector.hpp
1 /*
2  * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
12 #include <corsika/framework/geometry/QuantityVector.hpp>
13 
14 #include <memory>
15 
16 namespace corsika {
17 
25  template <typename TDimension>
26  class BaseVector {
27 
28  public:
29  BaseVector(CoordinateSystemPtr const& pCS, QuantityVector<TDimension> const& pQVector)
30  : quantityVector_(pQVector)
31  , cs_(pCS) {}
32 
33  BaseVector() = delete; // we only want to creat initialized
34  // objects
35  BaseVector(BaseVector const&) = default;
36  BaseVector(BaseVector&& a) = default;
37  BaseVector& operator=(BaseVector const&) = default;
38  ~BaseVector() = default;
39 
40  CoordinateSystemPtr getCoordinateSystem() const;
41  void setCoordinateSystem(CoordinateSystemPtr const& cs) { cs_ = cs; }
42 
43  protected:
44  QuantityVector<TDimension> const& getQuantityVector() const;
45  QuantityVector<TDimension>& getQuantityVector();
46  void setQuantityVector(QuantityVector<TDimension> const& v) { quantityVector_ = v; }
47 
48  private:
49  QuantityVector<TDimension> quantityVector_;
51  };
52 
53 } // namespace corsika
54 
55 #include <corsika/detail/framework/geometry/BaseVector.inl>
`, since they are used everywhere as integral part of the framework.
std::shared_ptr< CoordinateSystem const > CoordinateSystemPtr
To refer to CoordinateSystems, only the CoordinateSystemPtr must be used.