Crazy Eddies GUI System  0.7.2
Public Types | Public Member Functions | List of all members
CEGUI::RenderEffectManager Class Reference

Singleton class that manages creation and destruction of RenderEffect based objects. More...

+ Inheritance diagram for CEGUI::RenderEffectManager:
+ Collaboration diagram for CEGUI::RenderEffectManager:

Public Types

typedef ConstBaseIterator
< RenderEffectRegistry > 
RenderEffectIterator
 Iterator type that iterates over entries in the RenderEffectRegistry.
 

Public Member Functions

 RenderEffectManager ()
 Constructor for RenderEffectManager objects.
 
 ~RenderEffectManager ()
 Destructor for RenderEffectManager objects.
 
template<typename T >
void addEffect (const String &name)
 Register a RenderEffect type with the system and associate it with the identifier name. More...
 
void removeEffect (const String &name)
 Remove / unregister any RenderEffect using the specified identifier. More...
 
bool isEffectAvailable (const String &name) const
 Return whether a RenderEffect has been registered under the specified name. More...
 
RenderEffectcreate (const String &name)
 Create an instance of the RenderEffect based class identified by the specified name. More...
 
void destroy (RenderEffect &effect)
 Destroy the given RenderEffect object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CEGUI::Singleton< RenderEffectManager >
static RenderEffectManagergetSingleton (void)
 
static RenderEffectManagergetSingletonPtr (void)
 
- Static Protected Attributes inherited from CEGUI::Singleton< RenderEffectManager >
static RenderEffectManagerms_Singleton
 

Detailed Description

Singleton class that manages creation and destruction of RenderEffect based objects.

Member Function Documentation

template<typename T >
void CEGUI::RenderEffectManager::addEffect ( const String name)

Register a RenderEffect type with the system and associate it with the identifier name.

This registers a RenderEffect based class, such that instances of that
class can subsequently be created by requesting an effect using the
specified identifier.
Template Parameters
TThe RenderEffect based class to be instantiated when an effect is requested using the identifier name.
Parameters
nameString object describing the identifier that the RenderEffect based class will be registered under.
Exceptions
AlreadyExistsExceptionthrown if a RenderEffect is already registered using name.

References isEffectAvailable().

RenderEffect& CEGUI::RenderEffectManager::create ( const String name)

Create an instance of the RenderEffect based class identified by the specified name.

Parameters
nameString object describing the identifier of the RenderEffect based class that is to be created.
Returns
Reference to the newly created RenderEffect.
Exceptions
UnknownObjectExceptionthrown if no RenderEffect class has been registered using the identifier name.
void CEGUI::RenderEffectManager::destroy ( RenderEffect effect)

Destroy the given RenderEffect object.

Note
This function will only destroy objects that were created via the RenderEffectManager. Attempts to destroy objects created by other means will result in an InvalidRequestException. This option was chosen over silently ignoring the request in order to aid application developers in thier debugging.
Parameters
effectReference to the RenderEffect object that is to be destroyed.
Exceptions
InvalidRequestExceptionthrown if effect was not created by the RenderEffectManager.
bool CEGUI::RenderEffectManager::isEffectAvailable ( const String name) const

Return whether a RenderEffect has been registered under the specified name.

Parameters
nameString object describing the identifier of a RenderEffect to test for.
Returns
  • true if a RenderEffect with the specified name is registered.
  • false if no RenderEffect with the specified name is registered.

Referenced by addEffect().

void CEGUI::RenderEffectManager::removeEffect ( const String name)

Remove / unregister any RenderEffect using the specified identifier.

Parameters
nameString object describing the identifier of the RenderEffect that is to be removed / unregistered. If no such RenderEffect is present, no action is taken.
Note
You should avoid removing RenderEffect types that are still in use. Internally a factory system is employed for the creation and deletion of RenderEffect objects; if an effect - and therefore it's factory - is removed while instances are still active, it will not be possible to safely delete those RenderEffect object instances.