Crazy Eddies GUI System: CEGUI::RenderEffectManager Class Reference

Crazy Eddies GUI System 0.7.6

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions
CEGUI::RenderEffectManager Class Reference

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

Inheritance diagram for CEGUI::RenderEffectManager:
[legend]
Collaboration diagram for CEGUI::RenderEffectManager:
[legend]

List of all members.

## 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.
void | removeEffect (const String &name)
| Remove / unregister any RenderEffect using the specified identifier.
bool | isEffectAvailable (const String &name) const
| Return whether a RenderEffect has been registered under the specified name.
RenderEffect & | create (const String &name)
| Create an instance of the RenderEffect based class identified by the specified name.
void | destroy (RenderEffect &effect)
| Destroy the given RenderEffect object.

## 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:

  T | The RenderEffect based class to be instantiated when an effect is requested using the identifier name.

Parameters:

  name | String object describing the identifier that the RenderEffect based class will be registered under.

Exceptions:

  AlreadyExistsException | thrown 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:

  name | String object describing the identifier of the RenderEffect based class that is to be created.

Returns:
  Reference to the newly created RenderEffect.

Exceptions:

  UnknownObjectException | thrown 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:

  effect | Reference to the RenderEffect object that is to be destroyed.

Exceptions:

  InvalidRequestException | thrown 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:

  name | String 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:

  name | String 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.