From d6068c3ce5fa9e53a0eba93594b8481b6f449c8c Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 15 Aug 2023 13:05:06 +0200 Subject: [PATCH] TaskTree: Make TreeStorage final Allow TreeStorageBase to be subclasses only by TreeStorage. Change-Id: I6e119d6b6f2f99cc7846752cf55f9fb92f3834c7 Reviewed-by: hjk --- src/libs/solutions/tasking/tasktree.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index 94db0d7c7ea..9478ac10250 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -41,14 +41,13 @@ class TASKING_EXPORT TreeStorageBase public: bool isValid() const; -protected: +private: using StorageConstructor = std::function; using StorageDestructor = std::function; TreeStorageBase(StorageConstructor ctor, StorageDestructor dtor); void *activeStorageVoid() const; -private: int createStorage() const; void deleteStorage(int id) const; void activateStorage(int id) const; @@ -71,13 +70,15 @@ private: int m_storageCounter = 0; }; QSharedPointer m_storageData; + + template friend class TreeStorage; friend ExecutionContextActivator; friend TaskContainer; friend TaskTreePrivate; }; template -class TreeStorage : public TreeStorageBase +class TreeStorage final : public TreeStorageBase { public: TreeStorage() : TreeStorageBase(TreeStorage::ctor(), TreeStorage::dtor()) {}