Castor3D  ..
Public Member Functions | List of all members
Castor3D::ManagerView< ResourceType, ManagerType, EventType > Class Template Reference

View on a resource manager. More...

+ Inheritance diagram for Castor3D::ManagerView< ResourceType, ManagerType, EventType >:
+ Collaboration diagram for Castor3D::ManagerView< ResourceType, ManagerType, EventType >:

Public Member Functions

 ManagerView (Castor::String const &p_name, ManagerType &p_manager)
 Constructor. More...
 
 ~ManagerView ()
 Destructor. More...
 
template<typename ... Params>
std::shared_ptr< ResourceType > Create (Castor::String const &p_name, Params &&... p_params)
 Creates an element with the given informations. More...
 
void Insert (Castor::String const &p_name, std::shared_ptr< ResourceType > p_element)
 Removes an object, given a name. More...
 
void Clear ()
 Removes from the manager the elements created through this view. More...
 
bool Has (Castor::String const &p_name) const
 
std::shared_ptr< ResourceType > Find (Castor::String const &p_name) const
 Looks for an element with given name. More...
 
void Remove (Castor::String const &p_name)
 Removes an object, given a name. More...
 

Detailed Description

template<typename ResourceType, typename ManagerType, eEVENT_TYPE EventType>
class Castor3D::ManagerView< ResourceType, ManagerType, EventType >

View on a resource manager.

Author
Sylvain DOREMUS
Date
14/03/2016
Version
0.8.0
Remarks
Allows deletion of elements created through the view, and only those.

Constructor & Destructor Documentation

◆ ManagerView()

template<typename ResourceType , typename ManagerType , eEVENT_TYPE EventType>
Castor3D::ManagerView< ResourceType, ManagerType, EventType >::ManagerView ( Castor::String const &  p_name,
ManagerType &  p_manager 
)
inline

Constructor.

Parameters
[in]p_nameThe view name.
[in]p_managerThe viewed manager.

◆ ~ManagerView()

template<typename ResourceType , typename ManagerType , eEVENT_TYPE EventType>
Castor3D::ManagerView< ResourceType, ManagerType, EventType >::~ManagerView ( )
inline

Destructor.

Member Function Documentation

◆ Clear()

template<typename ResourceType , typename ManagerType , eEVENT_TYPE EventType>
void Castor3D::ManagerView< ResourceType, ManagerType, EventType >::Clear ( )
inline

Removes from the manager the elements created through this view.

◆ Create()

template<typename ResourceType , typename ManagerType , eEVENT_TYPE EventType>
template<typename ... Params>
std::shared_ptr< ResourceType > Castor3D::ManagerView< ResourceType, ManagerType, EventType >::Create ( Castor::String const &  p_name,
Params &&...  p_params 
)
inline

Creates an element with the given informations.

Parameters
[in]p_nameThe element name.
[in]p_paramsThe parameters forwarded to the viewed manager.
Returns
The created element.

◆ Find()

template<typename ResourceType , typename ManagerType , eEVENT_TYPE EventType>
std::shared_ptr< ResourceType > Castor3D::ManagerView< ResourceType, ManagerType, EventType >::Find ( Castor::String 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.

◆ Has()

template<typename ResourceType , typename ManagerType , eEVENT_TYPE EventType>
bool Castor3D::ManagerView< ResourceType, ManagerType, EventType >::Has ( Castor::String const &  p_name) const
inline
Parameters
[in]p_nameThe object name.
Returns
true if an element with given name exists.

◆ Insert()

template<typename ResourceType , typename ManagerType , eEVENT_TYPE EventType>
void Castor3D::ManagerView< ResourceType, ManagerType, EventType >::Insert ( Castor::String const &  p_name,
std::shared_ptr< ResourceType >  p_element 
)
inline

Removes an object, given a name.

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

◆ Remove()

template<typename ResourceType , typename ManagerType , eEVENT_TYPE EventType>
void Castor3D::ManagerView< ResourceType, ManagerType, EventType >::Remove ( Castor::String const &  p_name)
inline

Removes an object, given a name.

Parameters
[in]p_nameThe object name.

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