PixelLightAPI
.
|
Abstract element manager template. More...
#include <ElementManager.h>
Public Member Functions | |
String | GetManagerName () const |
Returns the name of the manager. | |
bool | SetManagerName (const String &sName="") |
Sets the name of the manager. | |
bool | Clear (bool bProtectedToo=true) |
Clear the manager, delete all elements. | |
AType * | Create (const String &sName="") |
Creates a new element. | |
bool | Add (AType &cElement) |
Adds a element. | |
bool | Unload (AType &cElement) |
Unload a element. | |
bool | Remove (AType &cElement) |
Removes a element. | |
uint32 | UnloadUnused () |
Unload unused elements. | |
bool | GetUnloadUnused () const |
Returns whether unused element are unloaded automatically or not. | |
void | SetUnloadUnused (bool bUnloadUnused=false) |
Sets whether unused element are unloaded automatically or not. | |
AType * | GetStandard () const |
Get the standard element. | |
bool | SetStandard (AType *pElement=nullptr) |
Set the standard element. | |
uint32 | GetNumOfElements () const |
Returns the number of elements within the manager. | |
virtual bool | Init () |
Initializes the manager. | |
virtual bool | DeInit () |
De-initializes the manager. | |
virtual bool | Update () |
Updates the manager. | |
virtual ElementManager< AType > & | operator= (const ElementManager< AType > &cSource) |
Copy operator. | |
virtual AType * | GetByIndex (uint32 nIndex=0) const |
Returns the element at the given index. | |
virtual int | GetIndex (AType &cElement) const |
Returns the index of the given element. | |
virtual void | MoveElement (uint32 nFromIndex, uint32 nToIndex) |
Moves an element within the element list. | |
virtual AType * | GetByName (const String &sName) const |
Returns the element with the given name. | |
Protected Member Functions | |
ElementManager () | |
Constructor. | |
virtual | ~ElementManager () |
Destructor. | |
bool | SetElementName (AType &cElement, const String &sName) |
Sets the element name. | |
virtual AType * | CreateElement (const String &sName="")=0 |
Creates a new element. | |
Protected Attributes | |
String | m_sManagerName |
AType * | m_pStandardElement |
bool | m_bUnloadUnused |
Array< AType * > | m_lstElements |
HashMap< String, AType * > | m_mapElements |
Abstract element manager template.
PLCore::ElementManager< AType >::ElementManager | ( | ) | [protected] |
PLCore::ElementManager< AType >::~ElementManager | ( | ) | [protected, virtual] |
Destructor.
String PLCore::ElementManager< AType >::GetManagerName | ( | ) | const |
Returns the name of the manager.
bool PLCore::ElementManager< AType >::SetManagerName | ( | const String & | sName = "" | ) |
Sets the name of the manager.
[in] | sName | New manager name |
bool PLCore::ElementManager< AType >::Clear | ( | bool | bProtectedToo = true | ) |
Clear the manager, delete all elements.
[in] | bProtectedToo | Delete protected elements, too? |
AType * PLCore::ElementManager< AType >::Create | ( | const String & | sName = "" | ) |
Creates a new element.
[in] | sName | Element name, if "" an unused name is set automatically |
bool PLCore::ElementManager< AType >::Add | ( | AType & | cElement | ) |
Adds a element.
[in] | cElement | Element to add |
bool PLCore::ElementManager< AType >::Unload | ( | AType & | cElement | ) |
Unload a element.
[in] | cElement | Element which should be unloaded |
bool PLCore::ElementManager< AType >::Remove | ( | AType & | cElement | ) |
Removes a element.
[in] | cElement | Element to remove |
uint32 PLCore::ElementManager< AType >::UnloadUnused | ( | ) |
bool PLCore::ElementManager< AType >::GetUnloadUnused | ( | ) | const |
Returns whether unused element are unloaded automatically or not.
void PLCore::ElementManager< AType >::SetUnloadUnused | ( | bool | bUnloadUnused = false | ) |
Sets whether unused element are unloaded automatically or not.
[in] | bUnloadUnused | Unload unused elements automatically? |
AType * PLCore::ElementManager< AType >::GetStandard | ( | ) | const |
Get the standard element.
bool PLCore::ElementManager< AType >::SetStandard | ( | AType * | pElement = nullptr | ) |
Set the standard element.
[in] | pElement | Element which should be the standard element, a null pointer to set no such element |
uint32 PLCore::ElementManager< AType >::GetNumOfElements | ( | ) | const |
Returns the number of elements within the manager.
bool PLCore::ElementManager< AType >::Init | ( | ) | [virtual] |
Initializes the manager.
bool PLCore::ElementManager< AType >::DeInit | ( | ) | [virtual] |
De-initializes the manager.
Reimplemented in PLScene::SceneContainer.
bool PLCore::ElementManager< AType >::Update | ( | ) | [virtual] |
Updates the manager.
ElementManager< AType > & PLCore::ElementManager< AType >::operator= | ( | const ElementManager< AType > & | cSource | ) | [virtual] |
Copy operator.
[in] | cSource | Source to copy from |
AType * PLCore::ElementManager< AType >::GetByIndex | ( | uint32 | nIndex = 0 | ) | const [virtual] |
Returns the element at the given index.
[in] | nIndex | Index of the element |
int PLCore::ElementManager< AType >::GetIndex | ( | AType & | cElement | ) | const [virtual] |
Returns the index of the given element.
[in] | cElement | The element for which the index should be retrieved |
void PLCore::ElementManager< AType >::MoveElement | ( | uint32 | nFromIndex, |
uint32 | nToIndex | ||
) | [virtual] |
Moves an element within the element list.
[in] | nFromIndex | The index of the element which should be moved |
[in] | nToIndex | The index to which the element should be moved |
AType * PLCore::ElementManager< AType >::GetByName | ( | const String & | sName | ) | const [virtual] |
Returns the element with the given name.
[in] | sName | Element name |
Reimplemented in PLScene::SceneContainer.
bool PLCore::ElementManager< AType >::SetElementName | ( | AType & | cElement, |
const String & | sName | ||
) | [protected] |
Sets the element name.
Sets the unique element name.
[in] | cElement | Element to set the name |
[in] | sName | New element name |
virtual AType* PLCore::ElementManager< AType >::CreateElement | ( | const String & | sName = "" | ) | [protected, pure virtual] |
Creates a new element.
[in] | sName | Element name |
Implemented in PLRenderer::AnimationManager.
String PLCore::ElementManager< AType >::m_sManagerName [protected] |
Manager name
AType* PLCore::ElementManager< AType >::m_pStandardElement [protected] |
Standard element, can be a null pointer
bool PLCore::ElementManager< AType >::m_bUnloadUnused [protected] |
Unload unused resources?
Array<AType*> PLCore::ElementManager< AType >::m_lstElements [protected] |
Element list
HashMap<String, AType*> PLCore::ElementManager< AType >::m_mapElements [protected] |
Element map
|