Castor3D 0.16.0
Multiplatform 3D engine
Public Types | Public Member Functions | List of all members
castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits > Class Referencefinal

Overlay collection, with additional add and remove functions to manage Z-Index. More...

#include <OverlayCache.hpp>

Inheritance diagram for castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >:
Inheritance graph
[legend]
Collaboration diagram for castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >:
Collaboration graph
[legend]

Public Types

using ElementT = castor3d::Overlay
 
using ElementKeyT = String
 
using ElementCacheTraitsT = castor3d::OverlayCacheTraits
 
using ElementCacheT = ResourceCacheBaseT< ElementT, ElementKeyT, ElementCacheTraitsT >
 
using ElementPtrT = typename ElementCacheT::ElementPtrT
 
using ElementObsT = typename ElementCacheT::ElementObsT
 
using ElementContT = typename ElementCacheT::ElementContT
 
using ElementInitialiserT = typename ElementCacheT::ElementInitialiserT
 
using ElementCleanerT = typename ElementCacheT::ElementCleanerT
 
using ElementMergerT = typename ElementCacheT::ElementMergerT
 
using iterator = castor::Map< ElementT, ElementKeyT >::iterator
 
using const_iterator = castor::Map< ElementT, ElementKeyT >::const_iterator
 
using OverlayCategories = castor::Vector< castor3d::OverlayCategoryRPtr >
 
- Public Types inherited from castor::ResourceCacheBaseT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >
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

 CU_DeclareMap (ElementKeyT, castor3d::FontTextureUPtr, FontTextureStr)
 
C3D_API ResourceCacheT (castor3d::Engine &engine)
 Constructor.
 
C3D_API void clear () noexcept
 Clears all overlays lists.
 
C3D_API void cleanup ()
 Cleans all overlays up.
 
C3D_API void initialise (castor3d::Overlay &overlay)
 
C3D_API void cleanup (castor3d::Overlay &overlay)
 
C3D_API void upload (castor3d::UploadData &uploader)
 
C3D_API castor3d::FontTextureRPtr getFontTexture (String const &name)
 Retrieves a FontTexture given a font name.
 
C3D_API castor3d::FontTextureRPtr createFontTexture (castor::FontResPtr font)
 Creates a FontTexture from a font.
 
Iteration.
auto const & getCategories () const noexcept
 
Getters.
castor3d::OverlayFactory const & getOverlayFactory () const noexcept
 
castor3d::OverlayFactorygetFactory () noexcept
 
castor3d::EnginegetEngine () const noexcept
 
- Public Member Functions inherited from castor::ResourceCacheBaseT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >
 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

- Protected Types inherited from castor::ResourceCacheBaseT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >
using MutexT
 
- Protected Member Functions inherited from castor::ResourceCacheBaseT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >
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 castor::ResourceCacheBaseT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >
LoggerInstancem_logger
 
CheckedMutexT< MutexTm_mutex
 
ElementContT m_resources
 
ElementInitialiserT m_initialise
 
ElementCleanerT m_clean
 
ElementMergerT m_merge
 

Detailed Description

Overlay collection, with additional add and remove functions to manage Z-Index.

Member Typedef Documentation

◆ const_iterator

◆ ElementCacheT

◆ ElementCacheTraitsT

◆ ElementCleanerT

using castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >::ElementCleanerT = typename ElementCacheT::ElementCleanerT

◆ ElementContT

using castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >::ElementContT = typename ElementCacheT::ElementContT

◆ ElementInitialiserT

using castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >::ElementInitialiserT = typename ElementCacheT::ElementInitialiserT

◆ ElementKeyT

◆ ElementMergerT

using castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >::ElementMergerT = typename ElementCacheT::ElementMergerT

◆ ElementObsT

using castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >::ElementObsT = typename ElementCacheT::ElementObsT

◆ ElementPtrT

using castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >::ElementPtrT = typename ElementCacheT::ElementPtrT

◆ ElementT

◆ iterator

◆ OverlayCategories

using castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >::OverlayCategories = castor::Vector< castor3d::OverlayCategoryRPtr >

Constructor & Destructor Documentation

◆ ResourceCacheT()

Constructor.

Parameters
[in]engineThe engine.

Member Function Documentation

◆ cleanup() [1/2]

Cleans all overlays up.

◆ cleanup() [2/2]

◆ clear()

Clears all overlays lists.

◆ createFontTexture()

Creates a FontTexture from a font.

Parameters
[in]fontThe font.
Returns
The created FontTexture.

◆ CU_DeclareMap()

castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >::CU_DeclareMap ( ElementKeyT ,
castor3d::FontTextureUPtr ,
FontTextureStr  )

◆ getCategories()

auto const & castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >::getCategories ( ) const
inlinenoexcept

◆ getEngine()

◆ getFactory()

◆ getFontTexture()

C3D_API castor3d::FontTextureRPtr castor::ResourceCacheT< castor3d::Overlay, String, castor3d::OverlayCacheTraits >::getFontTexture ( String const & name)

Retrieves a FontTexture given a font name.

Parameters
[in]nameThe font name.
Returns
The FontTexture if it exist, nullptr if not.

◆ getOverlayFactory()

◆ initialise()

◆ upload()


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