summaryrefslogtreecommitdiffstats
path: root/src/core/resources
diff options
context:
space:
mode:
authorVolker Krause <volker.krause@kdab.com>2016-01-08 14:29:26 +0100
committerVolker Krause <volker.krause@kdab.com>2016-01-12 09:44:41 +0000
commit4ccc13c4687d76c43980db8558e8c71364b052ba (patch)
tree4a21e331757651bf7af6632bc8f9df456e6d8841 /src/core/resources
parent6feaaef347d3c05963ee65707c4c2104109f387b (diff)
Remove unused ListAllocationPolicy.
Change-Id: I59a6461fd3e81d578af3cc33248fb21d8b503135 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/core/resources')
-rw-r--r--src/core/resources/qresourcemanager.cpp18
-rw-r--r--src/core/resources/qresourcemanager_p.h56
2 files changed, 0 insertions, 74 deletions
diff --git a/src/core/resources/qresourcemanager.cpp b/src/core/resources/qresourcemanager.cpp
index 5ece6a03f..8af1d5d5d 100644
--- a/src/core/resources/qresourcemanager.cpp
+++ b/src/core/resources/qresourcemanager.cpp
@@ -65,24 +65,6 @@
released
\sa QResourceManager
- \sa ListAllocatingPolicy
-*/
-
-/*!
- \class Qt3DCore::ListAllocatingPolicy
- \inmodule Qt3DCore
- \since 5.5
-
- \brief Allocates resources in a list.
-
- It is best to use it when you don't need to iterate over an entire set of resources, in which
- case ArrayAllocatingPolicy is faster. It can store a non predefined amount of resources, though
- there might not be enough handles at some point, depending on the INDEXBITS used.
- It's main use case is to manage resources that are accessed in an independent manner from other
- resources of the same type.
-
- \sa QResourceManager
- \sa ArrayAllocatingPolicy
*/
/*!
diff --git a/src/core/resources/qresourcemanager_p.h b/src/core/resources/qresourcemanager_p.h
index 5f094881d..47f067409 100644
--- a/src/core/resources/qresourcemanager_p.h
+++ b/src/core/resources/qresourcemanager_p.h
@@ -286,62 +286,6 @@ private:
};
-template <typename T, uint INDEXBITS>
-class ListAllocatingPolicy
-{
-public:
- ListAllocatingPolicy()
- {
- }
-
- T* allocateResource()
- {
- int idx;
- T *newT;
- if (!m_freeEntries.isEmpty()) {
- idx = m_freeEntries.takeFirst();
- m_resourcesEntries[idx] = T();
- newT = &m_resourcesEntries[idx];
- }
- else {
- m_resourcesEntries.append(T());
- idx = m_resourcesEntries.size() - 1;
- newT = &m_resourcesEntries.last();
- }
- // If elements are added to the list, we're not sure the address
- // that was returned here for previous elements stays valid
- m_resourcesToIndices[newT] = idx;
- return newT;
- }
-
- void releaseResource(T *r)
- {
- if (m_resourcesToIndices.contains(r)) {
- performCleanup(r, Int2Type<QResourceInfo<T>::needsCleanup>());
- m_freeEntries.append(m_resourcesToIndices.take(r));
- }
- }
-
- void reset()
- {
- m_resourcesEntries.clear();
- m_resourcesToIndices.clear();
- }
-
-private:
- QList<T> m_resourcesEntries;
- QHash<T*, int> m_resourcesToIndices;
- QList<int> m_freeEntries;
-
- void performCleanup(T *r, Int2Type<true>)
- {
- r->cleanup();
- }
-
- void performCleanup(T *, Int2Type<false>)
- {}
-};
-
template <typename T, typename C, uint INDEXBITS = 16,
template <typename, uint> class AllocatingPolicy = ArrayAllocatingPolicy,
template <class> class LockingPolicy = NonLockingPolicy