forked from qt-creator/qt-creator
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:
@@ -41,14 +41,13 @@ class TASKING_EXPORT TreeStorageBase
|
|||||||
public:
|
public:
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
using StorageConstructor = std::function<void *(void)>;
|
using StorageConstructor = std::function<void *(void)>;
|
||||||
using StorageDestructor = std::function<void(void *)>;
|
using StorageDestructor = std::function<void(void *)>;
|
||||||
|
|
||||||
TreeStorageBase(StorageConstructor ctor, StorageDestructor dtor);
|
TreeStorageBase(StorageConstructor ctor, StorageDestructor dtor);
|
||||||
void *activeStorageVoid() const;
|
void *activeStorageVoid() const;
|
||||||
|
|
||||||
private:
|
|
||||||
int createStorage() const;
|
int createStorage() const;
|
||||||
void deleteStorage(int id) const;
|
void deleteStorage(int id) const;
|
||||||
void activateStorage(int id) const;
|
void activateStorage(int id) const;
|
||||||
@@ -71,13 +70,15 @@ private:
|
|||||||
int m_storageCounter = 0;
|
int m_storageCounter = 0;
|
||||||
};
|
};
|
||||||
QSharedPointer<StorageData> m_storageData;
|
QSharedPointer<StorageData> m_storageData;
|
||||||
|
|
||||||
|
template <typename StorageStruct> friend class TreeStorage;
|
||||||
friend ExecutionContextActivator;
|
friend ExecutionContextActivator;
|
||||||
friend TaskContainer;
|
friend TaskContainer;
|
||||||
friend TaskTreePrivate;
|
friend TaskTreePrivate;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename StorageStruct>
|
template <typename StorageStruct>
|
||||||
class TreeStorage : public TreeStorageBase
|
class TreeStorage final : public TreeStorageBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TreeStorage() : TreeStorageBase(TreeStorage::ctor(), TreeStorage::dtor()) {}
|
TreeStorage() : TreeStorageBase(TreeStorage::ctor(), TreeStorage::dtor()) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user