Castor3D 0.16.0
Multiplatform 3D engine
Public Types | Public Member Functions | List of all members
castor3d::ObjectCacheT< ObjT, KeyT, TraitsT > Class Template Reference

#include <ObjectCache.hpp>

Inheritance diagram for castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >:
Inheritance graph
[legend]
Collaboration diagram for castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >:
Collaboration graph
[legend]

Public Types

using ElementT = ObjT
 
using ElementKeyT = KeyT
 
using ElementCacheTraitsT = TraitsT
 
using ElementObjectCacheT = ObjectCacheBaseT< ElementT, ElementKeyT, ElementCacheTraitsT >
 
using ElementPtrT = typename ElementObjectCacheT::ElementPtrT
 
using ElementObsT = typename ElementObjectCacheT::ElementObsT
 
using ElementContT = typename ElementObjectCacheT::ElementContT
 
using ElementInitialiserT = typename ElementObjectCacheT::ElementInitialiserT
 
using ElementCleanerT = typename ElementObjectCacheT::ElementCleanerT
 
using ElementMergerT = typename ElementObjectCacheT::ElementMergerT
 
using ElementAttacherT = typename ElementObjectCacheT::ElementAttacherT
 
using ElementDetacherT = typename ElementObjectCacheT::ElementDetacherT
 
- Public Types inherited from castor3d::ObjectCacheBaseT< ObjT, KeyT, TraitsT >
using OnChangedFunction = castor::Function< void() >
 
using OnChanged = castor::SignalT< OnChangedFunction >
 
- Public Types inherited from castor::ResourceCacheBaseT< ObjT, KeyT, TraitsT >
using ElementT
 
using ElementKeyT
 
using ElementCacheTraitsT
 
using ElementCacheBaseT
 
using ElementCacheT
 
using ElementPtrT
 
using ElementObsT
 
using ElementContT
 
using ElementInitialiserT
 
using ElementCleanerT
 
using ElementMergerT
 

Public Member Functions

 ObjectCacheT (Scene &scene, SceneNodeRPtr rootNode, SceneNodeRPtr rootCameraNode, SceneNodeRPtr rootObjectNode, ElementInitialiserT initialise=ElementInitialiserT{}, ElementCleanerT clean=ElementCleanerT{}, ElementMergerT merge=ElementMergerT{}, ElementAttacherT attach=ElementAttacherT{}, ElementDetacherT detach=ElementDetacherT{})
 Constructor.
 
- Public Member Functions inherited from castor3d::ObjectCacheBaseT< ObjT, KeyT, TraitsT >
void mergeInto (ElementObjectCacheT &destination)
 Merges this cache's elements to the one given.
 
EnginegetEngine () const noexcept
 
castor::String const & getObjectTypeName () const noexcept
 
- Public Member Functions inherited from castor::OwnedBy< Scene >
Scene * getOwner () const
 
- Public Member Functions inherited from castor::ResourceCacheBaseT< ObjT, KeyT, TraitsT >
 ResourceCacheBaseT (ResourceCacheBaseT const &)=delete
 
 ResourceCacheBaseT (ResourceCacheBaseT &&) noexcept=delete
 
ResourceCacheBaseToperator= (ResourceCacheBaseT const &)=delete
 
ResourceCacheBaseToperator= (ResourceCacheBaseT &&) noexcept=delete
 
void cleanup () noexcept
 Sets all the elements to be cleaned up.
 
void clear () noexcept
 Flushes the collection.
 
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 tryAdd (ElementKeyT const &name, bool initialise, ElementObsT &created, ParametersT &&... parameters)
 Add an element, constructed in-place.
 
ElementObsT tryAddNoLock (ElementKeyT const &name, ElementPtrT &element, bool initialise=false)
 Adds an element.
 
ElementObsT tryAddNoLock (ElementKeyT const &name, bool initialise, ElementObsT &created, ParametersT &&... parameters)
 Add an element, constructed in-place.
 
ElementObsT add (ElementKeyT const &name, ElementPtrT &element, bool initialise=true)
 Logging version of tryAdd.
 
ElementObsT add (ElementKeyT const &name, ParametersT &&... parameters)
 Logging version of tryAdd.
 
ElementObsT addNoLock (ElementKeyT const &name, ElementPtrT &element, bool initialise=true)
 Logging version of tryAdd.
 
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.
 
void forEach (FuncType func) const
 
void forEach (FuncType func)
 
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
 
void lock () const
 
void unlock () const noexcept
 
auto begin () noexcept
 
auto begin () const noexcept
 
auto end () noexcept
 
auto end () const noexcept
 
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
 

Additional Inherited Members

- Public Attributes inherited from castor3d::ObjectCacheBaseT< ObjT, KeyT, TraitsT >
OnChanged onChanged
 
- Protected Types inherited from castor3d::ObjectCacheBaseT< ObjT, KeyT, TraitsT >
using ElementT = ObjT
 
using ElementKeyT = KeyT
 
using ElementCacheTraitsT = TraitsT
 
using ElementCacheT = castor::ResourceCacheBaseT< ElementT, ElementKeyT, ElementCacheTraitsT >
 
using ElementCacheBaseT = ElementCacheT
 
