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
11
#include <
corsika/framework/core/ParticleProperties.hpp
>
12
#include <
corsika/framework/core/PhysicalUnits.hpp
>
13
#include <
corsika/framework/stack/Stack.hpp
>
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
36
typedef
corsika::ParticleBase<StackIteratorInterface>
super_type
;
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
50
class
DummyStackImpl
{
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
87
typedef
Stack<DummyStackImpl, ParticleInterface>
DummyStack
;
88
89
}
// namespace corsika::dummy_stack
corsika::dummy_stack::ParticleInterface
Definition:
DummyStack.hpp:34
PhysicalUnits.hpp
Import and extend the phys::units package.
corsika::dummy_stack::DummyStackImpl
Memory implementation of the most simple (no-data) particle stack object.
Definition:
DummyStack.hpp:50
corsika::dummy_stack::DummyStackImpl::copy
void copy(const int, const int)
Function to copy particle at location i2 in stack to i1.
Definition:
DummyStack.hpp:72
corsika::Stack
The Stack class provides (and connects) the main particle data storage machinery. ...
Definition:
Stack.hpp:77
corsika::dummy_stack::NoData
Example of a particle object on the stack, with NO DATA.
Definition:
DummyStack.hpp:29
Stack.hpp
Description of particle stacks.
ParticleProperties.hpp
Interface to particle properties.
corsika::ParticleBase
The base class to define the readout of particle properties from a particle stack.
Definition:
ParticleBase.hpp:43
corsika::dummy_stack
Definition:
DummyStack.hpp:18
corsika
stack
DummyStack.hpp
Generated by
1.8.13