diff --git a/Core/Computation/DecoratedLayerComputation.cpp b/Core/Computation/DecoratedLayerComputation.cpp index 98e1aea31ed03ac99ec2c8e8fe15dcc1568ea79e..212455ecc5fa3914f936138f33295e3631148b94 100644 --- a/Core/Computation/DecoratedLayerComputation.cpp +++ b/Core/Computation/DecoratedLayerComputation.cpp @@ -47,6 +47,7 @@ void DecoratedLayerComputation::eval( createStrategy() }; double total_surface_density = mp_layer->getTotalParticleSurfaceDensity(m_layout_index); + ThreadedComputation counter; for (std::vector<SimulationElement>::iterator it = begin_it; it != end_it; ++it) { if (!progress->alive()) return; @@ -56,6 +57,6 @@ void DecoratedLayerComputation::eval( continue; // each ffdwba: one call to getOutCoeffs it->setIntensity(p_strategy->evaluate(*it) * total_surface_density); - stepProgress(progress); + counter.stepProgress(progress); } } diff --git a/Core/Computation/DecoratedLayerComputation.h b/Core/Computation/DecoratedLayerComputation.h index 7f91c6368eaa8edd828a74f2a805b41993de24da..fb30064d7ebc7c9d6d66227f2ae5a06da1596059 100644 --- a/Core/Computation/DecoratedLayerComputation.h +++ b/Core/Computation/DecoratedLayerComputation.h @@ -33,7 +33,7 @@ class SimulationOptions; //! Controlled by MainComputation. //! @ingroup algorithms_internal -class DecoratedLayerComputation final : public ThreadedComputation +class DecoratedLayerComputation { public: DecoratedLayerComputation(const Layer* p_layer, size_t layout_index=0); diff --git a/Core/Computation/RoughMultiLayerComputation.cpp b/Core/Computation/RoughMultiLayerComputation.cpp index e53b0938168e69facd0676d4e07c1cd17461890c..fd6d699ed9b5944c05be611e74c0136d2a4d7373 100644 --- a/Core/Computation/RoughMultiLayerComputation.cpp +++ b/Core/Computation/RoughMultiLayerComputation.cpp @@ -57,11 +57,12 @@ void RoughMultiLayerComputation::eval( const std::vector<SimulationElement>::iterator& begin_it, const std::vector<SimulationElement>::iterator& end_it) { + ThreadedComputation counter; for (std::vector<SimulationElement>::iterator it = begin_it; it != end_it; ++it) { if (!progress->alive()) return; it->setIntensity(evaluate(*it)); - stepProgress(progress); + counter.stepProgress(progress); } } diff --git a/Core/Computation/RoughMultiLayerComputation.h b/Core/Computation/RoughMultiLayerComputation.h index 9ba7a2f3aff147e9c9f986c7556f2ef6fd5ed9da..377fb332df1c7a87bfdef54ba58f0a6aa1557f68 100644 --- a/Core/Computation/RoughMultiLayerComputation.h +++ b/Core/Computation/RoughMultiLayerComputation.h @@ -29,7 +29,7 @@ class SimulationElement; //! Controlled by MainComputation. //! @ingroup algorithms_internal -class RoughMultiLayerComputation final : public ThreadedComputation +class RoughMultiLayerComputation { public: RoughMultiLayerComputation(const MultiLayer* p_multi_layer); diff --git a/Core/Computation/ThreadedComputation.cpp b/Core/Computation/ThreadedComputation.cpp index 1399c1bea0bcbb5b99958bdb65b5cebd8b18b5b4..29d315618f51a194e009c950f308d5ef90a59bae 100644 --- a/Core/Computation/ThreadedComputation.cpp +++ b/Core/Computation/ThreadedComputation.cpp @@ -17,7 +17,7 @@ #include "ThreadedComputation.h" //! Increments progress count; at regular intervals updates main progress handler. -void ThreadedComputation::stepProgress(ProgressHandler* progress) const +void ThreadedComputation::stepProgress(ProgressHandler* progress) { ++m_count; if( m_count==bundle ) { diff --git a/Core/Computation/ThreadedComputation.h b/Core/Computation/ThreadedComputation.h index bf89814b85bf0a8906aa02412122c668c9886101..6f9c9ee6b4c8d2189057ef63fb99837321496f19 100644 --- a/Core/Computation/ThreadedComputation.h +++ b/Core/Computation/ThreadedComputation.h @@ -26,11 +26,10 @@ class ThreadedComputation: public INoncopyable { public: ThreadedComputation() : m_count(0) {} -protected: - void stepProgress(ProgressHandler* progress) const; + void stepProgress(ProgressHandler* progress); private: const int bundle = 100; - mutable int m_count; + int m_count; }; #endif // THREADEDCOMPUTATION_H diff --git a/Core/Multilayer/DecouplingApproximationStrategy.h b/Core/Multilayer/DecouplingApproximationStrategy.h index 84c032afad860c84d9bdcfb86e893f34b9e8d788..742c4c791affaa79dfdb930cc91e702c73dd4257 100644 --- a/Core/Multilayer/DecouplingApproximationStrategy.h +++ b/Core/Multilayer/DecouplingApproximationStrategy.h @@ -25,7 +25,7 @@ class SimulationElement; //! in decoupling approximation. //! @ingroup algorithms_internal -class BA_CORE_API_ DecouplingApproximationStrategy1 +class BA_CORE_API_ DecouplingApproximationStrategy1 final : public IInterferenceFunctionStrategy1 { public: @@ -40,7 +40,7 @@ private: //! in decoupling approximation. //! @ingroup algorithms_internal -class BA_CORE_API_ DecouplingApproximationStrategy2 +class BA_CORE_API_ DecouplingApproximationStrategy2 final : public IInterferenceFunctionStrategy2 { public: diff --git a/Core/Multilayer/SSCApproximationStrategy.h b/Core/Multilayer/SSCApproximationStrategy.h index be24da6aedce80815da3dfab5f1dbbbb45d131fc..4a6845c1597e925d97ce6dcc0fd32f12a31327cd 100644 --- a/Core/Multilayer/SSCApproximationStrategy.h +++ b/Core/Multilayer/SSCApproximationStrategy.h @@ -48,7 +48,7 @@ private: //! in size-spacing correlation approximation. //! @ingroup algorithms_internal -class SSCApproximationStrategy1 +class SSCApproximationStrategy1 final : public IInterferenceFunctionStrategy1 , public SSCApproximationStrategy { @@ -66,7 +66,7 @@ private: //! in size-spacing correlation approximation. //! @ingroup algorithms_internal -class SSCApproximationStrategy2 +class SSCApproximationStrategy2 final : public IInterferenceFunctionStrategy2 , public SSCApproximationStrategy {