IAP GITLAB

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

format...

parent 4ca1bb8a
No related branches found
No related tags found
1 merge request!6848 particle creator
...@@ -8,4 +8,3 @@ ...@@ -8,4 +8,3 @@
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license. * the license.
*/ */
...@@ -24,7 +24,7 @@ namespace corsika::stack { ...@@ -24,7 +24,7 @@ namespace corsika::stack {
class Stack; // forward decl class Stack; // forward decl
/** /**
@class StackIteratorInterface @class StackIteratorInterface
The StackIteratorInterface is the main interface to iterator over The StackIteratorInterface is the main interface to iterator over
particles on a stack. At the same time StackIteratorInterface is a particles on a stack. At the same time StackIteratorInterface is a
...@@ -71,19 +71,20 @@ namespace corsika::stack { ...@@ -71,19 +71,20 @@ namespace corsika::stack {
StackIteratorInterface() = delete; StackIteratorInterface() = delete;
public: public:
/** iterator must always point to data, with an index: /** iterator must always point to data, with an index:
@param data reference to the stack [rw] @param data reference to the stack [rw]
@param index index on stack @param index index on stack
*/ */
StackIteratorInterface(StackType& data, const int index) StackIteratorInterface(StackType& data, const int index)
: fIndex(index) : fIndex(index)
, fData(&data) {} , fData(&data) {}
/** constructor that also sets new values on particle data object /** constructor that also sets new values on particle data object
@param data reference to the stack [rw] @param data reference to the stack [rw]
@param index index on stack @param index index on stack
@param args variadic list of data to initialize stack entry, this must be consistent @param args variadic list of data to initialize stack entry, this must be
with the definition of the user-provided ParticleInterfaceType::SetParticleData(...) function consistent with the definition of the user-provided
ParticleInterfaceType::SetParticleData(...) function
*/ */
template <typename... Args> template <typename... Args>
StackIteratorInterface(StackType& data, const int index, const Args... args) StackIteratorInterface(StackType& data, const int index, const Args... args)
...@@ -93,12 +94,14 @@ namespace corsika::stack { ...@@ -93,12 +94,14 @@ namespace corsika::stack {
} }
/** constructor that also sets new values on particle data object, including reference /** constructor that also sets new values on particle data object, including reference
to parent particle to parent particle
@param data reference to the stack [rw] @param data reference to the stack [rw]
@param index index on stack @param index index on stack
@param reference to parent particle [rw]. This can be used for thinning, particle counting, history, etc. @param reference to parent particle [rw]. This can be used for thinning, particle
@param args variadic list of data to initialize stack entry, this must be consistent counting, history, etc.
with the definition of the user-provided ParticleInterfaceType::SetParticleData(...) function @param args variadic list of data to initialize stack entry, this must be
consistent with the definition of the user-provided
ParticleInterfaceType::SetParticleData(...) function
*/ */
template <typename... Args> template <typename... Args>
StackIteratorInterface(StackType& data, const int index, StackIteratorInterface(StackType& data, const int index,
...@@ -181,19 +184,19 @@ namespace corsika::stack { ...@@ -181,19 +184,19 @@ namespace corsika::stack {
: fIndex(index) : fIndex(index)
, fData(&data) {} , fData(&data) {}
/** /**
@class ConstStackIteratorInterface @class ConstStackIteratorInterface
The const counterpart of StackIteratorInterface, which is used The const counterpart of StackIteratorInterface, which is used
for read-only iterator access on particle stack: for read-only iterator access on particle stack:
\verbatim \verbatim
for (const auto& p : theStack) { E += p.GetEnergy(); } for (const auto& p : theStack) { E += p.GetEnergy(); }
\endverbatim \endverbatim
See documentation of StackIteratorInterface for more details.
*/
See documentation of StackIteratorInterface for more details.
*/
public: public:
/** @name Iterator interface /** @name Iterator interface
*/ */
...@@ -218,17 +221,15 @@ namespace corsika::stack { ...@@ -218,17 +221,15 @@ namespace corsika::stack {
return static_cast<const ParticleInterfaceType&>(*this); return static_cast<const ParticleInterfaceType&>(*this);
} }
///@} ///@}
protected: protected:
/** @name Stack data access /** @name Stack data access
Only the const versions for read-only access Only the const versions for read-only access
*/ */
///@{ ///@{
inline int GetIndex() const { return fIndex; } inline int GetIndex() const { return fIndex; }
inline const StackType& GetStack() const { return *fData; } inline const StackType& GetStack() const { return *fData; }
inline const StackData& GetStackData() const { inline const StackData& GetStackData() const { return fData->GetStackData(); }
return fData->GetStackData();
}
///@} ///@}
}; // end class ConstStackIterator }; // end class ConstStackIterator
......
...@@ -8,4 +8,3 @@ ...@@ -8,4 +8,3 @@
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license. * the license.
*/ */
...@@ -8,4 +8,3 @@ ...@@ -8,4 +8,3 @@
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license. * the license.
*/ */
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