using ElementObjectCacheT = ObjectCacheBaseT< ElementT, ElementKeyT, ElementCacheTraitsT >
 
using ElementPtrT = ObjectPtrT< ElementT, ElementKeyT >
 
using ElementObsT = ObjectObsT< ElementT, ElementKeyT >
 
using ElementContT = ObjectContT< ElementT, ElementKeyT >
 
using ElementInitialiserT = ObjectInitialiserT< ElementT, ElementKeyT >
 
using ElementCleanerT = ObjectCleanerT< ElementT, ElementKeyT >
 
using ElementMergerT = ObjectMergerT< ElementT, ElementKeyT >
 
using ElementAttacherT = ObjectAttacherT< ElementT, ElementKeyT >
 
using ElementDetacherT = ObjectDetacherT< ElementT, ElementKeyT >
 
- Protected Types inherited from castor::ResourceCacheBaseT< ObjT, KeyT, TraitsT >
using MutexT
 
- Protected Member Functions inherited from castor3d::ObjectCacheBaseT< ObjT, KeyT, TraitsT >
 ObjectCacheBaseT (Scene &scene, SceneNodeRPtr rootNode, SceneNodeRPtr rootCameraNode, SceneNodeRPtr rootObjectNode, ElementInitialiserT initialise=ElementInitialiserT{}, ElementCleanerT clean=ElementCleanerT{}, ElementMergerT merge=ElementMergerT{}, ElementAttacherT attach=ElementAttacherT{}, ElementDetacherT detach=ElementDetacherT{})
 Constructor.
 
- Protected Member Functions inherited from castor::OwnedBy< Scene >
 OwnedBy (Scene &owner)
 Constructor.
 
- Protected Member Functions inherited from castor::ResourceCacheBaseT< ObjT, KeyT, TraitsT >
void doCleanupNoLock () const noexcept
 
void doClearNoLock () noexcept
 
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)
 
ElementObsT doTryAddNoLockT (ElementKeyT const &name, bool initialise, ElementObsT &created, ParametersT &&... parameters)
 
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 inherited from castor3d::ObjectCacheBaseT< ObjT, KeyT, TraitsT >
Enginem_engine
 
SceneNodeRPtr m_rootNode
 
SceneNodeRPtr m_rootCameraNode
 
SceneNodeRPtr m_rootObjectNode
 
ElementMergerT m_merge
 
ElementAttacherT m_attach
 
ElementDetacherT m_detach
 
- Protected Attributes inherited from castor::ResourceCacheBaseT< ObjT, KeyT, TraitsT >
LoggerInstancem_logger
 
CheckedMutexT< MutexTm_mutex
 
ElementContT m_resources
 
ElementInitialiserT m_initialise
 
ElementCleanerT m_clean
 
ElementMergerT m_merge
 

Detailed Description

template<typename ObjT, typename KeyT, typename TraitsT>
class castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >

Base class for a scene element cache.

Member Typedef Documentation

◆ ElementAttacherT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementAttacherT = typename ElementObjectCacheT::ElementAttacherT

◆ ElementCacheTraitsT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementCacheTraitsT = TraitsT

◆ ElementCleanerT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementCleanerT = typename ElementObjectCacheT::ElementCleanerT

◆ ElementContT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementContT = typename ElementObjectCacheT::ElementContT

◆ ElementDetacherT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementDetacherT = typename ElementObjectCacheT::ElementDetacherT

◆ ElementInitialiserT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementInitialiserT = typename ElementObjectCacheT::ElementInitialiserT

◆ ElementKeyT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementKeyT = KeyT

◆ ElementMergerT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementMergerT = typename ElementObjectCacheT::ElementMergerT

◆ ElementObjectCacheT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementObjectCacheT = ObjectCacheBaseT< ElementT, ElementKeyT, ElementCacheTraitsT >

◆ ElementObsT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementObsT = typename ElementObjectCacheT::ElementObsT

◆ ElementPtrT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementPtrT = typename ElementObjectCacheT::ElementPtrT

◆ ElementT

template<typename ObjT , typename KeyT , typename TraitsT >
using castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ElementT = ObjT

Constructor & Destructor Documentation

◆ ObjectCacheT()

template<typename ObjT , typename KeyT , typename TraitsT >
castor3d::ObjectCacheT< ObjT, KeyT, TraitsT >::ObjectCacheT ( Scene & scene,
SceneNodeRPtr rootNode,
SceneNodeRPtr rootCameraNode,
SceneNodeRPtr rootObjectNode,
ElementInitialiserT initialise = ElementInitialiserT{},
ElementCleanerT clean = ElementCleanerT{},
ElementMergerT merge = ElementMergerT{},
ElementAttacherT attach = ElementAttacherT{},
ElementDetacherT detach = ElementDetacherT{} )
inline

Constructor.

Parameters
[in]sceneThe scene.
[in]rootNodeThe root node.
[in]rootCameraNodeThe cameras root node.
[in]rootObjectNodeThe objects root node.
[in]initialiseThe element initialiser.
[in]cleanThe element cleaner.
[in]mergeThe element collection merger.
[in]attachThe element attacher (to a scene node).
[in]detachThe element detacher (from a scene node).

The documentation for this class was generated from the following files: