diff --git a/corsika/detail/framework/process/BoundaryCrossingProcess.hpp b/corsika/detail/framework/process/BoundaryCrossingProcess.hpp index 1efd36454579d35b31d9f97421c42ca42a31674c..bf0e64dfa3643d7f7cce6cca61884ff1ab2c5c86 100644 --- a/corsika/detail/framework/process/BoundaryCrossingProcess.hpp +++ b/corsika/detail/framework/process/BoundaryCrossingProcess.hpp @@ -9,6 +9,7 @@ #pragma once #include <corsika/framework/process/ProcessTraits.hpp> +#include <corsika/framework/utility/HasMethodSignature.hpp> namespace corsika { diff --git a/corsika/detail/framework/process/ContinuousProcess.hpp b/corsika/detail/framework/process/ContinuousProcess.hpp index 451f45a68be3c592e3ac4d68e58f78cab7f682d3..68e5185bbdd55115d6e5174ee208ef4b6e3c9c70 100644 --- a/corsika/detail/framework/process/ContinuousProcess.hpp +++ b/corsika/detail/framework/process/ContinuousProcess.hpp @@ -9,6 +9,7 @@ #pragma once #include <corsika/framework/process/ProcessTraits.hpp> +#include <corsika/framework/utility/HasMethodSignature.hpp> namespace corsika { diff --git a/corsika/detail/framework/process/DecayProcess.hpp b/corsika/detail/framework/process/DecayProcess.hpp index b5664418a4d6db1692be00294c82d7e224782dbc..048466e1513e140e67de2ba685928ba70a537635 100644 --- a/corsika/detail/framework/process/DecayProcess.hpp +++ b/corsika/detail/framework/process/DecayProcess.hpp @@ -9,6 +9,7 @@ #pragma once #include <corsika/framework/process/ProcessTraits.hpp> +#include <corsika/framework/utility/HasMethodSignature.hpp> namespace corsika { diff --git a/corsika/detail/framework/process/InteractionProcess.hpp b/corsika/detail/framework/process/InteractionProcess.hpp index 8fb157a688c8c4828ea5c0b3eff410af9ad9aa76..2446a385d7beec2424da598585dd89bd70466a5c 100644 --- a/corsika/detail/framework/process/InteractionProcess.hpp +++ b/corsika/detail/framework/process/InteractionProcess.hpp @@ -9,6 +9,7 @@ #pragma once #include <corsika/framework/process/ProcessTraits.hpp> +#include <corsika/framework/utility/HasMethodSignature.hpp> namespace corsika { @@ -45,7 +46,7 @@ namespace corsika { //! @} }; - //! @file BoundaryCrossingProcess.hpp + //! @file InteractionProcess.hpp //! value traits type template <class TProcess, typename TReturn, typename... TArgs> bool constexpr has_method_doInteract_v = @@ -85,7 +86,7 @@ namespace corsika { //! @} }; - //! @file BoundaryCrossingProcess.hpp + //! @file InteractionProcess.hpp //! value traits type template <class TProcess, typename TReturn, typename... TArgs> diff --git a/corsika/detail/framework/process/SecondariesProcess.hpp b/corsika/detail/framework/process/SecondariesProcess.hpp index 0310bf3dfa2b73826c10c2ad25bf4eb2d4ab5a21..ee76cce853d29f7007d9a82ed88b12e0826a31f6 100644 --- a/corsika/detail/framework/process/SecondariesProcess.hpp +++ b/corsika/detail/framework/process/SecondariesProcess.hpp @@ -9,6 +9,7 @@ #pragma once #include <corsika/framework/process/ProcessTraits.hpp> +#include <corsika/framework/utility/HasMethodSignature.hpp> namespace corsika { diff --git a/corsika/detail/framework/process/StackProcess.hpp b/corsika/detail/framework/process/StackProcess.hpp index 68f350adf1bd1db6cc2be74b329e6a4824b2df07..f06126ed410fef6412b529f0fcc516490212bc18 100644 --- a/corsika/detail/framework/process/StackProcess.hpp +++ b/corsika/detail/framework/process/StackProcess.hpp @@ -9,6 +9,7 @@ #pragma once #include <corsika/framework/process/ProcessTraits.hpp> +#include <corsika/framework/utility/HasMethodSignature.hpp> namespace corsika { diff --git a/corsika/detail/setup/SetupStack.hpp b/corsika/detail/setup/SetupStack.hpp index e58ff5d9c7a7e88450147d8761e22585c1de8512..03016a47ebabcab2d2fd7b087e4f1a8f401b19a0 100644 --- a/corsika/detail/setup/SetupStack.hpp +++ b/corsika/detail/setup/SetupStack.hpp @@ -36,9 +36,9 @@ namespace corsika { CombinedParticleInterface<nuclear_stack::ParticleDataStack::pi_type, SetupGeometryDataInterface, TStackIter>; - using StackWithGeometry = CombinedStack< - typename nuclear_stack::ParticleDataStack::stack_implementation_type, - node::GeometryData<setup::Environment>, StackWithGeometryInterface>; + using StackWithGeometry = + CombinedStack<typename nuclear_stack::ParticleDataStack::stack_data_type, + node::GeometryData<setup::Environment>, StackWithGeometryInterface>; // ------------------------------------------ // Add [optional] history data to stack, too: @@ -50,7 +50,7 @@ namespace corsika { history::HistoryEventDataInterface, TStackIter>; using StackWithHistory = - CombinedStack<typename StackWithGeometry::stack_implementation_type, + CombinedStack<typename StackWithGeometry::stack_data_type, history::HistoryEventData, StackWithHistoryInterface>; } // namespace setup::detail diff --git a/corsika/framework/process/ProcessTraits.hpp b/corsika/framework/process/ProcessTraits.hpp index e675fb1717e0c848b91b78ea6b3e0730d2063cf4..cccd80abaf1a11436befc913eaaf785112c5b123 100644 --- a/corsika/framework/process/ProcessTraits.hpp +++ b/corsika/framework/process/ProcessTraits.hpp @@ -96,33 +96,4 @@ namespace corsika { static unsigned int constexpr count = N; }; - namespace detail { - - /** - Helper traits class (partial) for static compile time checking. - - Note, this is a poor replacement for C++20 concepts... they are - eagerly awaited! - - It defines the default body of a generic test function returning - std::false_type. - - In addition it defines the pattern for class-method matching with a - return type TReturn and function arguments TArgs... . Right now - both method signatures, "const" and "not const", are matched. - */ - template <typename TReturn, typename... TArgs> - struct has_method_signature { - - // the non-const version - template <class T> - static std::true_type testSignature(TReturn (T::*)(TArgs...)); - - // the const version - template <class T> - static std::true_type testSignature(TReturn (T::*)(TArgs...) const); - }; - - } // namespace detail - } // namespace corsika diff --git a/corsika/framework/stack/ParticleBase.hpp b/corsika/framework/stack/ParticleBase.hpp index 2c62285d5fbcd26d4b06841809cd2a0f8bf8a602..3ddb7fba4a5be42499899faed4bb87b657ed0bdf 100644 --- a/corsika/framework/stack/ParticleBase.hpp +++ b/corsika/framework/stack/ParticleBase.hpp @@ -8,6 +8,7 @@ #pragma once +#include <type_traits> #include <cstdlib> // for size_t namespace corsika { @@ -17,8 +18,8 @@ namespace corsika { particle stack. Every stack must implement this readout via the ParticleBase class. - The StackIterator template argument is derived from StackIteratorInterface, which is of - type <code> template <typename StackData, template <typename> typename + The TStackIterator template argument is derived from StackIteratorInterface, which is + of type <code> template <typename StackData, template <typename> typename ParticleInterface> class StackIteratorInterface : public ParticleInterface<StackIteratorInterface<StackData, ParticleInterface>> </code> @@ -38,11 +39,11 @@ namespace corsika { */ - template <typename StackIterator> + template <typename TStackIterator> class ParticleBase { public: - typedef StackIterator stack_iterator_type; + typedef TStackIterator stack_iterator_type; ParticleBase() = default; @@ -75,14 +76,13 @@ namespace corsika { */ template <typename... TArgs> stack_iterator_type addSecondary(const TArgs... args) { - return this->getStack().addSecondary(this->getIterator(), args...); } // protected: // todo should [MAY]be proteced, but don't now how to 'friend Stack' // Function to provide CRTP access to inheriting class (type) /** - * return the corresponding StackIterator for this particle + * return the corresponding TStackIterator for this particle */ stack_iterator_type& getIterator() { return static_cast<stack_iterator_type&>(*this); diff --git a/corsika/framework/stack/SecondaryView.hpp b/corsika/framework/stack/SecondaryView.hpp index 9e5f60324c17f7a4feb144a5a8b638b74fd88a8c..6ba881b9262be89f403f58aed3338dd15fd9f218 100644 --- a/corsika/framework/stack/SecondaryView.hpp +++ b/corsika/framework/stack/SecondaryView.hpp @@ -430,8 +430,8 @@ namespace corsika { class MSecondaryProducer = corsika::DefaultSecondaryProducer, template <typename> typename pi_type_ = TStack::template pi_type> struct MakeView { - using type = corsika::SecondaryView<typename TStack::stack_implementation_type, - pi_type_, MSecondaryProducer>; + using type = corsika::SecondaryView<typename TStack::stack_data_type, pi_type_, + MSecondaryProducer>; }; #endif diff --git a/corsika/framework/stack/Stack.hpp b/corsika/framework/stack/Stack.hpp index caaf9d065b709fc0161c87f41bd2ac3661f8b2ac..81da792924c4c9d4e3197a44562e93ef90db5ed4 100644 --- a/corsika/framework/stack/Stack.hpp +++ b/corsika/framework/stack/Stack.hpp @@ -72,17 +72,17 @@ namespace corsika { loops, ranges, etc. */ - template <typename StackData, template <typename> typename MParticleInterface> + template <typename TStackData, template <typename> typename MParticleInterface> class Stack { - typedef typename std::remove_reference<StackData>::type value_type; + typedef typename std::remove_reference<TStackData>::type value_type; public: - typedef StackData stack_implementation_type; ///< this is the type of the - ///< user-provided data structure + typedef TStackData stack_data_type; ///< this is the type of the + ///< user-provided data structure - template <typename TSI> - using pi_type = MParticleInterface<TSI>; + template <typename TStackIterator> + using pi_type = MParticleInterface<TStackIterator>; // @todo pi_type -> pi_template /** * Via the StackIteratorInterface and ConstStackIteratorInterface @@ -122,26 +122,26 @@ namespace corsika { delete; ///< since Stack can be very big, we don't want to copy it /** - * if StackData is a reference member we *HAVE* to initialize + * if TStackData is a reference member we *HAVE* to initialize * it in the constructor, this is typically needed for SecondaryView */ - template <typename UType = StackData, + template <typename UType = TStackData, typename = typename std::enable_if<std::is_reference<UType>::value>::type> - Stack(StackData vD) + Stack(TStackData vD) : nDeleted_(0) , data_(vD) , deleted_(std::vector<bool>(data_.getSize(), false)) {} /** * This constructor takes any argument and passes it on to the - * StackData user class. If the user did not provide a suited + * TStackData user class. If the user did not provide a suited * constructor this will fail with an error message. * * Furthermore, this is disabled with enable_if for SecondaryView * stacks, where the inner data container is always a reference * and cannot be initialized here. */ - template <typename... TArgs, typename UType = StackData, + template <typename... TArgs, typename UType = TStackData, typename = typename std::enable_if<std::is_reference<UType>::value>::type> Stack(TArgs... args) : nDeleted_(0) @@ -149,7 +149,7 @@ namespace corsika { , deleted_(std::vector<bool>(data_.getSize(), false)) {} /** - * @name Most generic proxy methods for StackData data_ + * @name Most generic proxy methods for TStackData data_ * @{ */ unsigned int getCapacity() const { return data_.getCapacity(); } @@ -197,7 +197,10 @@ namespace corsika { /** * increase stack size, create new particle at end of stack */ - template <typename... TArgs> + template <typename... TArgs> //, + // typename = std::enable_if_t<std::is_same_v< + // void, std::invoke_result_t<decltype((**stack_iterator_type).setParticleData), + // TArgs...>>>> stack_iterator_type addParticle(const TArgs... v); void swap(stack_iterator_type a, stack_iterator_type b); @@ -277,12 +280,12 @@ namespace corsika { /** * Function to perform eventual transformation from * StackIterator::getIndex() to index in data stored in - * StackData data_. By default (and in almost all cases) this + * TStackData data_. By default (and in almost all cases) this * should just be identiy. See class SecondaryView for an alternative implementation. */ unsigned int getIndexFromIterator(const unsigned int vI) const; /** - * @name Return reference to StackData object data_ for data access + * @name Return reference to TStackData object data_ for data access * @{ */ @@ -306,7 +309,7 @@ namespace corsika { unsigned int nDeleted_ = 0; private: - StackData data_; ///< this in general holds all the data and can be quite big + TStackData data_; ///< this in general holds all the data and can be quite big std::vector<bool> deleted_; ///< bit field to flag deleted entries }; diff --git a/corsika/framework/stack/StackIteratorInterface.hpp b/corsika/framework/stack/StackIteratorInterface.hpp index 02ef7e5423c99e64248d4a5135f2d8262c221eb8..d6a267014def6b44d46011cf5c46f0791df5e76e 100644 --- a/corsika/framework/stack/StackIteratorInterface.hpp +++ b/corsika/framework/stack/StackIteratorInterface.hpp @@ -10,6 +10,8 @@ #include <corsika/framework/stack/ParticleBase.hpp> +#include <boost/type_index.hpp> + namespace corsika::history { template <typename T, template <typename> typename TParticleInterface> class HistorySecondaryProducer; // forward decl. @@ -77,6 +79,9 @@ namespace corsika { corsika::StackIteratorInterface<TStackData, TParticleInterface, TStackType>> particle_interface_type; + typedef TStackType stack_type; + typedef TStackData stack_data_type; + // it is not allowed to create a "dangling" stack iterator StackIteratorInterface() = delete; //! \todo check rule of five @@ -100,7 +105,7 @@ namespace corsika { @param data reference to the stack [rw] @param index index on stack */ - StackIteratorInterface(TStackType& data, unsigned int const index) + StackIteratorInterface(stack_type& data, unsigned int const index) : index_(index) , data_(&data) {} @@ -112,10 +117,11 @@ namespace corsika { particle_interface_type::setParticleData(...) function */ template <typename... TArgs> - StackIteratorInterface(TStackType& data, unsigned int const index, + StackIteratorInterface(stack_type& data, unsigned int const index, const TArgs... args) : index_(index) , data_(&data) { + (**this).setParticleData(args...); } @@ -129,11 +135,12 @@ namespace corsika { consistent with the definition of the user-provided particle_interface_type::setParticleData(...) function */ - template <typename... Args> - StackIteratorInterface(TStackType& data, unsigned int const index, - StackIteratorInterface& parent, const Args... args) + template <typename... TArgs> + StackIteratorInterface(stack_type& data, unsigned int const index, + StackIteratorInterface& parent, const TArgs... args) : index_(index) , data_(&data) { + (**this).setParticleData(*parent, args...); } @@ -168,10 +175,10 @@ namespace corsika { return index_ != rhs.index_; } bool operator==( - const ConstStackIteratorInterface<TStackData, TParticleInterface, TStackType>& + const ConstStackIteratorInterface<TStackData, TParticleInterface, stack_type>& rhs) const; // implemented below bool operator!=( - const ConstStackIteratorInterface<TStackData, TParticleInterface, TStackType>& + const ConstStackIteratorInterface<TStackData, TParticleInterface, stack_type>& rhs) const; // implemented below /** @@ -199,9 +206,9 @@ namespace corsika { /// Get current particle index unsigned int getIndex() const { return index_; } /// Get current particle Stack object - TStackType& getStack() { return *data_; } + stack_type& getStack() { return *data_; } /// Get current particle const Stack object - TStackType const& getStack() const { return *data_; } + stack_type const& getStack() const { return *data_; } /// Get current user particle TStackData object TStackData& getStackData() { return data_->getStackData(); } /// Get current const user particle TStackData object @@ -227,13 +234,13 @@ namespace corsika { template <typename T, template <typename> typename TParticleInterface_> friend class corsika::history::HistorySecondaryProducer; - friend class ConstStackIteratorInterface<TStackData, TParticleInterface, TStackType>; + friend class ConstStackIteratorInterface<TStackData, TParticleInterface, stack_type>; protected: unsigned int index_ = 0; private: - TStackType* data_ = 0; // info: Particles and StackIterators become invalid when + stack_type* data_ = 0; // info: Particles and StackIterators become invalid when // parent Stack is copied or deleted! }; // end class StackIterator @@ -263,6 +270,9 @@ namespace corsika { ConstStackIteratorInterface<TStackData, TParticleInterface, TStackType>> particle_interface_type; + typedef TStackType stack_type; + typedef TStackData stack_data_type; + // we don't want to allow dangling iterators to exist ConstStackIteratorInterface() = delete; //! \todo check rule of five @@ -271,7 +281,7 @@ namespace corsika { : index_(std::move(rhs.index_)) , data_(std::move(rhs.data_)) {} - ConstStackIteratorInterface(TStackType const& data, unsigned int const index) + ConstStackIteratorInterface(stack_type const& data, unsigned int const index) : index_(index) , data_(&data) {} @@ -304,12 +314,12 @@ namespace corsika { bool operator!=(ConstStackIteratorInterface const& rhs) const { return index_ != rhs.index_; } - bool operator==(StackIteratorInterface<TStackData, TParticleInterface, - TStackType> const& rhs) const { + bool operator==(StackIteratorInterface<stack_data_type, TParticleInterface, + stack_type> const& rhs) const { return index_ == rhs.index_; } - bool operator!=(StackIteratorInterface<TStackData, TParticleInterface, - TStackType> const& rhs) const { + bool operator!=(StackIteratorInterface<stack_data_type, TParticleInterface, + stack_type> const& rhs) const { return index_ != rhs.index_; } @@ -324,8 +334,8 @@ namespace corsika { @{ */ unsigned int getIndex() const { return index_; } - TStackType const& getStack() const { return *data_; } - TStackData const& getStackData() const { return data_->getStackData(); } + stack_type const& getStack() const { return *data_; } + stack_data_type const& getStackData() const { return data_->getStackData(); } /// Get data index as mapped in Stack class unsigned int getIndexFromIterator() const { return data_->getIndexFromIterator(index_); @@ -333,18 +343,18 @@ namespace corsika { ///@} // friends are needed for access to protected methods - friend class Stack<TStackData, + friend class Stack<stack_data_type, TParticleInterface>; // for access to GetIndex for Stack - friend class Stack<TStackData&, TParticleInterface>; // for access to GetIndex + friend class Stack<stack_data_type&, TParticleInterface>; // for access to GetIndex friend class ParticleBase<ConstStackIteratorInterface>; // for access to GetStackData - template <typename T1, // best fix to: TStackData, + template <typename T1, // best fix to: stack_data_type, template <typename> typename M1, // best fix to: TParticleInterface, template <class T2, template <class> class T3> class MSecondaryProducer> friend class SecondaryView; // access for SecondaryView - friend class StackIteratorInterface<TStackData, TParticleInterface, TStackType>; + friend class StackIteratorInterface<stack_data_type, TParticleInterface, stack_type>; template <typename T, template <typename> typename TParticleInterface_> friend class corsika::history::HistorySecondaryProducer; @@ -353,7 +363,7 @@ namespace corsika { unsigned int index_ = 0; private: - TStackType const* data_ = 0; // info: Particles and StackIterators become invalid when + stack_type const* data_ = 0; // info: Particles and StackIterators become invalid when // parent Stack is copied or deleted! }; // end class ConstStackIterator diff --git a/corsika/modules/qgsjetII/QGSJetIIFragmentsStack.hpp b/corsika/modules/qgsjetII/QGSJetIIFragmentsStack.hpp index 5539ec807a99804c5c66fe343c16bc7948a0c3a4..8d1279382c244b7c0265a31dbf5ebb7413fe837e 100644 --- a/corsika/modules/qgsjetII/QGSJetIIFragmentsStack.hpp +++ b/corsika/modules/qgsjetII/QGSJetIIFragmentsStack.hpp @@ -50,16 +50,16 @@ namespace corsika::qgsjetII { } }; - template <typename StackIteratorInterface> - class FragmentsInterface : public corsika::ParticleBase<StackIteratorInterface> { + template <typename TStackIterator> + class FragmentsInterface : public corsika::ParticleBase<TStackIterator> { - using corsika::ParticleBase<StackIteratorInterface>::getStackData; - using corsika::ParticleBase<StackIteratorInterface>::getIndex; + using corsika::ParticleBase<TStackIterator>::getStackData; + using corsika::ParticleBase<TStackIterator>::getIndex; public: void setParticleData(const int vSize) { setFragmentSize(vSize); } - void setParticleData(FragmentsInterface<StackIteratorInterface>& /*parent*/, + void setParticleData(FragmentsInterface<TStackIterator>& /*parent*/, const int vSize) { setFragmentSize(vSize); } diff --git a/corsika/modules/qgsjetII/QGSJetIIStack.hpp b/corsika/modules/qgsjetII/QGSJetIIStack.hpp index bde5bdeacdc219f8ff2080f4ab23c2a59ebe2eb4..fa78938422c504be7a2a3695d434905ee074ee24 100644 --- a/corsika/modules/qgsjetII/QGSJetIIStack.hpp +++ b/corsika/modules/qgsjetII/QGSJetIIStack.hpp @@ -44,17 +44,17 @@ namespace corsika::qgsjetII { void decrementSize(); }; - template <typename StackIteratorInterface> - class ParticleInterface : public corsika::ParticleBase<StackIteratorInterface> { + template <typename TStackIterator> + class ParticleInterface : public corsika::ParticleBase<TStackIterator> { - using corsika::ParticleBase<StackIteratorInterface>::getStackData; - using corsika::ParticleBase<StackIteratorInterface>::getIndex; + using corsika::ParticleBase<TStackIterator>::getStackData; + using corsika::ParticleBase<TStackIterator>::getIndex; public: void setParticleData(const int vID, const HEPEnergyType vE, const MomentumVector& vP, const HEPMassType); - void setParticleData(ParticleInterface<StackIteratorInterface>& /*parent*/, - const int vID, const HEPEnergyType vE, const MomentumVector& vP, + void setParticleData(ParticleInterface<TStackIterator>& /*parent*/, const int vID, + const HEPEnergyType vE, const MomentumVector& vP, const HEPMassType); void setEnergy(const HEPEnergyType v); diff --git a/corsika/modules/sibyll/SibStack.hpp b/corsika/modules/sibyll/SibStack.hpp index 68e2d63d54c2314d03888276c123cc01129c15aa..636180d206f3486b3276ae25c89f47ba44800ac6 100644 --- a/corsika/modules/sibyll/SibStack.hpp +++ b/corsika/modules/sibyll/SibStack.hpp @@ -68,15 +68,14 @@ namespace corsika::sibyll { } }; - template <typename StackIteratorInterface> - class ParticleInterface : public corsika::ParticleBase<StackIteratorInterface> { + template <typename TStackIterator> + class ParticleInterface : public corsika::ParticleBase<TStackIterator> { - using corsika::ParticleBase<StackIteratorInterface>::getStackData; - using corsika::ParticleBase<StackIteratorInterface>::getIndex; + using corsika::ParticleBase<TStackIterator>::getStackData; + using corsika::ParticleBase<TStackIterator>::getIndex; public: - void setParticleData(const int vID, // corsika::sibyll::SibyllCode vID, - const HEPEnergyType vE, const MomentumVector& vP, + void setParticleData(const int vID, const HEPEnergyType vE, const MomentumVector& vP, const HEPMassType vM) { setPID(vID); setEnergy(vE); @@ -84,8 +83,7 @@ namespace corsika::sibyll { setMass(vM); } - void setParticleData(ParticleInterface<StackIteratorInterface>& /*parent*/, - const int vID, // corsika::sibyll::SibyllCode vID, + void setParticleData(ParticleInterface<TStackIterator>& /*parent*/, const int vID, const HEPEnergyType vE, const MomentumVector& vP, const HEPMassType vM) { setPID(vID); diff --git a/corsika/setup/SetupStack.hpp b/corsika/setup/SetupStack.hpp index 847f83834e57d1afa757151df9e92cce7ee8dca4..a051e4db177cd36e087f42612652ffe0737c585d 100644 --- a/corsika/setup/SetupStack.hpp +++ b/corsika/setup/SetupStack.hpp @@ -57,7 +57,7 @@ namespace corsika::setup { #ifdef WITH_HISTORY #if defined(__clang__) - using StackView = SecondaryView<typename Stack::stack_implementation_type, + using StackView = SecondaryView<typename Stack::stack_data_type, // CHECK with CLANG: setup::Stack::MPIType>; detail::StackWithHistoryInterface, StackViewProducer>; #elif defined(__GNUC__) || defined(__GNUG__) @@ -67,7 +67,7 @@ namespace corsika::setup { #else // WITH_HISTORY #if defined(__clang__) - using StackView = SecondaryView<typename setup::Stack::stack_implementation_type, + using StackView = SecondaryView<typename setup::Stack::stack_data_type, // CHECK with CLANG: // setup::Stack::MPIType>; setup::detail::StackWithGeometryInterface>; diff --git a/corsika/stack/NuclearStackExtension.hpp b/corsika/stack/NuclearStackExtension.hpp index 6c928656642959d93bf07a469a98e04637884bc8..03870ccf5de4b0225be86add758eaec8ef0c8a15 100644 --- a/corsika/stack/NuclearStackExtension.hpp +++ b/corsika/stack/NuclearStackExtension.hpp @@ -291,8 +291,7 @@ namespace corsika::nuclear_stack { template <typename TInnerStack, template <typename> typename PI_> using NuclearStackExtension = - Stack<NuclearStackExtensionImpl<typename TInnerStack::stack_implementation_type>, - PI_>; + Stack<NuclearStackExtensionImpl<typename TInnerStack::stack_data_type>, PI_>; // template <typename TStackIter> diff --git a/corsika/stack/VectorStack.hpp b/corsika/stack/VectorStack.hpp index 223d651f90a6a3d37c5d45e362fa8702e21e9c54..154a9850bcb11e8157c8c2e9bc29c862f907184c 100644 --- a/corsika/stack/VectorStack.hpp +++ b/corsika/stack/VectorStack.hpp @@ -26,11 +26,11 @@ namespace corsika { * Example of a particle object on the stack. */ - template <typename StackIteratorInterface> - class ParticleInterface : public ParticleBase<StackIteratorInterface> { + template <typename TStackIterator> + class ParticleInterface : public ParticleBase<TStackIterator> { private: - typedef ParticleBase<StackIteratorInterface> super_type; + typedef ParticleBase<TStackIterator> super_type; public: typedef std::tuple<Code, HEPEnergyType, DirectionVector, Point, TimeType> @@ -59,7 +59,7 @@ namespace corsika { * MomentumVector is only used to determine the DirectionVector, the normalization * is lost. */ - void setParticleData(ParticleInterface<StackIteratorInterface> const& p, + void setParticleData(ParticleInterface<TStackIterator> const& p, particle_data_type const& v); /** @@ -77,7 +77,7 @@ namespace corsika { * @param v tuple containing: PID, kinetic Energy, Direction Vector, Position, Time * */ - void setParticleData(ParticleInterface<StackIteratorInterface> const& p, + void setParticleData(ParticleInterface<TStackIterator> const& p, particle_data_momentum_type const& v); ///! Set particle corsika::Code diff --git a/tests/common/testTestStack.hpp b/tests/common/testTestStack.hpp index 70f4d5f147dd7f8d2499f89a1b4809057f77edaa..c3b4687ddb28f49f0e5ec25f2de5123b1bfca246 100644 --- a/tests/common/testTestStack.hpp +++ b/tests/common/testTestStack.hpp @@ -71,7 +71,7 @@ public: */ // default version for particle-creation from input data - void setParticleData(const std::tuple<double> v) { setData(std::get<0>(v)); } + void setParticleData(std::tuple<double> v) { setData(std::get<0>(v)); } void setParticleData(TestParticleInterface<StackIteratorInterface>& /*parent*/, std::tuple<double> v) { setData(std::get<0>(v)); diff --git a/tests/framework/testCascade.hpp b/tests/framework/testCascade.hpp index 8e6b06bd5d5b1f4fabc6b6f6f0f11b40187fdd83..638424f893c9fa1fef7dd957b1d7fc0010285cc2 100644 --- a/tests/framework/testCascade.hpp +++ b/tests/framework/testCascade.hpp @@ -30,7 +30,7 @@ using StackWithGeometryInterface = SetupGeometryDataInterface, StackIter>; using TestCascadeStack = corsika::CombinedStack< - typename corsika::nuclear_stack::ParticleDataStack::stack_implementation_type, + typename corsika::nuclear_stack::ParticleDataStack::stack_data_type, corsika::node::GeometryData<TestEnvironmentType>, StackWithGeometryInterface>; /* @@ -38,7 +38,7 @@ using TestCascadeStack = corsika::CombinedStack< */ #if defined(__clang__) using TestCascadeStackView = - corsika::SecondaryView<typename TestCascadeStack::stack_implementation_type, + corsika::SecondaryView<typename TestCascadeStack::stack_data_type, StackWithGeometryInterface>; #elif defined(__GNUC__) || defined(__GNUG__) using TestCascadeStackView = corsika::MakeView<TestCascadeStack>::type; diff --git a/tests/framework/testCombinedStack.cpp b/tests/framework/testCombinedStack.cpp index de6defc6ad7a0f94fcbcc289a012de38761112dd..7e86bd88b2beb540328e192969b4a6a878fed57d 100644 --- a/tests/framework/testCombinedStack.cpp +++ b/tests/framework/testCombinedStack.cpp @@ -291,8 +291,8 @@ using CombinedTestInterfaceType2 = corsika::CombinedParticleInterface<StackTest::pi_type, TestParticleInterface3, TStackIter>; -using StackTest2 = CombinedStack<typename StackTest::stack_implementation_type, - TestStackData3, CombinedTestInterfaceType2>; +using StackTest2 = CombinedStack<typename StackTest::stack_data_type, TestStackData3, + CombinedTestInterfaceType2>; TEST_CASE("Combined Stack - multi", "[stack]") { @@ -379,12 +379,12 @@ using CombinedTestInterfaceType2 = corsika::CombinedParticleInterface<StackTest::pi_type, TestParticleInterface3, TStackIter>; -using StackTest2 = CombinedStack<typename StackTest::stack_implementation_type, - TestStackData3, CombinedTestInterfaceType2>; +using StackTest2 = CombinedStack<typename StackTest::stack_data_type, TestStackData3, + CombinedTestInterfaceType2>; #if defined(__clang__) -using StackTestView = SecondaryView<typename StackTest2::stack_implementation_type, - CombinedTestInterfaceType2>; +using StackTestView = + SecondaryView<typename StackTest2::stack_data_type, CombinedTestInterfaceType2>; #elif defined(__GNUC__) || defined(__GNUG__) using StackTestView = corsika::MakeView<StackTest2>::type; #endif diff --git a/tests/modules/testPythia8.cpp b/tests/modules/testPythia8.cpp index 566383b1b1b019f198b35f8c6a57548ca44a9b0e..09a7c067263bc4d30e6d477cd7f68e1231203ec1 100644 --- a/tests/modules/testPythia8.cpp +++ b/tests/modules/testPythia8.cpp @@ -235,16 +235,13 @@ TEST_CASE("Pythia8Interface", "modules") { [[maybe_unused]] auto const& env_dummy_Fe = env_Fe; [[maybe_unused]] auto const& node_dummy_Fe = nodePtr_Fe; } - + // resonable projectile, but tool low energy auto [stackPtr, secViewPtr] = setup::testing::setup_stack( Code::Proton, 0, 0, 1_GeV, (setup::Environment::BaseNodeType* const)nodePtr_Fe, *csPtr_Fe); auto& view = *secViewPtr; - { - [[maybe_unused]] auto const& dummy_StackPtr = stackPtr; - } - + { [[maybe_unused]] auto const& dummy_StackPtr = stackPtr; } corsika::pythia8::Interaction collision; diff --git a/tests/modules/testQGSJetII.cpp b/tests/modules/testQGSJetII.cpp index 3d68eb0cd4d14cd07c09bfd9bbc8afc0a2116350..1dfe2f57379d46206ea2d36e7268205b3bcec9c2 100644 --- a/tests/modules/testQGSJetII.cpp +++ b/tests/modules/testQGSJetII.cpp @@ -52,15 +52,16 @@ TEST_CASE("CORSIKA_DATA", "[processes]") { SECTION("check CORSIKA_DATA") { - const char* data = std::getenv("CORSIKA_DATA"); + const char* CORSIKA_DATA = std::getenv("CORSIKA_DATA"); // these CHECKS are needed: - CHECK(data != 0); - CHECK(boost::filesystem::is_directory(boost::filesystem::path(data) / "QGSJetII")); + CHECK(CORSIKA_DATA != 0); + CHECK(boost::filesystem::is_directory(boost::filesystem::path(CORSIKA_DATA) / + "QGSJetII")); CORSIKA_LOG_INFO( "data: {}" " isDir: {}" "/QGSJetII", - data, boost::filesystem::is_directory(data)); + CORSIKA_DATA, boost::filesystem::is_directory(CORSIKA_DATA)); } } diff --git a/tests/stack/testGeometryNodeStackExtension.cpp b/tests/stack/testGeometryNodeStackExtension.cpp index 8256927d92ed44f57d84a0ddfa370244630c9483..e0673f3c33da61acedec35ddb0a1cae365d40044 100644 --- a/tests/stack/testGeometryNodeStackExtension.cpp +++ b/tests/stack/testGeometryNodeStackExtension.cpp @@ -34,9 +34,8 @@ using StackWithGeometryInterface = CombinedParticleInterface<dummy_stack::DummyStack::pi_type, DummyGeometryDataInterface, TStackIter>; -using TestStack = - CombinedStack<typename dummy_stack::DummyStack::stack_implementation_type, - node::GeometryData<DummyEnv>, StackWithGeometryInterface>; +using TestStack = CombinedStack<typename dummy_stack::DummyStack::stack_data_type, + node::GeometryData<DummyEnv>, StackWithGeometryInterface>; TEST_CASE("GeometryNodeStackExtension", "[stack]") { diff --git a/tests/stack/testHistoryStack.cpp b/tests/stack/testHistoryStack.cpp index b393291bfe3598e3a65f848864d62f7610ba7a71..485b794a531a25a0b0a55c7ec637a40432745872 100644 --- a/tests/stack/testHistoryStack.cpp +++ b/tests/stack/testHistoryStack.cpp @@ -41,7 +41,7 @@ using StackWithHistoryInterface = TStackIter>; using TestStack = - CombinedStack<typename dummy_stack::DummyStack::stack_implementation_type, + CombinedStack<typename dummy_stack::DummyStack::stack_data_type, history::HistoryData<DummyEvent>, StackWithHistoryInterface>; using EvtPtr = std::shared_ptr<DummyEvent>; diff --git a/tests/stack/testHistoryView.cpp b/tests/stack/testHistoryView.cpp index 56e11820979f3b7b0bf9ee2dd72a473118cf7d16..1633b8212c5c59903e99617fd4b2851f8ab133f7 100644 --- a/tests/stack/testHistoryView.cpp +++ b/tests/stack/testHistoryView.cpp @@ -32,7 +32,7 @@ using StackWithHistoryInterface = history::HistoryEventDataInterface, TStackIter>; using TestStack = - CombinedStack<typename nuclear_stack::ParticleDataStack::stack_implementation_type, + CombinedStack<typename nuclear_stack::ParticleDataStack::stack_data_type, history::HistoryEventData, StackWithHistoryInterface>; /* @@ -48,8 +48,8 @@ using TestStack = */ #if defined(__clang__) using TheTestStackView = - SecondaryView<typename TestStack::stack_implementation_type, - StackWithHistoryInterface, history::HistorySecondaryProducer>; + SecondaryView<typename TestStack::stack_data_type, StackWithHistoryInterface, + history::HistorySecondaryProducer>; #elif defined(__GNUC__) || defined(__GNUG__) using TheTestStackView = MakeView<TestStack, history::HistorySecondaryProducer>::type; #endif diff --git a/tests/stack/testWeightStackExtension.cpp b/tests/stack/testWeightStackExtension.cpp index 2754c367913e336325491945f6570e4bd014899b..d984e1e5cc36588fac2fd36623df996cd924ab44 100644 --- a/tests/stack/testWeightStackExtension.cpp +++ b/tests/stack/testWeightStackExtension.cpp @@ -28,9 +28,8 @@ using StackWithGeometryInterface = CombinedParticleInterface<dummy_stack::DummyStack::pi_type, DummyWeightDataInterface, TStackIter>; -using TestStack = - CombinedStack<typename dummy_stack::DummyStack::stack_implementation_type, - weights::WeightData, StackWithGeometryInterface>; +using TestStack = CombinedStack<typename dummy_stack::DummyStack::stack_data_type, + weights::WeightData, StackWithGeometryInterface>; TEST_CASE("WeightStackExtension", "[stack]") {