CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
DummyStack.hpp
1 /*
2  * (c) Copyright 2018 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 
14 
15 #include <string>
16 #include <tuple>
17 
18 namespace corsika::dummy_stack {
19 
29  struct NoData { /* nothing */
30  int nothing = 0;
31  };
32 
33  template <typename StackIteratorInterface>
34  struct ParticleInterface : public corsika::ParticleBase<StackIteratorInterface> {
35 
37 
38  public:
39  void setParticleData(const std::tuple<NoData>& /*v*/) {}
40  void setParticleData(super_type& /*parent*/, const std::tuple<NoData>& /*v*/) {}
41 
42  std::string asString() const { return "dummy-data"; }
43  };
44 
51 
52  public:
53  DummyStackImpl() = default;
54 
55  DummyStackImpl(DummyStackImpl const&) = default;
56 
57  DummyStackImpl(DummyStackImpl&&) = default;
58 
59  DummyStackImpl& operator=(DummyStackImpl const&) = default;
60  DummyStackImpl& operator=(DummyStackImpl&&) = default;
61 
62  void init() { entries_ = 0; }
63 
64  void clear() { entries_ = 0; }
65 
66  int getSize() const { return entries_; }
67  int getCapacity() const { return entries_; }
68 
72  void copy(const int /*i1*/, const int /*i2*/) {}
73 
74  void swap(const int, const int) {}
75 
76  void incrementSize() { entries_++; }
77  void decrementSize() { entries_--; }
78 
79  int getEntries() const { return entries_; }
80  void setEntries(int entries = 0) { entries_ = entries; }
81 
82  private:
83  int entries_ = 0;
84 
85  }; // end class DummyStackImpl
86 
88 
89 } // namespace corsika::dummy_stack
Import and extend the phys::units package.
Memory implementation of the most simple (no-data) particle stack object.
Definition: DummyStack.hpp:50
void copy(const int, const int)
Function to copy particle at location i2 in stack to i1.
Definition: DummyStack.hpp:72
The Stack class provides (and connects) the main particle data storage machinery. ...
Definition: Stack.hpp:77
Example of a particle object on the stack, with NO DATA.
Definition: DummyStack.hpp:29
Description of particle stacks.
Interface to particle properties.
The base class to define the readout of particle properties from a particle stack.