Castor3D  ..
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Castor3D::Manager< Key, Elem, Owner, EngineGetter > Class Template Reference

Base class for an element manager. More...

+ Inheritance diagram for Castor3D::Manager< Key, Elem, Owner, EngineGetter >:
+ Collaboration diagram for Castor3D::Manager< Key, Elem, Owner, EngineGetter >:

Public Types

typedef Castor::Collection< Elem, Key > Collection
 

Public Member Functions

void Cleanup ()
 Sets all the elements to be cleaned up. More...
 
void Clear ()
 Flushes the collection. More...
 
bool IsEmpty ()
 
void Insert (Key const &p_name, std::shared_ptr< Elem > p_element)
 Removes an object, given a name. More...
 
void Remove (Key const &p_name)
 Removes an object, given a name. More...
 
void SetRenderSystem (RenderSystem *p_renderSystem)
 
RenderSystemSetRenderSystem () const
 
EngineGetEngine () const
 
Castor::String const & GetObjectTypeName () const
 
bool Has (Key const &p_name) const
 
std::shared_ptr< Elem > Find (Key const &p_name) const
 Looks for an element with given name. More...
 
void lock () const
 Locks the collection mutex. More...
 
void unlock () const
 Unlocks the collection mutex. More...
 
Collection::TObjPtrMapIt begin ()
 Returns an iterator to the first element of the collection. More...
 
Collection::TObjPtrMapConstIt begin () const
 Returns an constant iterator to the first element of the collection. More...
 
Collection::TObjPtrMapIt end ()
 Returns an iterator to the after last element of the collection. More...
 
Collection::TObjPtrMapConstIt end () const
 Returns an constant iterator to the after last element of the collection. More...
 
template<typename ... Parameters>
std::shared_ptr< Elem > Create (Key const &p_name, Parameters &&... p_params)
 Creates an object. More...
 

Protected Member Functions

 Manager (Owner &p_owner)
 Constructor. More...
 
 ~Manager ()
 Destructor. More...
 

Protected Attributes

RenderSystemm_renderSystem
 The RenderSystem. More...
 
Collection m_elements
 The elements collection. More...
 

Detailed Description

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
class Castor3D::Manager< Key, Elem, Owner, EngineGetter >

Base class for an element manager.

Author
Sylvain DOREMUS
Date
13/10/2015
Version
0.8.0

Member Typedef Documentation

◆ Collection

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
typedef Castor::Collection< Elem, Key > Castor3D::Manager< Key, Elem, Owner, EngineGetter >::Collection

Constructor & Destructor Documentation

◆ Manager()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
Castor3D::Manager< Key, Elem, Owner, EngineGetter >::Manager ( Owner &  p_owner)
inlineprotected

Constructor.

Parameters
[in]p_ownerThe owner.

◆ ~Manager()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
Castor3D::Manager< Key, Elem, Owner, EngineGetter >::~Manager ( )
inlineprotected

Destructor.

Member Function Documentation

◆ begin() [1/2]

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
Collection::TObjPtrMapIt Castor3D::Manager< Key, Elem, Owner, EngineGetter >::begin ( )
inline

Returns an iterator to the first element of the collection.

Returns
The iterator

◆ begin() [2/2]

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
Collection::TObjPtrMapConstIt Castor3D::Manager< Key, Elem, Owner, EngineGetter >::begin ( ) const
inline

Returns an constant iterator to the first element of the collection.

Returns
The iterator

◆ Cleanup()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
void Castor3D::Manager< Key, Elem, Owner, EngineGetter >::Cleanup ( void  )
inline

Sets all the elements to be cleaned up.

◆ Clear()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
void Castor3D::Manager< Key, Elem, Owner, EngineGetter >::Clear ( )
inline

Flushes the collection.

Referenced by Castor3D::ObjectManager< Castor::String, AnimatedObjectGroup >::MergeInto().

+ Here is the caller graph for this function:

◆ Create()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
template<typename ... Parameters>
std::shared_ptr< Elem > Castor3D::Manager< Key, Elem, Owner, EngineGetter >::Create ( Key const &  p_name,
Parameters &&...  p_params 
)
inline

Creates an object.

Parameters
[in]p_nameThe object name.
[in]p_paramsThe other constructor parameters.
Returns
The created object.

◆ end() [1/2]

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
Collection::TObjPtrMapIt Castor3D::Manager< Key, Elem, Owner, EngineGetter >::end ( )
inline

Returns an iterator to the after last element of the collection.

Returns
The iterator

◆ end() [2/2]

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
Collection::TObjPtrMapConstIt Castor3D::Manager< Key, Elem, Owner, EngineGetter >::end ( ) const
inline

Returns an constant iterator to the after last element of the collection.

Returns
The iterator

◆ Find()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
std::shared_ptr< Elem > Castor3D::Manager< Key, Elem, Owner, EngineGetter >::Find ( Key const &  p_name) const
inline

Looks for an element with given name.

Parameters
[in]p_nameThe object name.
Returns
The found element, nullptr if not found.

◆ GetEngine()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
Engine* Castor3D::Manager< Key, Elem, Owner, EngineGetter >::GetEngine ( ) const
inline

◆ GetObjectTypeName()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
Castor::String const& Castor3D::Manager< Key, Elem, Owner, EngineGetter >::GetObjectTypeName ( ) const
inline

◆ Has()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
bool Castor3D::Manager< Key, Elem, Owner, EngineGetter >::Has ( Key const &  p_name) const
inline
Parameters
[in]p_nameThe object name.
Returns
true if an element with given name exists.

◆ Insert()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
void Castor3D::Manager< Key, Elem, Owner, EngineGetter >::Insert ( Key const &  p_name,
std::shared_ptr< Elem >  p_element 
)
inline

Removes an object, given a name.

Parameters
[in]p_nameThe element name.
[in]p_elementThe element.

◆ IsEmpty()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
bool Castor3D::Manager< Key, Elem, Owner, EngineGetter >::IsEmpty ( )
inline
Returns
true if the manager is empty.

◆ lock()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
void Castor3D::Manager< Key, Elem, Owner, EngineGetter >::lock ( ) const
inline

Locks the collection mutex.

◆ Remove()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
void Castor3D::Manager< Key, Elem, Owner, EngineGetter >::Remove ( Key const &  p_name)
inline

Removes an object, given a name.

Parameters
[in]p_nameThe object name.

◆ SetRenderSystem() [1/2]

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
void Castor3D::Manager< Key, Elem, Owner, EngineGetter >::SetRenderSystem ( RenderSystem p_renderSystem)
inline
Parameters
[in]p_renderSystemThe RenderSystem.

◆ SetRenderSystem() [2/2]

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
RenderSystem* Castor3D::Manager< Key, Elem, Owner, EngineGetter >::SetRenderSystem ( ) const
inline
Returns
The RenderSystem.

◆ unlock()

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
void Castor3D::Manager< Key, Elem, Owner, EngineGetter >::unlock ( ) const
inline

Unlocks the collection mutex.

Member Data Documentation

◆ m_elements

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
Collection Castor3D::Manager< Key, Elem, Owner, EngineGetter >::m_elements
mutableprotected

◆ m_renderSystem

template<typename Key, typename Elem, typename Owner, typename EngineGetter>
RenderSystem* Castor3D::Manager< Key, Elem, Owner, EngineGetter >::m_renderSystem
protected

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