![]() |
PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
|
Ancestor class for manager classes. More...
Ancestor class for manager classes.
Copying is not available yet.
Definition at line 75 of file PureManager.h.
#include <PureManager.h>
Classes | |
class | PureManagerImpl |
Public Member Functions | |
PureManager () | |
virtual | ~PureManager () |
CConsole & | getConsole () const |
Returns access to console preset with logger module name as this class. | |
TPureInt | getCount () const |
Gets the number of managed objects. | |
TPureBool | isEmpty () const |
Is the number of manageds 0? | |
TPureInt | getSize () const |
Gets the number of allocated slots for managed objects; getSize() >= getCount(). | |
PureManaged * | getAttachedAt (TPureInt ind) const |
Gets the pointer to the managed at the given index. | |
TPureInt | getAttachedIndex (const PureManaged &m) const |
Gets the index of the given managed. | |
void | PreAlloc (TPureInt count) |
Allocates count free slots for manageds. | |
TPureBool | hasAttached (const PureManaged &m) const |
Gets whether the given managed is managed by this manager. | |
virtual void | Attach (PureManaged &m) |
Adds the given managed to the manager, if the managed has no manager yet. | |
virtual void | Detach (PureManaged &m) |
Removes the given managed from the manager, so the managed will have no manager. | |
void | DeleteAttachedInstance (PureManaged &m) |
Removes the given managed from the manager and destructs it. | |
void | DeleteAll () |
Removes and destructs every managed element in the manager. | |
virtual void | HandleManagedPropertyChanged (PureManaged &m) |
Should be invoked when a managed's property got changed from a different kind of manager or managed. | |
virtual TPureUInt | getUsedSystemMemory () const |
Gets the amount of allocated system memory for all manageds owner by this manager. | |
virtual void | WriteList () const |
Writes a list of managed objects to the console. | |
Static Public Member Functions | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
Protected Member Functions | |
PureManager (const PureManager &other) | |
PureManager & | operator= (const PureManager &) |
virtual void | WriteListCallback (const PureManaged &mngd) const |
WriteList() calls this for every single managed object. | |
Private Attributes | |
PureManagerImpl * | pImpl |
PureManager::PureManager | ( | ) |
std::bad_alloc | - This class or its ancestor dynamically allocates memory with operator new, in case of failure the exception is not handled but propagated to caller. |
Definition at line 635 of file PureManager.cpp.
|
virtual |
Definition at line 641 of file PureManager.cpp.
|
protected |
std::bad_alloc | - This class or its ancestor dynamically allocates memory with operator new, in case of failure the exception is not handled but propagated to caller. |
Definition at line 838 of file PureManager.cpp.
|
virtual |
Adds the given managed to the manager, if the managed has no manager yet.
No effect if given managed already has a manager.
Reimplemented in PureObject3DManager.
Definition at line 748 of file PureManager.cpp.
void PureManager::DeleteAll | ( | ) |
Removes and destructs every managed element in the manager.
Definition at line 777 of file PureManager.cpp.
void PureManager::DeleteAttachedInstance | ( | PureManaged & | m | ) |
Removes the given managed from the manager and destructs it.
Definition at line 768 of file PureManager.cpp.
|
virtual |
Removes the given managed from the manager, so the managed will have no manager.
A managed calls this in its destructor: notifies the manager about the destruction so the manager will remove it from itself. See: protected Detach().
Reimplemented in PureObject3DManager.
Definition at line 759 of file PureManager.cpp.
PureManaged * PureManager::getAttachedAt | ( | TPureInt | ind | ) | const |
Gets the pointer to the managed at the given index.
Definition at line 709 of file PureManager.cpp.
TPureInt PureManager::getAttachedIndex | ( | const PureManaged & | m | ) | const |
Gets the index of the given managed.
Definition at line 719 of file PureManager.cpp.
CConsole & PureManager::getConsole | ( | ) | const |
Returns access to console preset with logger module name as this class.
Intentionally not virtual, so the getConsole() in derived class should hide this instead of overriding.
Definition at line 654 of file PureManager.cpp.
TPureInt PureManager::getCount | ( | ) | const |
Gets the number of managed objects.
Definition at line 677 of file PureManager.cpp.
|
static |
Returns the logger module name of this class.
Intentionally not virtual, so derived class should hide this instead of overriding. Not even private, so user can also access this from outside, for any reason like controlling log filtering per logger module name.
Definition at line 667 of file PureManager.cpp.
TPureInt PureManager::getSize | ( | ) | const |
Gets the number of allocated slots for managed objects; getSize() >= getCount().
This doesn't tell about number of managed objects, just number of slots.
Definition at line 699 of file PureManager.cpp.
|
virtual |
Gets the amount of allocated system memory for all manageds owner by this manager.
Reimplemented in PureMesh3D, PureObject3D, and PureVertexTransfer.
Definition at line 799 of file PureManager.cpp.
|
virtual |
Should be invoked when a managed's property got changed from a different kind of manager or managed.
The manager of the managed might be interested in this property change and may implement a change handling functionality by overriding this. For example: PureObject3D has an associated PureMaterial instance. When user changes the blending mode of the material, the PureMaterial instance invokes the PureObject3D instance's getManager()->HandleManagedPropertyChanged() which will be actually PureObject3DManager's implemented change handler, that will handle the changed blend mode of its PureObject3D instance, e.g.: change drawing order in its list, etc.
Reimplemented in PureObject3DManager.
Definition at line 790 of file PureManager.cpp.
TPureBool PureManager::hasAttached | ( | const PureManaged & | m | ) | const |
Gets whether the given managed is managed by this manager.
Definition at line 738 of file PureManager.cpp.
TPureBool PureManager::isEmpty | ( | ) | const |
Is the number of manageds 0?
Definition at line 687 of file PureManager.cpp.
|
protected |
Definition at line 845 of file PureManager.cpp.
void PureManager::PreAlloc | ( | TPureInt | count | ) |
Allocates count free slots for manageds.
Definition at line 728 of file PureManager.cpp.
|
virtual |
Writes a list of managed objects to the console.
Reimplemented in PureFiledManager, PureImageManager, PureMaterialManager, PureMesh3DManager, PureObject3DManager, and PureTextureManager.
Definition at line 808 of file PureManager.cpp.
|
protectedvirtual |
WriteList() calls this for every single managed object.
Just for debugging purposes. This should be also overridden to provide more precise info about the descendant managed object.
Reimplemented in PureFiledManager, PureImageManager, PureMaterialManager, PureMesh3DManager, PureObject3DManager, and PureTextureManager.
Definition at line 857 of file PureManager.cpp.
|
private |
Definition at line 120 of file PureManager.h.