summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2014-11-16 16:18:40 +0000
committerSean Harmer <sean.harmer@kdab.com>2014-11-18 08:19:05 +0100
commit787b65130c31c3a911e760a1387e717940b697ef (patch)
treed18204581253847cc9fe932f098b7bdef8873954
parent5b8966e089016d18d69d6081eba685b5524799dc (diff)
Rename QResourcesManager -> QResourceManager and make private
Once we are happy with the API we can make this public for a future release. Change-Id: I914f087e10adddbadac1649a8b889b9f53f82fd2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/core/resources/qhandlemanager.h2
-rw-r--r--src/core/resources/qresourcemanager.cpp (renamed from src/core/resources/qresourcesmanager.cpp)12
-rw-r--r--src/core/resources/qresourcemanager_p.h (renamed from src/core/resources/qresourcesmanager.h)28
-rw-r--r--src/core/resources/resources.pri4
-rw-r--r--src/input/inputmanagers_p.h6
-rw-r--r--src/render/backend/managers_p.h42
-rw-r--r--src/render/backend/meshdatamanager_p.h5
-rw-r--r--src/render/backend/scenemanager.cpp2
-rw-r--r--src/render/backend/scenemanager_p.h12
-rw-r--r--src/render/backend/texturedatamanager_p.h12
-rw-r--r--tests/auto/core/arrayresourcesmanager/dynamicarraypolicy/dynamicarraypolicy.pro2
-rw-r--r--tests/auto/core/arrayresourcesmanager/dynamicarraypolicy/tst_dynamicarraypolicy.cpp28
-rw-r--r--tests/auto/core/arrayresourcesmanager/preallocatedarraypolicy/preallocatedarraypolicy.pro2
-rw-r--r--tests/auto/core/arrayresourcesmanager/preallocatedarraypolicy/tst_preallocatedarraypolicy.cpp28
-rw-r--r--tests/auto/core/listresourcesmanager/listresourcesmanager.pro2
-rw-r--r--tests/auto/core/listresourcesmanager/tst_listresourcesmanager.cpp28
-rw-r--r--tests/benchmarks/core/qresourcesmanager/arraypolicy/arraypolicy.pro2
-rw-r--r--tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp2
-rw-r--r--tests/benchmarks/core/qresourcesmanager/qresourcesmanager/qresourcesmanager.pro2
-rw-r--r--tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp42
20 files changed, 132 insertions, 131 deletions
diff --git a/src/core/resources/qhandlemanager.h b/src/core/resources/qhandlemanager.h
index 5a67d131b..9f02a5e02 100644
--- a/src/core/resources/qhandlemanager.h
+++ b/src/core/resources/qhandlemanager.h
@@ -157,7 +157,7 @@ void QHandleManager<T, INDEXBITS>::release(const QHandle<T, INDEXBITS> &handle)
--m_activeEntryCount;
}
-// Needed in case the QResourcesManager has reordered
+// Needed in case the QResourceManager has reordered
// memory so that the handle still points to valid data
template <typename T, uint INDEXBITS>
void QHandleManager<T, INDEXBITS>::update(const QHandle<T, INDEXBITS> &handle, T *d)
diff --git a/src/core/resources/qresourcesmanager.cpp b/src/core/resources/qresourcemanager.cpp
index 2ccf70b50..38cf46815 100644
--- a/src/core/resources/qresourcesmanager.cpp
+++ b/src/core/resources/qresourcemanager.cpp
@@ -40,12 +40,12 @@
****************************************************************************/
/*!
- * \class QResourcesManager
+ * \class QResourceManager
*
- * \brief The QResourcesManager allocates memory for resources that can be referenced by a
+ * \brief The QResourceManager allocates memory for resources that can be referenced by a
* QHandle.
*
- * Using a QHandleManager for handle management, the QResourcesManager's responsibility is
+ * Using a QHandleManager for handle management, the QResourceManager's responsibility is
* to provide memory for resources and to offer ways to interact with the resource through
* the QHandle.
*
@@ -73,7 +73,7 @@
*
* \since 5.3
* \namespace Qt3D
- * \sa QResourcesManager
+ * \sa QResourceManager
* \sa ListAllocatingPolicy
*/
@@ -91,7 +91,7 @@
*
* \since 5.3
* \namespace Qt3D
- * \sa QResourcesManager
+ * \sa QResourceManager
* \sa ArrayAllocatingPolicy
*/
@@ -100,7 +100,7 @@
*
* \brief Provided locking access to a resource through the use of a QReadWriteLock.
*
- * This policy should be used in a QResourcesManager when multiple thread might access the manager for
+ * This policy should be used in a QResourceManager when multiple thread might access the manager for
* read or write operations at the same time.
*
* It provides two convenience classes WriteLocker and ReadLocker that behave like QReadLocker and QWriteLocker.
diff --git a/src/core/resources/qresourcesmanager.h b/src/core/resources/qresourcemanager_p.h
index d1fc218bc..cb3dc9d9b 100644
--- a/src/core/resources/qresourcesmanager.h
+++ b/src/core/resources/qresourcemanager_p.h
@@ -332,56 +332,56 @@ template <typename T, typename C, uint INDEXBITS = 16,
template <typename, uint> class AllocatingPolicy = ArrayAllocatingPolicy,
template <class> class LockingPolicy = NonLockingPolicy
>
-class QResourcesManager
+class QResourceManager
: public AllocatingPolicy<T, INDEXBITS>
- , public LockingPolicy< QResourcesManager<T, C, INDEXBITS, AllocatingPolicy, LockingPolicy> >
+ , public LockingPolicy< QResourceManager<T, C, INDEXBITS, AllocatingPolicy, LockingPolicy> >
{
public:
- QResourcesManager() :
+ QResourceManager() :
AllocatingPolicy<T, INDEXBITS>(),
m_maxResourcesEntries((1 << INDEXBITS) - 1)
{
}
- ~QResourcesManager()
+ ~QResourceManager()
{}
QHandle<T, INDEXBITS> acquire()
{
- typename LockingPolicy<QResourcesManager>::Locker lock(this);
+ typename LockingPolicy<QResourceManager>::Locker lock(this);
QHandle<T, INDEXBITS> handle = m_handleManager.acquire(AllocatingPolicy<T, INDEXBITS>::allocateResource());
return handle;
}
T* data(const QHandle<T, INDEXBITS> &handle)
{
- typename LockingPolicy<QResourcesManager>::Locker lock(this);
+ typename LockingPolicy<QResourceManager>::Locker lock(this);
T* d = m_handleManager.data(handle);
return d;
}
void release(const QHandle<T, INDEXBITS> &handle)
{
- typename LockingPolicy<QResourcesManager>::Locker lock(this);
+ typename LockingPolicy<QResourceManager>::Locker lock(this);
releaseLocked(handle);
}
void reset()
{
- typename LockingPolicy<QResourcesManager>::Locker lock(this);
+ typename LockingPolicy<QResourceManager>::Locker lock(this);
m_handleManager.reset();
AllocatingPolicy<T, INDEXBITS>::reset();
}
bool contains(const C &id) const
{
- typename LockingPolicy<QResourcesManager>::Locker lock(this);
+ typename LockingPolicy<QResourceManager>::Locker lock(this);
return m_handleToResourceMapper.contains(id);
}
QHandle<T, INDEXBITS> getOrAcquireHandle(const C &id)
{
- typename LockingPolicy<QResourcesManager>::Locker lock(this);
+ typename LockingPolicy<QResourceManager>::Locker lock(this);
QHandle<T, INDEXBITS> &handle = m_handleToResourceMapper[id];
if (handle.isNull())
handle = m_handleManager.acquire(AllocatingPolicy<T, INDEXBITS>::allocateResource());
@@ -390,7 +390,7 @@ public:
QHandle<T, INDEXBITS> lookupHandle(const C &id)
{
- typename LockingPolicy<QResourcesManager>::Locker lock(this);
+ typename LockingPolicy<QResourceManager>::Locker lock(this);
return m_handleToResourceMapper.value(id);
}
@@ -398,7 +398,7 @@ public:
{
T* ret = Q_NULLPTR;
{
- typename LockingPolicy<QResourcesManager>::Locker lock(this);
+ typename LockingPolicy<QResourceManager>::Locker lock(this);
QHandle<T, INDEXBITS> handle = m_handleToResourceMapper.value(id);
if (!handle.isNull())
ret = m_handleManager.data(handle);
@@ -408,7 +408,7 @@ public:
T *getOrCreateResource(const C &id)
{
- typename LockingPolicy<QResourcesManager>::Locker lock(this);
+ typename LockingPolicy<QResourceManager>::Locker lock(this);
QHandle<T, INDEXBITS> &handle = m_handleToResourceMapper[id];
if (handle.isNull())
handle = m_handleManager.acquire(AllocatingPolicy<T, INDEXBITS>::allocateResource());
@@ -417,7 +417,7 @@ public:
void releaseResource(const C &id)
{
- typename LockingPolicy<QResourcesManager>::Locker lock(this);
+ typename LockingPolicy<QResourceManager>::Locker lock(this);
QHandle<T, INDEXBITS> handle = m_handleToResourceMapper.take(id);
if (!handle.isNull())
releaseLocked(handle);
diff --git a/src/core/resources/resources.pri b/src/core/resources/resources.pri
index 0d64ddad0..d1befe69f 100644
--- a/src/core/resources/resources.pri
+++ b/src/core/resources/resources.pri
@@ -1,13 +1,13 @@
HEADERS += \
$$PWD/qhandle.h \
$$PWD/qhandlemanager.h \
- $$PWD/qresourcesmanager.h \
+ $$PWD/qresourcemanager_p.h \
$$PWD/qcircularbuffer.h \
$$PWD/qboundedcircularbuffer.h \
$$PWD/qframeallocator.h \
$$PWD/qframeallocator_p.h
SOURCES += \
- $$PWD/qresourcesmanager.cpp \
+ $$PWD/qresourcemanager.cpp \
$$PWD/qframeallocator.cpp
diff --git a/src/input/inputmanagers_p.h b/src/input/inputmanagers_p.h
index 75897ada2..923fb3c04 100644
--- a/src/input/inputmanagers_p.h
+++ b/src/input/inputmanagers_p.h
@@ -43,10 +43,10 @@
#define QT3D_INPUT_INPUTMANAGERS_P_H
#include <QtGlobal>
-#include <Qt3DCore/qresourcesmanager.h>
#include <Qt3DInput/private/handle_types_p.h>
#include <Qt3DInput/private/keyboardcontroller_p.h>
#include <Qt3DInput/private/keyboardinput_p.h>
+#include <Qt3DCore/private/qresourcemanager_p.h>
QT_BEGIN_NAMESPACE
@@ -54,7 +54,7 @@ namespace Qt3D {
namespace Input {
-class KeyboardInputManager : public QResourcesManager<
+class KeyboardInputManager : public QResourceManager<
KeyboardInput,
QNodeUuid,
16,
@@ -64,7 +64,7 @@ public:
KeyboardInputManager() {}
};
-class KeyboardControllerManager : public QResourcesManager<
+class KeyboardControllerManager : public QResourceManager<
KeyboardController,
QNodeUuid,
8,
diff --git a/src/render/backend/managers_p.h b/src/render/backend/managers_p.h
index e3c622691..1e9ac4611 100644
--- a/src/render/backend/managers_p.h
+++ b/src/render/backend/managers_p.h
@@ -42,7 +42,7 @@
#ifndef QT3D_RENDER_MANAGERS_P_H
#define QT3D_RENDER_MANAGERS_P_H
-#include <Qt3DCore/qresourcesmanager.h>
+#include <Qt3DCore/private/qresourcemanager_p.h>
#include <Qt3DRenderer/private/renderattachment_p.h>
#include <Qt3DRenderer/private/rendercameralens_p.h>
#include <Qt3DRenderer/private/renderannotation_p.h>
@@ -70,7 +70,7 @@ class QMeshData;
namespace Render {
-class AttachmentManager : public QResourcesManager<
+class AttachmentManager : public QResourceManager<
RenderAttachment,
QNodeUuid,
16,
@@ -81,7 +81,7 @@ public:
AttachmentManager() {}
};
-class CameraManager : public QResourcesManager<
+class CameraManager : public QResourceManager<
RenderCameraLens,
QNodeUuid,
8,
@@ -91,7 +91,7 @@ public:
CameraManager() {}
};
-class CriterionManager : public QResourcesManager<
+class CriterionManager : public QResourceManager<
RenderAnnotation,
QNodeUuid,
16,
@@ -103,7 +103,7 @@ public:
CriterionManager() {}
};
-class EffectManager : public QResourcesManager<
+class EffectManager : public QResourceManager<
RenderEffect,
QNodeUuid,
16,
@@ -114,13 +114,13 @@ public:
EffectManager() {}
};
-class EntityManager : public QResourcesManager<RenderEntity, QNodeUuid, 16>
+class EntityManager : public QResourceManager<RenderEntity, QNodeUuid, 16>
{
public:
EntityManager() {}
};
-class FrameGraphManager : public QResourcesManager<
+class FrameGraphManager : public QResourceManager<
FrameGraphNode *,
QNodeUuid,
8,
@@ -130,7 +130,7 @@ public:
FrameGraphManager() {}
};
-class LayerManager : public QResourcesManager<
+class LayerManager : public QResourceManager<
RenderLayer,
QNodeUuid,
16,
@@ -141,7 +141,7 @@ public:
LayerManager() {}
};
-class LightManager : public QResourcesManager<
+class LightManager : public QResourceManager<
RenderLight,
QNodeUuid,
16,
@@ -152,7 +152,7 @@ public:
LightManager() {}
};
-class MaterialManager : public QResourcesManager<
+class MaterialManager : public QResourceManager<
RenderMaterial,
QNodeUuid,
16,
@@ -163,13 +163,13 @@ public:
MaterialManager() {}
};
-class MatrixManager : public QResourcesManager<QMatrix4x4, QNodeUuid, 16>
+class MatrixManager : public QResourceManager<QMatrix4x4, QNodeUuid, 16>
{
public:
MatrixManager() {}
};
-class MeshManager : public QResourcesManager<
+class MeshManager : public QResourceManager<
RenderMesh,
QNodeUuid,
16,
@@ -180,7 +180,7 @@ public:
MeshManager() {}
};
-class ShaderManager : public QResourcesManager<
+class ShaderManager : public QResourceManager<
RenderShader,
QNodeUuid,
16,
@@ -191,7 +191,7 @@ public:
ShaderManager() {}
};
-class SortCriterionManager : public QResourcesManager<
+class SortCriterionManager : public QResourceManager<
SortCriterion,
QNodeUuid,
8,
@@ -202,7 +202,7 @@ public:
SortCriterionManager() {}
};
-class TechniqueManager : public QResourcesManager<
+class TechniqueManager : public QResourceManager<
RenderTechnique,
QNodeUuid,
16,
@@ -213,7 +213,7 @@ public:
TechniqueManager() {}
};
-class TextureManager : public QResourcesManager<
+class TextureManager : public QResourceManager<
RenderTexture,
QNodeUuid,
16,
@@ -224,7 +224,7 @@ public:
TextureManager() {}
};
-class TransformManager : public QResourcesManager<
+class TransformManager : public QResourceManager<
RenderTransform,
QNodeUuid,
16,
@@ -235,7 +235,7 @@ public:
TransformManager() {}
};
-class VAOManager : public QResourcesManager<
+class VAOManager : public QResourceManager<
QOpenGLVertexArrayObject *,
QPair<HMeshData, HShader>,
16>
@@ -244,7 +244,7 @@ public:
VAOManager() {}
};
-class RenderTargetManager : public QResourcesManager<
+class RenderTargetManager : public QResourceManager<
RenderTarget,
QNodeUuid,
8,
@@ -255,7 +255,7 @@ public:
RenderTargetManager() {}
};
-class RenderPassManager : public QResourcesManager<
+class RenderPassManager : public QResourceManager<
RenderRenderPass,
QNodeUuid,
16,
@@ -267,7 +267,7 @@ public:
};
-class ParameterManager : public QResourcesManager<
+class ParameterManager : public QResourceManager<
RenderParameter,
QNodeUuid,
16,
diff --git a/src/render/backend/meshdatamanager_p.h b/src/render/backend/meshdatamanager_p.h
index 11a9ddd08..adceb6fab 100644
--- a/src/render/backend/meshdatamanager_p.h
+++ b/src/render/backend/meshdatamanager_p.h
@@ -43,11 +43,12 @@
#define QT3D_RENDER_MESHDATAMANAGER_H
#include <Qt3DRenderer/qabstractmesh.h>
-#include <Qt3DCore/qresourcesmanager.h>
#include <Qt3DRenderer/qmeshdata.h>
#include <Qt3DRenderer/private/rendermesh_p.h>
#include <Qt3DRenderer/private/handle_types_p.h>
+#include <Qt3DCore/private/qresourcemanager_p.h>
+
#include <QHash>
#include <QPair>
#include <QString>
@@ -58,7 +59,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
namespace Render {
-class MeshDataManager : public QResourcesManager<QMeshData,
+class MeshDataManager : public QResourceManager<QMeshData,
QNodeUuid,
16,
Qt3D::ListAllocatingPolicy,
diff --git a/src/render/backend/scenemanager.cpp b/src/render/backend/scenemanager.cpp
index 9b04ad7b4..0d5b358b9 100644
--- a/src/render/backend/scenemanager.cpp
+++ b/src/render/backend/scenemanager.cpp
@@ -47,7 +47,7 @@ namespace Qt3D {
namespace Render {
-SceneManager::SceneManager() : QResourcesManager<RenderScene,
+SceneManager::SceneManager() : QResourceManager<RenderScene,
QNodeUuid,
8,
Qt3D::ArrayAllocatingPolicy,
diff --git a/src/render/backend/scenemanager_p.h b/src/render/backend/scenemanager_p.h
index 5ff0c36a4..203aa1c55 100644
--- a/src/render/backend/scenemanager_p.h
+++ b/src/render/backend/scenemanager_p.h
@@ -42,7 +42,7 @@
#ifndef QT3D_RENDER_SCENEMANAGER_P_H
#define QT3D_RENDER_SCENEMANAGER_P_H
-#include <Qt3DCore/qresourcesmanager.h>
+#include <Qt3DCore/private/qresourcemanager_p.h>
#include <Qt3DRenderer/private/renderscene_p.h>
#include <Qt3DRenderer/loadscenejob.h>
#include <Qt3DCore/qnodeuuid.h>
@@ -55,11 +55,11 @@ class QEntity;
namespace Render {
-class SceneManager : public QResourcesManager<RenderScene,
- QNodeUuid,
- 8,
- Qt3D::ArrayAllocatingPolicy,
- Qt3D::ObjectLevelLockingPolicy>
+class SceneManager : public QResourceManager<RenderScene,
+ QNodeUuid,
+ 8,
+ Qt3D::ArrayAllocatingPolicy,
+ Qt3D::ObjectLevelLockingPolicy>
{
public:
SceneManager();
diff --git a/src/render/backend/texturedatamanager_p.h b/src/render/backend/texturedatamanager_p.h
index e1b57236d..dbfc102b7 100644
--- a/src/render/backend/texturedatamanager_p.h
+++ b/src/render/backend/texturedatamanager_p.h
@@ -42,7 +42,7 @@
#ifndef QT3D_RENDER_TEXTUREDATAMANAGER_H
#define QT3D_RENDER_TEXTUREDATAMANAGER_H
-#include <Qt3DCore/QResourcesManager>
+#include <Qt3DCore/private/qresourcemanager_p.h>
#include <Qt3DRenderer/qtexture.h>
#include <Qt3DRenderer/texturedata.h>
#include <Qt3DRenderer/private/handle_types_p.h>
@@ -55,11 +55,11 @@ namespace Qt3D {
namespace Render {
-class TextureDataManager : public QResourcesManager<TexImageData,
- QNodeUuid,
- 16,
- Qt3D::ListAllocatingPolicy,
- Qt3D::ObjectLevelLockingPolicy>
+class TextureDataManager : public QResourceManager<TexImageData,
+ QNodeUuid,
+ 16,
+ Qt3D::ListAllocatingPolicy,
+ Qt3D::ObjectLevelLockingPolicy>
{
public:
TextureDataManager() {}
diff --git a/tests/auto/core/arrayresourcesmanager/dynamicarraypolicy/dynamicarraypolicy.pro b/tests/auto/core/arrayresourcesmanager/dynamicarraypolicy/dynamicarraypolicy.pro
index db6704cd6..ee2a73e03 100644
--- a/tests/auto/core/arrayresourcesmanager/dynamicarraypolicy/dynamicarraypolicy.pro
+++ b/tests/auto/core/arrayresourcesmanager/dynamicarraypolicy/dynamicarraypolicy.pro
@@ -4,4 +4,4 @@ TEMPLATE = app
SOURCES += tst_dynamicarraypolicy.cpp
-QT += testlib 3dcore
+QT += testlib 3dcore 3dcore-private
diff --git a/tests/auto/core/arrayresourcesmanager/dynamicarraypolicy/tst_dynamicarraypolicy.cpp b/tests/auto/core/arrayresourcesmanager/dynamicarraypolicy/tst_dynamicarraypolicy.cpp
index 90b48ba10..adc1b0366 100644
--- a/tests/auto/core/arrayresourcesmanager/dynamicarraypolicy/tst_dynamicarraypolicy.cpp
+++ b/tests/auto/core/arrayresourcesmanager/dynamicarraypolicy/tst_dynamicarraypolicy.cpp
@@ -41,8 +41,8 @@
#include <QtTest/QtTest>
#include <QList>
-#include <Qt3DCore/qresourcesmanager.h>
#include <Qt3DCore/qhandle.h>
+#include <Qt3DCore/private/qresourcemanager_p.h>
class tst_DynamicArrayPolicy : public QObject
{
@@ -81,9 +81,9 @@ typedef Qt3D::QHandle<tst_ArrayResource, 16> tHandle16;
void tst_DynamicArrayPolicy::createResourcesManager()
{
- Qt3D::QResourcesManager<tst_ArrayResource, int, 16> manager16;
- Qt3D::QResourcesManager<tst_ArrayResource, int, 4> manager4;
- Qt3D::QResourcesManager<tst_ArrayResource, int, 8> manager8;
+ Qt3D::QResourceManager<tst_ArrayResource, int, 16> manager16;
+ Qt3D::QResourceManager<tst_ArrayResource, int, 4> manager4;
+ Qt3D::QResourceManager<tst_ArrayResource, int, 8> manager8;
QVERIFY(manager16.maxResourcesEntries() == 65535);
QVERIFY(manager8.maxResourcesEntries() == 255);
QVERIFY(manager4.maxResourcesEntries() == 15);
@@ -95,7 +95,7 @@ void tst_DynamicArrayPolicy::createResourcesManager()
*/
void tst_DynamicArrayPolicy::acquireResources()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint, 4> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint, 4> manager;
QList<tHandle4> handles;
@@ -115,7 +115,7 @@ void tst_DynamicArrayPolicy::acquireResources()
void tst_DynamicArrayPolicy::getResources()
{
- Qt3D::QResourcesManager<tst_ArrayResource, int, 8> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, int, 8> manager;
QList<tst_ArrayResource *> resources;
QList<tHandle8> handles;
@@ -146,7 +146,7 @@ void tst_DynamicArrayPolicy::getResources()
*/
void tst_DynamicArrayPolicy::registerResourcesResize()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint, 16> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint, 16> manager;
QList<tHandle16> handles;
for (uint i = 0; i < 2; i++) {
@@ -174,7 +174,7 @@ void tst_DynamicArrayPolicy::registerResourcesResize()
*/
void tst_DynamicArrayPolicy::removeResource()
{
- Qt3D::QResourcesManager<tst_ArrayResource, int> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, int> manager;
QList<tst_ArrayResource *> resources;
QList<tHandle> handles;
@@ -198,7 +198,7 @@ void tst_DynamicArrayPolicy::removeResource()
*/
void tst_DynamicArrayPolicy::resetResource()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint> manager;
QList<tst_ArrayResource *> resources;
QList<tHandle16> handles;
@@ -225,7 +225,7 @@ void tst_DynamicArrayPolicy::resetResource()
void tst_DynamicArrayPolicy::lookupResource()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint> manager;
QList<tst_ArrayResource *> resources;
QList<tHandle16> handles;
@@ -250,7 +250,7 @@ void tst_DynamicArrayPolicy::lookupResource()
void tst_DynamicArrayPolicy::releaseResource()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint> manager;
QList<tst_ArrayResource *> resources;
for (int i = 0; i < 5; i++) {
@@ -272,7 +272,7 @@ class tst_Thread : public QThread
Q_OBJECT
public:
- typedef Qt3D::QResourcesManager<tst_ArrayResource,
+ typedef Qt3D::QResourceManager<tst_ArrayResource,
int,
16,
Qt3D::ArrayAllocatingPolicy,
@@ -343,7 +343,7 @@ class tst_Thread2 : public QThread
Q_OBJECT
public:
- typedef Qt3D::QResourcesManager<tst_ArrayResource,
+ typedef Qt3D::QResourceManager<tst_ArrayResource,
int,
16,
Qt3D::ArrayAllocatingPolicy,
@@ -419,7 +419,7 @@ void tst_DynamicArrayPolicy::heavyDutyMultiThreadedAccessRelease()
void tst_DynamicArrayPolicy::maximumNumberOfResources()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint> manager;
QList<tst_ArrayResource *> resources;
QList<tHandle16> handles;
diff --git a/tests/auto/core/arrayresourcesmanager/preallocatedarraypolicy/preallocatedarraypolicy.pro b/tests/auto/core/arrayresourcesmanager/preallocatedarraypolicy/preallocatedarraypolicy.pro
index f21c0a140..636c155b2 100644
--- a/tests/auto/core/arrayresourcesmanager/preallocatedarraypolicy/preallocatedarraypolicy.pro
+++ b/tests/auto/core/arrayresourcesmanager/preallocatedarraypolicy/preallocatedarraypolicy.pro
@@ -4,4 +4,4 @@ TEMPLATE = app
SOURCES += tst_preallocatedarraypolicy.cpp
-QT += testlib 3dcore
+QT += testlib 3dcore 3dcore-private
diff --git a/tests/auto/core/arrayresourcesmanager/preallocatedarraypolicy/tst_preallocatedarraypolicy.cpp b/tests/auto/core/arrayresourcesmanager/preallocatedarraypolicy/tst_preallocatedarraypolicy.cpp
index ffdccf847..4801d8a3a 100644
--- a/tests/auto/core/arrayresourcesmanager/preallocatedarraypolicy/tst_preallocatedarraypolicy.cpp
+++ b/tests/auto/core/arrayresourcesmanager/preallocatedarraypolicy/tst_preallocatedarraypolicy.cpp
@@ -41,7 +41,7 @@
#include <QtTest/QtTest>
#include <QList>
-#include <Qt3DCore/qresourcesmanager.h>
+#include <Qt3DCore/private/qresourcemanager_p.h>
#include <Qt3DCore/qhandle.h>
class tst_PreallocatedArrayPolicy : public QObject
@@ -81,9 +81,9 @@ typedef Qt3D::QHandle<tst_ArrayResource, 16> tHandle16;
void tst_PreallocatedArrayPolicy::createResourcesManager()
{
- Qt3D::QResourcesManager<tst_ArrayResource, int, 16, Qt3D::ArrayPreallocationPolicy> manager16;
- Qt3D::QResourcesManager<tst_ArrayResource, int, 4, Qt3D::ArrayPreallocationPolicy> manager4;
- Qt3D::QResourcesManager<tst_ArrayResource, int, 8, Qt3D::ArrayPreallocationPolicy> manager8;
+ Qt3D::QResourceManager<tst_ArrayResource, int, 16, Qt3D::ArrayPreallocationPolicy> manager16;
+ Qt3D::QResourceManager<tst_ArrayResource, int, 4, Qt3D::ArrayPreallocationPolicy> manager4;
+ Qt3D::QResourceManager<tst_ArrayResource, int, 8, Qt3D::ArrayPreallocationPolicy> manager8;
QVERIFY(manager16.maxResourcesEntries() == 65535);
QVERIFY(manager8.maxResourcesEntries() == 255);
QVERIFY(manager4.maxResourcesEntries() == 15);
@@ -95,7 +95,7 @@ void tst_PreallocatedArrayPolicy::createResourcesManager()
*/
void tst_PreallocatedArrayPolicy::acquireResources()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint, 4, Qt3D::ArrayPreallocationPolicy> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint, 4, Qt3D::ArrayPreallocationPolicy> manager;
QList<tHandle4> handles;
@@ -115,7 +115,7 @@ void tst_PreallocatedArrayPolicy::acquireResources()
void tst_PreallocatedArrayPolicy::getResources()
{
- Qt3D::QResourcesManager<tst_ArrayResource, int, 8, Qt3D::ArrayPreallocationPolicy> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, int, 8, Qt3D::ArrayPreallocationPolicy> manager;
QList<tst_ArrayResource *> resources;
QList<tHandle8> handles;
@@ -146,7 +146,7 @@ void tst_PreallocatedArrayPolicy::getResources()
*/
void tst_PreallocatedArrayPolicy::registerResourcesResize()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint, 16, Qt3D::ArrayPreallocationPolicy> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint, 16, Qt3D::ArrayPreallocationPolicy> manager;
QList<tHandle16> handles;
for (uint i = 0; i < 2; i++) {
@@ -174,7 +174,7 @@ void tst_PreallocatedArrayPolicy::registerResourcesResize()
*/
void tst_PreallocatedArrayPolicy::removeResource()
{
- Qt3D::QResourcesManager<tst_ArrayResource, int, 16, Qt3D::ArrayPreallocationPolicy> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, int, 16, Qt3D::ArrayPreallocationPolicy> manager;
QList<tst_ArrayResource *> resources;
QList<tHandle> handles;
@@ -198,7 +198,7 @@ void tst_PreallocatedArrayPolicy::removeResource()
*/
void tst_PreallocatedArrayPolicy::resetResource()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint, 16, Qt3D::ArrayPreallocationPolicy> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint, 16, Qt3D::ArrayPreallocationPolicy> manager;
QList<tst_ArrayResource *> resources;
QList<tHandle16> handles;
@@ -225,7 +225,7 @@ void tst_PreallocatedArrayPolicy::resetResource()
void tst_PreallocatedArrayPolicy::lookupResource()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint, 16, Qt3D::ArrayPreallocationPolicy> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint, 16, Qt3D::ArrayPreallocationPolicy> manager;
QList<tst_ArrayResource *> resources;
QList<tHandle16> handles;
@@ -250,7 +250,7 @@ void tst_PreallocatedArrayPolicy::lookupResource()
void tst_PreallocatedArrayPolicy::releaseResource()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint, 16, Qt3D::ArrayPreallocationPolicy> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint, 16, Qt3D::ArrayPreallocationPolicy> manager;
QList<tst_ArrayResource *> resources;
for (int i = 0; i < 5; i++) {
@@ -272,7 +272,7 @@ class tst_Thread : public QThread
Q_OBJECT
public:
- typedef Qt3D::QResourcesManager<tst_ArrayResource,
+ typedef Qt3D::QResourceManager<tst_ArrayResource,
int,
16,
Qt3D::ArrayPreallocationPolicy,
@@ -344,7 +344,7 @@ class tst_Thread2 : public QThread
Q_OBJECT
public:
- typedef Qt3D::QResourcesManager<tst_ArrayResource,
+ typedef Qt3D::QResourceManager<tst_ArrayResource,
int,
16,
Qt3D::ArrayPreallocationPolicy,
@@ -420,7 +420,7 @@ void tst_PreallocatedArrayPolicy::heavyDutyMultiThreadedAccessRelease()
void tst_PreallocatedArrayPolicy::maximumNumberOfResources()
{
- Qt3D::QResourcesManager<tst_ArrayResource, uint, 16, Qt3D::ArrayPreallocationPolicy> manager;
+ Qt3D::QResourceManager<tst_ArrayResource, uint, 16, Qt3D::ArrayPreallocationPolicy> manager;
QList<tst_ArrayResource *> resources;
QList<tHandle16> handles;
diff --git a/tests/auto/core/listresourcesmanager/listresourcesmanager.pro b/tests/auto/core/listresourcesmanager/listresourcesmanager.pro
index fa062bcf2..ab1ea78db 100644
--- a/tests/auto/core/listresourcesmanager/listresourcesmanager.pro
+++ b/tests/auto/core/listresourcesmanager/listresourcesmanager.pro
@@ -4,4 +4,4 @@ TEMPLATE = app
SOURCES += tst_listresourcesmanager.cpp
-QT += testlib 3dcore
+QT += testlib 3dcore 3dcore-private
diff --git a/tests/auto/core/listresourcesmanager/tst_listresourcesmanager.cpp b/tests/auto/core/listresourcesmanager/tst_listresourcesmanager.cpp
index abf695093..0a9421b16 100644
--- a/tests/auto/core/listresourcesmanager/tst_listresourcesmanager.cpp
+++ b/tests/auto/core/listresourcesmanager/tst_listresourcesmanager.cpp
@@ -41,8 +41,8 @@
#include <QtTest/QtTest>
#include <QList>
-#include <Qt3DCore/qresourcesmanager.h>
#include <Qt3DCore/qhandle.h>
+#include <Qt3DCore/private/qresourcemanager_p.h>
class tst_ListResourcesManager : public QObject
{
@@ -81,9 +81,9 @@ typedef Qt3D::QHandle<tst_ListResource, 16> tHandle16;
void tst_ListResourcesManager::createResourcesManager()
{
- Qt3D::QResourcesManager<tst_ListResource, int, 16, Qt3D::ListAllocatingPolicy> manager16;
- Qt3D::QResourcesManager<tst_ListResource, int, 4, Qt3D::ListAllocatingPolicy> manager4;
- Qt3D::QResourcesManager<tst_ListResource, int, 8, Qt3D::ListAllocatingPolicy> manager8;
+ Qt3D::QResourceManager<tst_ListResource, int, 16, Qt3D::ListAllocatingPolicy> manager16;
+ Qt3D::QResourceManager<tst_ListResource, int, 4, Qt3D::ListAllocatingPolicy> manager4;
+ Qt3D::QResourceManager<tst_ListResource, int, 8, Qt3D::ListAllocatingPolicy> manager8;
QVERIFY(manager16.maxResourcesEntries() == 65535);
QVERIFY(manager8.maxResourcesEntries() == 255);
@@ -96,7 +96,7 @@ void tst_ListResourcesManager::createResourcesManager()
*/
void tst_ListResourcesManager::acquireResources()
{
- Qt3D::QResourcesManager<tst_ListResource, int, 4, Qt3D::ListAllocatingPolicy> manager;
+ Qt3D::QResourceManager<tst_ListResource, int, 4, Qt3D::ListAllocatingPolicy> manager;
QList<tHandle4> handles;
@@ -116,7 +116,7 @@ void tst_ListResourcesManager::acquireResources()
void tst_ListResourcesManager::getResources()
{
- Qt3D::QResourcesManager<tst_ListResource, int, 8, Qt3D::ListAllocatingPolicy> manager;
+ Qt3D::QResourceManager<tst_ListResource, int, 8, Qt3D::ListAllocatingPolicy> manager;
QList<tst_ListResource *> resources;
QList<tHandle8> handles;
@@ -147,7 +147,7 @@ void tst_ListResourcesManager::getResources()
*/
void tst_ListResourcesManager::registerResourcesResize()
{
- Qt3D::QResourcesManager<tst_ListResource, int, 16, Qt3D::ListAllocatingPolicy> manager;
+ Qt3D::QResourceManager<tst_ListResource, int, 16, Qt3D::ListAllocatingPolicy> manager;
QList<tHandle16> handles;
for (uint i = 0; i < 2; i++) {
@@ -175,7 +175,7 @@ void tst_ListResourcesManager::registerResourcesResize()
*/
void tst_ListResourcesManager::removeResource()
{
- Qt3D::QResourcesManager<tst_ListResource, int, 16, Qt3D::ListAllocatingPolicy> manager;
+ Qt3D::QResourceManager<tst_ListResource, int, 16, Qt3D::ListAllocatingPolicy> manager;
QList<tst_ListResource *> resources;
QList<tHandle> handles;
@@ -199,7 +199,7 @@ void tst_ListResourcesManager::removeResource()
*/
void tst_ListResourcesManager::resetResource()
{
- Qt3D::QResourcesManager<tst_ListResource, int, 16, Qt3D::ListAllocatingPolicy> manager;
+ Qt3D::QResourceManager<tst_ListResource, int, 16, Qt3D::ListAllocatingPolicy> manager;
QList<tst_ListResource *> resources;
QList<tHandle16> handles;
@@ -226,7 +226,7 @@ void tst_ListResourcesManager::resetResource()
void tst_ListResourcesManager::lookupResource()
{
- Qt3D::QResourcesManager<tst_ListResource, uint, 16, Qt3D::ListAllocatingPolicy> manager;
+ Qt3D::QResourceManager<tst_ListResource, uint, 16, Qt3D::ListAllocatingPolicy> manager;
QList<tst_ListResource *> resources;
QList<tHandle16> handles;
@@ -251,7 +251,7 @@ void tst_ListResourcesManager::lookupResource()
void tst_ListResourcesManager::releaseResource()
{
- Qt3D::QResourcesManager<tst_ListResource, uint, 16, Qt3D::ListAllocatingPolicy> manager;
+ Qt3D::QResourceManager<tst_ListResource, uint, 16, Qt3D::ListAllocatingPolicy> manager;
QList<tst_ListResource *> resources;
for (int i = 0; i < 5; i++) {
@@ -273,7 +273,7 @@ class tst_Thread : public QThread
Q_OBJECT
public:
- typedef Qt3D::QResourcesManager<tst_ListResource,
+ typedef Qt3D::QResourceManager<tst_ListResource,
int,
16,
Qt3D::ListAllocatingPolicy,
@@ -344,7 +344,7 @@ class tst_Thread2 : public QThread
Q_OBJECT
public:
- typedef Qt3D::QResourcesManager<tst_ListResource,
+ typedef Qt3D::QResourceManager<tst_ListResource,
int,
16,
Qt3D::ListAllocatingPolicy,
@@ -420,7 +420,7 @@ void tst_ListResourcesManager::heavyDutyMultiThreadedAccessRelease()
void tst_ListResourcesManager::maximumNumberOfResources()
{
- Qt3D::QResourcesManager<tst_ListResource, uint, 16, Qt3D::ListAllocatingPolicy> manager;
+ Qt3D::QResourceManager<tst_ListResource, uint, 16, Qt3D::ListAllocatingPolicy> manager;
QList<tst_ListResource *> resources;
QList<tHandle16> handles;
diff --git a/tests/benchmarks/core/qresourcesmanager/arraypolicy/arraypolicy.pro b/tests/benchmarks/core/qresourcesmanager/arraypolicy/arraypolicy.pro
index 2195d5e4f..2c54ab63c 100644
--- a/tests/benchmarks/core/qresourcesmanager/arraypolicy/arraypolicy.pro
+++ b/tests/benchmarks/core/qresourcesmanager/arraypolicy/arraypolicy.pro
@@ -1,6 +1,6 @@
TARGET = tst_bench_arraypolicy
TEMPLATE = app
-QT += testlib 3dcore
+QT += testlib 3dcore 3dcore-private
SOURCES += tst_bench_arraypolicy.cpp
diff --git a/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp b/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp
index 19580be11..02ea5284d 100644
--- a/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp
+++ b/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp
@@ -41,7 +41,7 @@
#include <QtTest/QtTest>
#include <QMatrix4x4>
-#include <Qt3DCore/QResourcesManager>
+#include <Qt3DCore/private/qresourcemanager_p.h>
class tst_ArrayPolicy : public QObject
{
diff --git a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/qresourcesmanager.pro b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/qresourcesmanager.pro
index ab2c9fc4c..12eead182 100644
--- a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/qresourcesmanager.pro
+++ b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/qresourcesmanager.pro
@@ -1,6 +1,6 @@
TARGET = tst_bench_qresourcesmanager
TEMPLATE = app
-QT += testlib 3dcore
+QT += testlib 3dcore 3dcore-private
SOURCES += tst_bench_qresourcesmanager.cpp
diff --git a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp
index 723e400b4..dfa64ddb8 100644
--- a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp
+++ b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp
@@ -41,11 +41,11 @@
#include <QtTest/QtTest>
#include <QMatrix4x4>
-#include <Qt3DCore/qresourcesmanager.h>
#include <Qt3DCore/qhandle.h>
+#include <Qt3DCore/private/qresourcemanager_p.h>
#include <ctime>
-class tst_QResourcesManager : public QObject
+class tst_QResourceManager : public QObject
{
Q_OBJECT
private Q_SLOTS:
@@ -81,7 +81,7 @@ public:
template<typename Resource>
void benchmarkAllocateResources()
{
- Qt3D::QResourcesManager<Resource, int, 16> manager;
+ Qt3D::QResourceManager<Resource, int, 16> manager;
volatile Resource *c;
QBENCHMARK_ONCE {
@@ -95,7 +95,7 @@ void benchmarkAllocateResources()
template<typename Resource>
void benchmarkAccessResources()
{
- Qt3D::QResourcesManager<Resource, int, 16> manager;
+ Qt3D::QResourceManager<Resource, int, 16> manager;
const int max = (1 << 16) - 1;
QVector<Qt3D::QHandle<Resource> > handles(max);
for (int i = 0; i < max; i++)
@@ -111,7 +111,7 @@ void benchmarkAccessResources()
template<typename Resource>
void benchmarkRandomAccessResource() {
- Qt3D::QResourcesManager<Resource, int, 16> manager;
+ Qt3D::QResourceManager<Resource, int, 16> manager;
const int max = (1 << 16) - 1;
QVector<Qt3D::QHandle<Resource> > handles(max);
for (int i = 0; i < max; i++)
@@ -130,7 +130,7 @@ void benchmarkRandomAccessResource() {
template<typename Resource>
void benchmarkLookupResources()
{
- Qt3D::QResourcesManager<Resource, int, 16> manager;
+ Qt3D::QResourceManager<Resource, int, 16> manager;
const int max = (1 << 16) - 1;
for (int i = 0; i < max; i++)
manager.getOrCreateResource(i);
@@ -146,7 +146,7 @@ void benchmarkLookupResources()
template<typename Resource>
void benchmarkRandomLookupResources()
{
- Qt3D::QResourcesManager<Resource, int, 16> manager;
+ Qt3D::QResourceManager<Resource, int, 16> manager;
const int max = (1 << 16) - 1;
QVector<int> resourcesIndices(max);
for (int i = 0; i < max; i++) {
@@ -166,7 +166,7 @@ void benchmarkRandomLookupResources()
template<typename Resource>
void benchmarkReleaseResources()
{
- Qt3D::QResourcesManager<Resource, int, 16> manager;
+ Qt3D::QResourceManager<Resource, int, 16> manager;
const int max = (1 << 16) - 1;
QVector<Qt3D::QHandle<Resource> > handles(max);
for (int i = 0; i < max; i++)
@@ -177,66 +177,66 @@ void benchmarkReleaseResources()
}
}
-void tst_QResourcesManager::benchmarkAllocateSmallResources()
+void tst_QResourceManager::benchmarkAllocateSmallResources()
{
benchmarkAllocateResources<tst_SmallArrayResource>();
}
-void tst_QResourcesManager::benchmarkAccessSmallResources()
+void tst_QResourceManager::benchmarkAccessSmallResources()
{
benchmarkAccessResources<tst_SmallArrayResource>();
}
-void tst_QResourcesManager::benchmarkLookupSmallResources()
+void tst_QResourceManager::benchmarkLookupSmallResources()
{
benchmarkLookupResources<tst_SmallArrayResource>();
}
-void tst_QResourcesManager::benchmarRandomAccessSmallResources()
+void tst_QResourceManager::benchmarRandomAccessSmallResources()
{
benchmarkRandomAccessResource<tst_SmallArrayResource>();
}
-void tst_QResourcesManager::benchmarkRandomLookupSmallResources()
+void tst_QResourceManager::benchmarkRandomLookupSmallResources()
{
benchmarkRandomLookupResources<tst_SmallArrayResource>();
}
-void tst_QResourcesManager::benchmarkReleaseSmallResources()
+void tst_QResourceManager::benchmarkReleaseSmallResources()
{
benchmarkReleaseResources<tst_SmallArrayResource>();
}
-void tst_QResourcesManager::benchmarkAllocateBigResources()
+void tst_QResourceManager::benchmarkAllocateBigResources()
{
benchmarkAllocateResources<tst_BigArrayResource>();
}
-void tst_QResourcesManager::benchmarkAccessBigResources()
+void tst_QResourceManager::benchmarkAccessBigResources()
{
benchmarkAccessResources<tst_BigArrayResource>();
}
-void tst_QResourcesManager::benchmarRandomAccessBigResources()
+void tst_QResourceManager::benchmarRandomAccessBigResources()
{
benchmarkRandomAccessResource<tst_BigArrayResource>();
}
-void tst_QResourcesManager::benchmarkLookupBigResources()
+void tst_QResourceManager::benchmarkLookupBigResources()
{
benchmarkLookupResources<tst_BigArrayResource>();
}
-void tst_QResourcesManager::benchmarkRandomLookupBigResources()
+void tst_QResourceManager::benchmarkRandomLookupBigResources()
{
benchmarkRandomLookupResources<tst_BigArrayResource>();
}
-void tst_QResourcesManager::benchmarkReleaseBigResources()
+void tst_QResourceManager::benchmarkReleaseBigResources()
{
benchmarkReleaseResources<tst_BigArrayResource>();
}
-QTEST_APPLESS_MAIN(tst_QResourcesManager)
+QTEST_APPLESS_MAIN(tst_QResourceManager)
#include "tst_bench_qresourcesmanager.moc"