AutoPas  3.0.0
Loading...
Searching...
No Matches
C08TraversalColorChangeNotify.h
Go to the documentation of this file.
1
7#pragma once
8
11
12namespace autopas {
13
19template <class ParticleCell, class PairwiseFunctor>
20class C08TraversalColorChangeNotify : public LCC08Traversal<ParticleCell, PairwiseFunctor> {
21 public:
33 C08TraversalColorChangeNotify(const std::array<unsigned long, 3> &dims, PairwiseFunctor *pairwiseFunctor,
34 double interactionLength, const std::array<double, 3> &cellLength,
35 ColorChangeObserver *observer, DataLayoutOption dataLayout, bool useNewton3)
36 : LCC08Traversal<ParticleCell, PairwiseFunctor>(dims, pairwiseFunctor, interactionLength, cellLength, dataLayout,
37 useNewton3),
38 _observer(observer) {}
39
40 protected:
45 void notifyColorChange(unsigned long newColor) override {
46 if (_observer) _observer->receiveColorChange(newColor);
47 }
48
49 private:
53 ColorChangeObserver *_observer;
54};
55
56} // namespace autopas
Constructor of the lc_c08 traversal.
Definition: C08TraversalColorChangeNotify.h:20
C08TraversalColorChangeNotify(const std::array< unsigned long, 3 > &dims, PairwiseFunctor *pairwiseFunctor, double interactionLength, const std::array< double, 3 > &cellLength, ColorChangeObserver *observer, DataLayoutOption dataLayout, bool useNewton3)
Constructor of the traversal.
Definition: C08TraversalColorChangeNotify.h:33
void notifyColorChange(unsigned long newColor) override
Notifies the observer.
Definition: C08TraversalColorChangeNotify.h:45
Observer interface that specifies handling color changes.
Definition: ColorChangeObserver.h:14
virtual void receiveColorChange(unsigned long newColor)=0
Gets called when the color changes during the observed traversal.
This class provides the lc_c08 traversal.
Definition: LCC08Traversal.h:28
PairwiseFunctor class.
Definition: PairwiseFunctor.h:31
Class for Cells of Particles.
Definition: ParticleCell.h:51
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32