PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
Loading...
Searching...
No Matches
PureManager Class Reference

Ancestor class for manager classes. More...

Detailed Description

Ancestor class for manager classes.

Copying is not available yet.

Definition at line 75 of file PureManager.h.

#include <PureManager.h>

+ Inheritance diagram for PureManager:

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().
 
PureManagedgetAttachedAt (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)
 
PureManageroperator= (const PureManager &)
 
virtual void WriteListCallback (const PureManaged &mngd) const
 WriteList() calls this for every single managed object.
 

Private Attributes

PureManagerImplpImpl
 

Constructor & Destructor Documentation

◆ PureManager() [1/2]

PureManager::PureManager ( )
Exceptions
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.

◆ ~PureManager()

PureManager::~PureManager ( )
virtual

Definition at line 641 of file PureManager.cpp.

◆ PureManager() [2/2]

PureManager::PureManager ( const PureManager & other)
protected
Exceptions
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.

Member Function Documentation

◆ Attach()

void PureManager::Attach ( PureManaged & m)
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.

◆ DeleteAll()

void PureManager::DeleteAll ( )

Removes and destructs every managed element in the manager.

Definition at line 777 of file PureManager.cpp.

◆ DeleteAttachedInstance()

void PureManager::DeleteAttachedInstance ( PureManaged & m)

Removes the given managed from the manager and destructs it.

Definition at line 768 of file PureManager.cpp.

◆ Detach()

void PureManager::Detach ( PureManaged & m)
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.

◆ getAttachedAt()

PureManaged * PureManager::getAttachedAt ( TPureInt ind) const

Gets the pointer to the managed at the given index.

Returns
Pointer to the managed at the given index (can be PGENULL in case of invalid index).

Definition at line 709 of file PureManager.cpp.

◆ getAttachedIndex()

TPureInt PureManager::getAttachedIndex ( const PureManaged & m) const

Gets the index of the given managed.

Returns
Index of the given object. -1, if the given managed is not managed by this manager.

Definition at line 719 of file PureManager.cpp.

◆ getConsole()

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.

Returns
Console instance used by this class.

Definition at line 654 of file PureManager.cpp.

◆ getCount()

TPureInt PureManager::getCount ( ) const

Gets the number of managed objects.

Returns
Number of managed objects.

Definition at line 677 of file PureManager.cpp.

◆ getLoggerModuleName()

const char * PureManager::getLoggerModuleName ( )
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.

Returns
The logger module name of this class.

Definition at line 667 of file PureManager.cpp.

◆ getSize()

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.

Returns
Number of allocated slots, a non-negative value.

Definition at line 699 of file PureManager.cpp.

◆ getUsedSystemMemory()

TPureUInt PureManager::getUsedSystemMemory ( ) const
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.

◆ HandleManagedPropertyChanged()

void PureManager::HandleManagedPropertyChanged ( PureManaged & m)
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.

◆ hasAttached()

TPureBool PureManager::hasAttached ( const PureManaged & m) const

Gets whether the given managed is managed by this manager.

Returns
True if the given managed is managed by this manager, false otherwise.

Definition at line 738 of file PureManager.cpp.

◆ isEmpty()

TPureBool PureManager::isEmpty ( ) const

Is the number of manageds 0?

Returns
True, if number of manageds is 0, false otherwise.

Definition at line 687 of file PureManager.cpp.

◆ operator=()

PureManager & PureManager::operator= ( const PureManager & other)
protected

Definition at line 845 of file PureManager.cpp.

◆ PreAlloc()

void PureManager::PreAlloc ( TPureInt count)

Allocates count free slots for manageds.

Definition at line 728 of file PureManager.cpp.

◆ WriteList()

void PureManager::WriteList ( ) const
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.

◆ WriteListCallback()

void PureManager::WriteListCallback ( const PureManaged & mngd) const
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.

Member Data Documentation

◆ pImpl

PureManagerImpl* PureManager::pImpl
private

Definition at line 120 of file PureManager.h.


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