Castor3D 0.16.0
Multiplatform 3D engine
|
Base class for an element cache. More...
#include <ResourceCacheBase.hpp>
Public Types | |
using | ElementT = ResT |
using | ElementKeyT = KeyT |
using | ElementCacheTraitsT = TraitsT |
using | ElementCacheBaseT = ResourceCacheBaseT< ElementT, ElementKeyT, ElementCacheTraitsT > |
using | ElementCacheT = typename ElementCacheTraitsT::ElementCacheT |
using | ElementPtrT = typename ElementCacheTraitsT::ElementPtrT |
using | ElementObsT = typename ElementCacheTraitsT::ElementObsT |
using | ElementContT = typename ElementCacheTraitsT::ElementContT |
using | ElementInitialiserT = typename ElementCacheTraitsT::ElementInitialiserT |
using | ElementCleanerT = typename ElementCacheTraitsT::ElementCleanerT |
using | ElementMergerT = typename ElementCacheTraitsT::ElementMergerT |
Public Member Functions | |
ResourceCacheBaseT (ResourceCacheBaseT const &)=delete | |
ResourceCacheBaseT & | operator= (ResourceCacheBaseT const &)=delete |
ResourceCacheBaseT (ResourceCacheBaseT &&) noexcept=delete | |
ResourceCacheBaseT & | operator= (ResourceCacheBaseT &&) noexcept=delete |
void | cleanup () noexcept |
Sets all the elements to be cleaned up. | |
void | clear () noexcept |
Flushes the collection. | |
template<typename ... ParametersT> | |
ElementPtrT | create (ElementKeyT const &name, ParametersT &&... parameters) const |
Creates an element. | |
ElementObsT | tryAdd (ElementKeyT const &name, ElementPtrT &element, bool initialise=false) |
Adds an element. | |
ElementObsT | tryAddNoLock (ElementKeyT const &name, ElementPtrT &element, bool initialise=false) |
Adds an element. | |
ElementObsT | add (ElementKeyT const &name, ElementPtrT &element, bool initialise=true) |
Logging version of tryAdd. | |
ElementObsT | addNoLock (ElementKeyT const &name, ElementPtrT &element, bool initialise=true) |
Logging version of tryAdd. | |
template<typename ... ParametersT> | |
ElementObsT | tryAdd (ElementKeyT const &name, bool initialise, ElementObsT &created, ParametersT &&... parameters) |
Add an element, constructed in-place. | |
template<typename ... ParametersT> | |
ElementObsT | tryAddNoLock (ElementKeyT const &name, bool initialise, ElementObsT &created, ParametersT &&... parameters) |
Add an element, constructed in-place. | |
template<typename ... ParametersT> | |
ElementObsT | add (ElementKeyT const &name, ParametersT &&... parameters) |
Logging version of tryAdd. | |
template<typename ... ParametersT> | |
ElementObsT | addNoLock (ElementKeyT const &name, ParametersT &&... parameters) |
Logging version of tryAdd. | |
ElementPtrT | tryRemove (ElementKeyT const &name, bool cleanup=false) noexcept |
Removes an element, given a name. | |
ElementPtrT | tryRemoveNoLock (ElementKeyT const &name, bool cleanup=false) noexcept |
Removes an element, given a name. | |
ElementPtrT | remove (ElementKeyT const &name, bool cleanup=false) noexcept |
Logging version of tryRemove. | |
ElementPtrT | removeNoLock (ElementKeyT const &name, bool cleanup=false) noexcept |
Logging version of tryRemove. | |
void | rename (ElementKeyT const &oldName, ElementKeyT const &newName) |
Renames a resource. | |
ElementObsT | tryFind (ElementKeyT const &name) const noexcept |
Looks for an element with given name. | |
ElementObsT | tryFindNoLock (ElementKeyT const &name) const noexcept |
Looks for an element with given name. | |
ElementObsT | find (ElementKeyT const &name) const |
Logging version of tryRemove. | |
ElementObsT | findNoLock (ElementKeyT const &name) const |
Logging version of tryRemove. | |
void | mergeInto (ElementCacheBaseT &destination) |
Merges this cache's elements to the one given. | |
Locked loop. | |
template<typename FuncType > | |
void | forEach (FuncType func) const |
template<typename FuncType > | |
void | forEach (FuncType func) |
Getters. | |
uint32_t | getObjectCount () const noexcept |
uint32_t | getObjectCountNoLock () const noexcept |
String const & | getObjectTypeName () const noexcept |
bool | has (ElementKeyT const &name) const noexcept |
bool | hasNoLock (ElementKeyT const &name) const noexcept |
bool | isEmpty () const noexcept |
bool | isEmptyNoLock () const noexcept |
Mutex locking. | |
void | lock () const |
void | unlock () const noexcept |
Iteration. | |
auto | begin () noexcept |
auto | begin () const noexcept |
auto | end () noexcept |
auto | end () const noexcept |
Logging. | |
void | reportCreation (String const &name) const |
void | reportAdded (String const &name) const |
void | reportDuplicate (String const &name) const |
void | reportNull () const |
void | reportUnknown (String const &name) const |
Protected Types | |
using | MutexT = castor::RecursiveMutex |
Protected Member Functions | |
void | doCleanupNoLock () const noexcept |
void | doClearNoLock () noexcept |
template<typename ... ParametersT> | |
ElementPtrT | doCreateT (ElementKeyT const &name, ParametersT &&... parameters) const |
ElementObsT | doTryAddNoLock (ElementKeyT const &name, ElementPtrT &element, bool initialise=true) |
ElementObsT | doAddNoLock (ElementKeyT const &name, ElementPtrT &element, bool initialise=true) |
template<typename ... ParametersT> | |
ElementObsT | doTryAddNoLockT (ElementKeyT const &name, bool initialise, ElementObsT &created, ParametersT &&... parameters) |
template<typename ... ParametersT> | |
ElementObsT | doAddNoLockT (ElementKeyT const &name, ParametersT &&... parameters) |
ElementPtrT | doTryRemoveNoLock (ElementKeyT const &name, bool cleanup=false) noexcept |
ElementObsT | doTryFindNoLock (ElementKeyT const &name) const noexcept |
ResourceCacheBaseT (LoggerInstance &logger, ElementInitialiserT initialise=ElementInitialiserT{}, ElementCleanerT clean=ElementCleanerT{}, ElementMergerT merge=ElementMergerT{}) | |
virtual | ~ResourceCacheBaseT () noexcept=default |
Protected Attributes | |
LoggerInstance & | m_logger |
CheckedMutexT< MutexT > | m_mutex |
ElementContT | m_resources |
ElementInitialiserT | m_initialise |
ElementCleanerT | m_clean |
ElementMergerT | m_merge |
Base class for an element cache.
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementCacheBaseT = ResourceCacheBaseT< ElementT, ElementKeyT, ElementCacheTraitsT > |
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementCacheT = typename ElementCacheTraitsT::ElementCacheT |
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementCacheTraitsT = TraitsT |
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementCleanerT = typename ElementCacheTraitsT::ElementCleanerT |
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementContT = typename ElementCacheTraitsT::ElementContT |
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementInitialiserT = typename ElementCacheTraitsT::ElementInitialiserT |
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementKeyT = KeyT |
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementMergerT = typename ElementCacheTraitsT::ElementMergerT |
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementObsT = typename ElementCacheTraitsT::ElementObsT |
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementPtrT = typename ElementCacheTraitsT::ElementPtrT |
using castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::ElementT = ResT |
|
protected |
|
delete |
|
deletenoexcept |
|
inlineexplicitprotected |
name Construction/Desctruction.
|
protectedvirtualdefaultnoexcept |
|
inline |
Logging version of tryAdd.
[in] | name | The resource name. |
[in,out] | element | The resource, will be emptied on add (the cache now owns it). |
[in] | initialise | true to initialise the added element (no effect on duplicates). |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), and castor::makeUniqueLock().
Referenced by castor3d::Engine::addFont(), castor3d::Engine::addImage(), castor3d::Engine::addNewFont(), and castor3d::Engine::addNewImage().
|
inline |
Logging version of tryAdd.
[in] | name | The element name. |
[in] | parameters | The other constructor parameters. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLockT(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), and castor::makeUniqueLock().
|
inline |
Logging version of tryAdd.
[in] | name | The resource name. |
[in,out] | element | The resource, will be emptied on add (the cache now owns it). |
[in] | initialise | true to initialise the added element (no effect on duplicates). |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLock().
|
inline |
Logging version of tryAdd.
[in] | name | The element name. |
[in] | parameters | The other constructor parameters. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLockT().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Sets all the elements to be cleaned up.
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doCleanupNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), and castor::makeUniqueLock().
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryRemoveNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::remove(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::removeNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryRemove(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryRemoveNoLock().
|
inlinenoexcept |
Flushes the collection.
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doClearNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), and castor::makeUniqueLock().
|
inline |
Creates an element.
[in] | name | The element name. |
[in] | parameters | The other constructor parameters. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doCreateT(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportCreation().
Referenced by castor3d::Engine::createFont(), and castor3d::Engine::createImage().
|
inlineprotected |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportAdded(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportDuplicate(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportNull().
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::add(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::addNoLock().
|
inlineprotected |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLockT(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportCreation(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportDuplicate().
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::add(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::addNoLock().
|
inlineprotectednoexcept |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_clean, and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_resources.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::cleanup().
|
inlineprotectednoexcept |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_resources.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::clear(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::mergeInto().
|
inlineprotected |
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::create(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLockT().
|
inlineprotected |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_initialise, and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_resources.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryAdd(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryAddNoLock().
|
inlineprotected |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doCreateT(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_initialise, and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_resources.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLockT(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryAdd(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryAddNoLock().
|
inlineprotectednoexcept |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_resources.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::find(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::findNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryFind(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryFindNoLock().
|
inlineprotectednoexcept |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::cleanup(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_clean, and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_resources.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::remove(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::removeNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryRemove(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryRemoveNoLock().
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Logging version of tryRemove.
[in] | name | The object name. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryFindNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), castor::makeUniqueLock(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportUnknown().
Referenced by castor3d::Engine::findFont(), and castor3d::Engine::findImage().
|
inline |
Logging version of tryRemove.
[in] | name | The object name. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryFindNoLock(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportUnknown().
|
inline |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), and castor::makeUniqueLock().
|
inline |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), and castor::makeUniqueLock().
|
inlinenoexcept |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_resources, and castor::makeUniqueLock().
|
inlinenoexcept |
|
inlinenoexcept |
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportAdded(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportCreation(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportDuplicate(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportNull(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportUnknown().
|
inlinenoexcept |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryFind().
Referenced by castor3d::Engine::hasFont(), and castor3d::Engine::hasImage().
|
inlinenoexcept |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryFindNoLock().
|
inlinenoexcept |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_resources, and castor::makeUniqueLock().
|
inlinenoexcept |
|
inline |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_mutex.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::add(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::add(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::cleanup(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::clear(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::find(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::forEach(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::forEach(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::getObjectCount(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::isEmpty(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::mergeInto(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::remove(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::rename(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryAdd(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryAdd(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryFind(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::tryRemove().
|
inline |
Merges this cache's elements to the one given.
[out] | destination | The destination cache. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doClearNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_merge, and castor::makeUniqueLock().
|
deletenoexcept |
|
delete |
|
inlinenoexcept |
Logging version of tryRemove.
[in] | name | The element name. |
[in] | cleanup | true if the element needs to be cleaned up. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::cleanup(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryRemoveNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), castor::makeUniqueLock(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportUnknown().
Referenced by castor3d::Engine::removeFont(), and castor3d::Engine::removeImage().
|
inlinenoexcept |
Logging version of tryRemove.
[in] | name | The element name. |
[in] | cleanup | true if the element needs to be cleaned up. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::cleanup(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryRemoveNoLock(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportUnknown().
|
inline |
Renames a resource.
[in] | oldName | The current element name. |
[in] | newName | The new element name. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_resources, castor::makeUniqueLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportDuplicate(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportUnknown().
|
inline |
References cuT, castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::getObjectTypeName(), castor::LoggerInstance::logTrace(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_logger, and castor::makeStringStream().
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLock().
|
inline |
References cuT, castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::getObjectTypeName(), castor::LoggerInstance::logTrace(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_logger, and castor::makeStringStream().
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::create(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLockT().
|
inline |
References cuT, castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::getObjectTypeName(), castor::LoggerInstance::logWarning(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_logger, and castor::makeStringStream().
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLockT(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::rename().
|
inline |
References cuT, castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::getObjectTypeName(), castor::LoggerInstance::logWarning(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_logger, and castor::makeStringStream().
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doAddNoLock().
|
inline |
References cuT, castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::getObjectTypeName(), castor::LoggerInstance::logWarning(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::m_logger, and castor::makeStringStream().
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::find(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::findNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::remove(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::removeNoLock(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::rename().
|
inline |
Add an element, constructed in-place.
[in] | name | The element name. |
[in] | initialise | true to initialise the added element (no effect on duplicates). |
[out] | created | The created element. |
[in] | parameters | The other constructor parameters. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLockT(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), and castor::makeUniqueLock().
|
inline |
Adds an element.
[in] | name | The element name. |
[in,out] | element | The resource, will be emptied on add (the cache now owns it). |
[in] | initialise | true to initialise the added element (no effect on duplicates). |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), and castor::makeUniqueLock().
Referenced by castor3d::Engine::tryAddImage().
|
inline |
Add an element, constructed in-place.
[in] | name | The element name. |
[in] | initialise | true to initialise the added element (no effect on duplicates). |
[out] | created | The created element. |
[in] | parameters | The other constructor parameters. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLockT().
|
inline |
Adds an element.
[in] | name | The element name. |
[in,out] | element | The resource, will be emptied on add (the cache now owns it). |
[in] | initialise | true to initialise the added element (no effect on duplicates). |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLock().
|
inlinenoexcept |
Looks for an element with given name.
[in] | name | The object name. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryFindNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), and castor::makeUniqueLock().
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::has(), castor3d::Engine::tryFindFont(), and castor3d::Engine::tryFindImage().
|
inlinenoexcept |
Looks for an element with given name.
[in] | name | The object name. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryFindNoLock().
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::hasNoLock().
|
inlinenoexcept |
Removes an element, given a name.
[in] | name | The element name. |
[in] | cleanup | true if the element needs to be cleaned up. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::cleanup(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryRemoveNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::lock(), and castor::makeUniqueLock().
|
inlinenoexcept |
Removes an element, given a name.
[in] | name | The element name. |
[in] | cleanup | true if the element needs to be cleaned up. |
References castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::cleanup(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryRemoveNoLock().
|
inlinenoexcept |
|
protected |
The element cleaner.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doCleanupNoLock(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryRemoveNoLock().
|
protected |
The element initialiser.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLock(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLockT().
|
protected |
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportAdded(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportCreation(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportDuplicate(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportNull(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportUnknown().
|
protected |
The elements collection merger.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::mergeInto().
|
protected |
|
mutableprotected |
The elements collection.
Referenced by castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::begin(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::begin(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doCleanupNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doClearNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryAddNoLockT(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryFindNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::doTryRemoveNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::end(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::end(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::getObjectCount(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::getObjectCountNoLock(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::isEmpty(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::isEmptyNoLock(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::rename().