comparison OrthancStone/Sources/Scene2D/MacroSceneLayer.h @ 1802:757987cb5a68

recycling of layers in MacroSceneLayer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 May 2021 13:58:26 +0200
parents 013dec434a84
children 3889ae96d2e9
comparison
equal deleted inserted replaced
1801:64dad1d7aca4 1802:757987cb5a68
25 #include "ISceneLayer.h" 25 #include "ISceneLayer.h"
26 26
27 #include <Compatibility.h> // For ORTHANC_OVERRIDE 27 #include <Compatibility.h> // For ORTHANC_OVERRIDE
28 28
29 #include <deque> 29 #include <deque>
30 #include <set>
30 31
31 namespace OrthancStone 32 namespace OrthancStone
32 { 33 {
33 /** 34 /**
34 * A "macro layer" is a group of sublayers that are handled as a 35 * A "macro layer" is a group of sublayers that are handled as a
39 private: 40 private:
40 // A deque is used because we need to quickly add new layers, and 41 // A deque is used because we need to quickly add new layers, and
41 // to randomly access the layers 42 // to randomly access the layers
42 std::deque<ISceneLayer*> layers_; 43 std::deque<ISceneLayer*> layers_;
43 uint64_t revision_; 44 uint64_t revision_;
45 std::set<size_t> recycledLayers_;
46
47 void CheckInvariant() const;
44 48
45 protected: 49 protected:
46 void BumpRevision() 50 void BumpRevision()
47 { 51 {
48 // this is *not* thread-safe!!! => (SJO) no problem, Stone assumes mono-threading 52 // this is *not* thread-safe!!! => (SJO) no problem, Stone assumes mono-threading