TaskTree: Make TreeStorage final

Allow TreeStorageBase to be subclasses only by TreeStorage.

Change-Id: I6e119d6b6f2f99cc7846752cf55f9fb92f3834c7
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-08-15 13:05:06 +02:00
parent 10feedf9de
commit d6068c3ce5

View File

@@ -41,14 +41,13 @@ class TASKING_EXPORT TreeStorageBase
public:
bool isValid() const;
protected:
private:
using StorageConstructor = std::function<void *(void)>;
using StorageDestructor = std::function<void(void *)>;
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<StorageData> m_storageData;
template <typename StorageStruct> friend class TreeStorage;
friend ExecutionContextActivator;
friend TaskContainer;
friend TaskTreePrivate;
};
template <typename StorageStruct>
class TreeStorage : public TreeStorageBase
class TreeStorage final : public TreeStorageBase
{
public:
TreeStorage() : TreeStorageBase(TreeStorage::ctor(), TreeStorage::dtor()) {}