From 9835c4687f4c6be839327629be4b0f03f0ca71ad Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Mon, 28 Sep 2020 10:55:22 +0200 Subject: [PATCH] clang-specific naming clarifications --- Framework/Cascade/testCascade.h | 2 +- Framework/StackInterface/SecondaryView.h | 21 ++++++---------- Framework/StackInterface/Stack.h | 25 ++++++++++--------- Framework/StackInterface/testCombinedStack.cc | 4 +-- .../TrackingLine/testTrackingLineStack.h | 2 +- Setup/SetupStack.h | 7 +++--- .../testGeometryNodeStackExtension.cc | 2 +- Stack/History/testHistoryStack.cc | 2 +- Stack/History/testHistoryView.cc | 2 +- .../NuclearStackExtension.h | 2 +- 10 files changed, 33 insertions(+), 36 deletions(-) diff --git a/Framework/Cascade/testCascade.h b/Framework/Cascade/testCascade.h index b876107de..fa756414a 100644 --- a/Framework/Cascade/testCascade.h +++ b/Framework/Cascade/testCascade.h @@ -24,7 +24,7 @@ using SetupGeometryDataInterface = // combine particle data stack with geometry information for tracking template <typename StackIter> using StackWithGeometryInterface = corsika::stack::CombinedParticleInterface< - corsika::stack::nuclear_extension::ParticleDataStack::PIType, + corsika::stack::nuclear_extension::ParticleDataStack::MPIType, SetupGeometryDataInterface, StackIter>; using TestCascadeStack = corsika::stack::CombinedStack< diff --git a/Framework/StackInterface/SecondaryView.h b/Framework/StackInterface/SecondaryView.h index b47d5a653..572a57f06 100644 --- a/Framework/StackInterface/SecondaryView.h +++ b/Framework/StackInterface/SecondaryView.h @@ -57,14 +57,10 @@ namespace corsika::stack { template <typename StackDataType, template <typename> typename ParticleInterface, - //template <typename> typename MSecondaryProducer = DefaultSecondaryProducer> - template <class T1, template <class> class T2> class MSecondaryProducer> // T2==ParticleInterface + template <class T1, template <class> class T2> class MSecondaryProducer> class SecondaryView : public Stack<StackDataType&, ParticleInterface>, - public MSecondaryProducer<StackDataType, ParticleInterface> - - { //, public MSecondaryProducer<SecondaryView<StackDataType,ParticleInterface,MSecondaryProducer>> { - + public MSecondaryProducer<StackDataType, ParticleInterface> { using ViewType = SecondaryView<StackDataType, ParticleInterface, MSecondaryProducer>; private: @@ -101,8 +97,8 @@ namespace corsika::stack { friend class ParticleBase<StackIterator>; - template <template <typename> typename M1> - friend class MSecondaryProducer; + //template <template <typename> typename M1> + //friend class MSecondaryProducer; private: /** @@ -398,12 +394,11 @@ namespace corsika::stack { generic and universal. */ #if not defined(__clang__) && defined(__GNUC__) || defined(__GNUG__) - template <typename S, - // template <typename> typename MSecondaryProducer = corsika::stack::DefaultSecondaryProducer, - template <class T1, template <class> class T2> class MSecondaryProducer = corsika::stack::DefaultSecondaryProducer, - template <typename> typename _PIType = S::template PIType> + template <typename TStack, + template <class TStack_, template <class> class MPIType_> class MSecondaryProducer = corsika::stack::DefaultSecondaryProducer, + template <typename> typename MPIType_ = TStack::template MPIType> struct MakeView { - using type = corsika::stack::SecondaryView<typename S::StackImpl, _PIType, MSecondaryProducer>; + using type = corsika::stack::SecondaryView<typename TStack::StackImpl, MPIType_, MSecondaryProducer>; }; #endif diff --git a/Framework/StackInterface/Stack.h b/Framework/StackInterface/Stack.h index 94ee054c8..b277b1083 100644 --- a/Framework/StackInterface/Stack.h +++ b/Framework/StackInterface/Stack.h @@ -50,7 +50,8 @@ namespace corsika::stack { loops, ranges, etc. */ - template <typename TStackData, template <typename> typename TParticleInterface> + template <typename TStackData, + template <typename> typename MParticleInterface> class Stack { using StackDataValueType = std::remove_reference_t<TStackData>; @@ -96,23 +97,23 @@ namespace corsika::stack { typedef TStackData StackImpl; ///< this is the type of the user-provided data structure - template <typename SI> - using PIType = TParticleInterface<SI>; + template <typename TSI> + using MPIType = MParticleInterface<TSI>; /** * Via the StackIteratorInterface and ConstStackIteratorInterface * specialization, the type of the StackIterator * template class is declared for a particular stack data * object. Using CRTP, this also determines the type of - * TParticleInterface template class simultaneously. + * MParticleInterface template class simultaneously. */ using StackIterator = - StackIteratorInterface<StackDataValueType, TParticleInterface, Stack>; + StackIteratorInterface<StackDataValueType, MParticleInterface, Stack>; using ConstStackIterator = - ConstStackIteratorInterface<StackDataValueType, TParticleInterface, Stack>; + ConstStackIteratorInterface<StackDataValueType, MParticleInterface, Stack>; /** - * this is the full type of the user-declared TParticleInterface + * this is the full type of the user-declared MParticleInterface */ using ParticleInterfaceType = typename StackIterator::ParticleInterfaceType; /** @@ -122,15 +123,15 @@ namespace corsika::stack { using ParticleType = StackIterator; // friends are needed since they need access to protected members - friend class StackIteratorInterface<StackDataValueType, TParticleInterface, Stack>; - friend class ConstStackIteratorInterface<StackDataValueType, TParticleInterface, + friend class StackIteratorInterface<StackDataValueType, MParticleInterface, Stack>; + friend class ConstStackIteratorInterface<StackDataValueType, MParticleInterface, Stack>; - //friend class SecondaryView<StackDataValueType, TParticleInterface>; + //friend class SecondaryView<StackDataValueType, MParticleInterface>; template <typename T1, //=TStackData, - template <typename> typename M1, //=TParticleInterface, + template <typename> typename M1, //=MParticleInterface, // template<typename>typename M2> template <class T2, template <class> class T3> class MSecondaryProducer> - friend class SecondaryView; //<TStackData,TParticleInterface,M>; // access for SecondaryView + friend class SecondaryView; //<TStackData,MParticleInterface,M>; // access for SecondaryView friend class ParticleBase<StackIterator>; diff --git a/Framework/StackInterface/testCombinedStack.cc b/Framework/StackInterface/testCombinedStack.cc index e5a8932ec..2f0932726 100644 --- a/Framework/StackInterface/testCombinedStack.cc +++ b/Framework/StackInterface/testCombinedStack.cc @@ -277,7 +277,7 @@ public: // combined stack template <typename StackIter> using CombinedTestInterfaceType2 = - corsika::stack::CombinedParticleInterface<StackTest::PIType, TestParticleInterface3, + corsika::stack::CombinedParticleInterface<StackTest::MPIType, TestParticleInterface3, StackIter>; using StackTest2 = CombinedStack<typename StackTest::StackImpl, TestStackData3, @@ -363,7 +363,7 @@ TEST_CASE("Combined Stack - multi", "[stack]") { */ template <typename StackIter> using CombinedTestInterfaceType2 = - corsika::stack::CombinedParticleInterface<StackTest::PIType, TestParticleInterface3, + corsika::stack::CombinedParticleInterface<StackTest::MPIType, TestParticleInterface3, StackIter>; using StackTest2 = CombinedStack<typename StackTest::StackImpl, TestStackData3, diff --git a/Processes/TrackingLine/testTrackingLineStack.h b/Processes/TrackingLine/testTrackingLineStack.h index d727064eb..5c714048a 100644 --- a/Processes/TrackingLine/testTrackingLineStack.h +++ b/Processes/TrackingLine/testTrackingLineStack.h @@ -31,7 +31,7 @@ using SetupGeometryDataInterface = // combine particle data stack with geometry information for tracking template <typename StackIter> using StackWithGeometryInterface = corsika::stack::CombinedParticleInterface< - corsika::stack::nuclear_extension::ParticleDataStack::PIType, + corsika::stack::nuclear_extension::ParticleDataStack::MPIType, SetupGeometryDataInterface, StackIter>; using TestTrackingLineStack = corsika::stack::CombinedStack< diff --git a/Setup/SetupStack.h b/Setup/SetupStack.h index b838c0484..8721a0236 100644 --- a/Setup/SetupStack.h +++ b/Setup/SetupStack.h @@ -16,6 +16,7 @@ #include <corsika/setup/SetupEnvironment.h> + namespace corsika::setup { namespace detail { @@ -33,7 +34,7 @@ namespace corsika::setup { // combine particle data stack with geometry information for tracking template <typename TStackIter> using StackWithGeometryInterface = corsika::stack::CombinedParticleInterface< - stack::nuclear_extension::ParticleDataStack::PIType, SetupGeometryDataInterface, + stack::nuclear_extension::ParticleDataStack::MPIType, SetupGeometryDataInterface, TStackIter>; using StackWithGeometry = corsika::stack::CombinedStack< @@ -47,7 +48,7 @@ namespace corsika::setup { // combine dummy stack with geometry information for tracking template <typename TStackIter> using StackWithHistoryInterface = corsika::stack::CombinedParticleInterface< - StackWithGeometry::PIType, history::HistoryEventDataInterface, TStackIter>; + StackWithGeometry::MPIType, history::HistoryEventDataInterface, TStackIter>; using StackWithHistory = corsika::stack::CombinedStack<typename StackWithGeometry::StackImpl, @@ -84,7 +85,7 @@ namespace corsika::setup { #if defined(__clang__) using TheStackView = corsika::stack::SecondaryView< typename corsika::setup::Stack::StackImpl, - // CHECK with CLANG: corsika::setup::Stack::PIType>; + // CHECK with CLANG: corsika::setup::Stack::MPIType>; // corsika::setup::detail::StackWithGeometryInterface>; corsika::setup::detail::StackWithHistoryInterface>; #elif defined(__GNUC__) || defined(__GNUG__) diff --git a/Stack/GeometryNodeStackExtension/testGeometryNodeStackExtension.cc b/Stack/GeometryNodeStackExtension/testGeometryNodeStackExtension.cc index bad486425..596d7b0a1 100644 --- a/Stack/GeometryNodeStackExtension/testGeometryNodeStackExtension.cc +++ b/Stack/GeometryNodeStackExtension/testGeometryNodeStackExtension.cc @@ -32,7 +32,7 @@ using DummyGeometryDataInterface = // combine dummy stack with geometry information for tracking template <typename TStackIter> using StackWithGeometryInterface = - corsika::stack::CombinedParticleInterface<dummy::DummyStack::PIType, + corsika::stack::CombinedParticleInterface<dummy::DummyStack::MPIType, DummyGeometryDataInterface, TStackIter>; using TestStack = diff --git a/Stack/History/testHistoryStack.cc b/Stack/History/testHistoryStack.cc index 80b1de443..e332d7620 100644 --- a/Stack/History/testHistoryStack.cc +++ b/Stack/History/testHistoryStack.cc @@ -40,7 +40,7 @@ using DummyHistoryDataInterface = // combine dummy stack with geometry information for tracking template <typename TStackIter> using StackWithHistoryInterface = - corsika::stack::CombinedParticleInterface<dummy::DummyStack::PIType, + corsika::stack::CombinedParticleInterface<dummy::DummyStack::MPIType, DummyHistoryDataInterface, TStackIter>; using TestStack = diff --git a/Stack/History/testHistoryView.cc b/Stack/History/testHistoryView.cc index d85693bc0..874d50f36 100644 --- a/Stack/History/testHistoryView.cc +++ b/Stack/History/testHistoryView.cc @@ -30,7 +30,7 @@ using namespace corsika::units::si; // combine dummy stack with geometry information for tracking template <typename TStackIter> using StackWithHistoryInterface = corsika::stack::CombinedParticleInterface< - stack::nuclear_extension::ParticleDataStack::PIType, + stack::nuclear_extension::ParticleDataStack::MPIType, history::HistoryEventDataInterface, TStackIter>; using TestStack = corsika::stack::CombinedStack< diff --git a/Stack/NuclearStackExtension/NuclearStackExtension.h b/Stack/NuclearStackExtension/NuclearStackExtension.h index 79d4da2f9..e9ead6eb2 100644 --- a/Stack/NuclearStackExtension/NuclearStackExtension.h +++ b/Stack/NuclearStackExtension/NuclearStackExtension.h @@ -338,7 +338,7 @@ namespace corsika::stack { template <typename StackIter> using ExtendedParticleInterfaceType = corsika::stack::nuclear_extension::NuclearParticleInterface< - corsika::stack::super_stupid::SuperStupidStack::PIType, StackIter>; + corsika::stack::super_stupid::SuperStupidStack::MPIType, StackIter>; // the particle data stack with extra nuclear information: using ParticleDataStack = corsika::stack::nuclear_extension::NuclearStackExtension< -- GitLab