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

Detailed Description

Definition at line 306 of file PureManager.cpp.

Public Member Functions

virtual ~PureManagerImpl ()
 
TPureInt getCount () const
 
TPureBool isEmpty () const
 
TPureInt getSize () const
 
PureManagedgetAttachedAt (TPureInt ind) const
 
TPureInt getAttachedIndex (const PureManaged &m) const
 
void PreAlloc (TPureInt count)
 
TPureBool hasAttached (const PureManaged &m) const
 
void Attach (PureManaged &m)
 
void Detach (PureManaged &m)
 
void DeleteAttachedInstance (PureManaged &m)
 
void DeleteAll ()
 
TPureUInt getUsedSystemMemory () const
 

Private Member Functions

 PureManagerImpl (PureManager *pOwner)
 
 PureManagerImpl (const PureManagerImpl &)
 
PureManagerImploperator= (const PureManagerImpl &)
 
TPureInt preAlloc (TPureInt count)
 Extends the array by the given value.
 
TPureInt createManaged ()
 Gets an index to a free slot for a new managed object.
 
void Detach (TPureInt ind)
 Removes the given indexed object from the array (but doesn't destructs it!).
 

Private Attributes

PureManager_pOwner
 The owner public object who creates this pimpl object.
 
TPureInt nManagedCount
 Number of managed objects, only readable for descendants: getCount().
 
TPureInt nManagedAllocated
 Number of allocated slots for managed objects, nManagedAllocated >= nManagedCount, only readable for descendants: getSize().
 
PureManaged ** pManageds
 Pointer to array of pointers to managed objects, free slots contain NULLs, only readable: getAttachedAt().
 

Friends

class PureManager
 

Constructor & Destructor Documentation

◆ ~PureManagerImpl()

PureManager::PureManagerImpl::~PureManagerImpl ( )
virtual

Definition at line 354 of file PureManager.cpp.

◆ PureManagerImpl() [1/2]

PureManager::PureManagerImpl::PureManagerImpl ( PureManager * pOwner)
explicitprivate
Parameters
pOwnerThe public class owning this pimpl object.

Definition at line 510 of file PureManager.cpp.

◆ PureManagerImpl() [2/2]

PureManager::PureManagerImpl::PureManagerImpl ( const PureManagerImpl & other)
private

Definition at line 520 of file PureManager.cpp.

Member Function Documentation

◆ Attach()

void PureManager::PureManagerImpl::Attach ( PureManaged & m)

Definition at line 413 of file PureManager.cpp.

◆ createManaged()

TPureInt PureManager::PureManagerImpl::createManaged ( )
private

Gets an index to a free slot for a new managed object.

If there is 1 free slot somewhere, that's index will be returned, otherwise it'll allocate a new slot.

Returns
Non-zero index to a free slot, -1 on error.

Definition at line 590 of file PureManager.cpp.

◆ DeleteAll()

void PureManager::PureManagerImpl::DeleteAll ( )

Definition at line 466 of file PureManager.cpp.

◆ DeleteAttachedInstance()

void PureManager::PureManagerImpl::DeleteAttachedInstance ( PureManaged & m)

Definition at line 441 of file PureManager.cpp.

◆ Detach() [1/2]

void PureManager::PureManagerImpl::Detach ( PureManaged & m)

Definition at line 433 of file PureManager.cpp.

◆ Detach() [2/2]

void PureManager::PureManagerImpl::Detach ( TPureInt ind)
private

Removes the given indexed object from the array (but doesn't destructs it!).

This is called by the public version of this function and by DeleteManagedInstance(). Nulls parentMgr because maybe we don't want to destruct the managed, just release it from the manager.

Definition at line 611 of file PureManager.cpp.

◆ getAttachedAt()

PureManaged * PureManager::PureManagerImpl::getAttachedAt ( TPureInt ind) const

Definition at line 381 of file PureManager.cpp.

◆ getAttachedIndex()

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

Definition at line 390 of file PureManager.cpp.

◆ getCount()

TPureInt PureManager::PureManagerImpl::getCount ( ) const

Definition at line 363 of file PureManager.cpp.

◆ getSize()

TPureInt PureManager::PureManagerImpl::getSize ( ) const

Definition at line 375 of file PureManager.cpp.

◆ getUsedSystemMemory()

TPureUInt PureManager::PureManagerImpl::getUsedSystemMemory ( ) const

Definition at line 487 of file PureManager.cpp.

◆ hasAttached()

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

Definition at line 407 of file PureManager.cpp.

◆ isEmpty()

TPureBool PureManager::PureManagerImpl::isEmpty ( ) const

Definition at line 369 of file PureManager.cpp.

◆ operator=()

PureManager::PureManagerImpl & PureManager::PureManagerImpl::operator= ( const PureManagerImpl & other)
private

Definition at line 539 of file PureManager.cpp.

◆ PreAlloc()

void PureManager::PureManagerImpl::PreAlloc ( TPureInt count)

Definition at line 401 of file PureManager.cpp.

◆ preAlloc()

TPureInt PureManager::PureManagerImpl::preAlloc ( TPureInt count)
private

Extends the array by the given value.

So if it has 4 manageds and count is 10, then the total number of slots will be 14. Only positive value is accepted. Sometimes its good to preallocate many slots only once instead of allocation over and over a few new slots, to avoid memory fragmentation.

Returns
The first free slot of the NEW slots. -1 if the given parameter is not positive or allocation error occurred.

Definition at line 554 of file PureManager.cpp.

Friends And Related Symbol Documentation

◆ PureManager

friend class PureManager
friend

Definition at line 346 of file PureManager.cpp.

Member Data Documentation

◆ _pOwner

PureManager* PureManager::PureManagerImpl::_pOwner
private

The owner public object who creates this pimpl object.

Definition at line 331 of file PureManager.cpp.

◆ nManagedAllocated

TPureInt PureManager::PureManagerImpl::nManagedAllocated
private

Number of allocated slots for managed objects, nManagedAllocated >= nManagedCount, only readable for descendants: getSize().

Definition at line 333 of file PureManager.cpp.

◆ nManagedCount

TPureInt PureManager::PureManagerImpl::nManagedCount
private

Number of managed objects, only readable for descendants: getCount().

Definition at line 332 of file PureManager.cpp.

◆ pManageds

PureManaged** PureManager::PureManagerImpl::pManageds
private

Pointer to array of pointers to managed objects, free slots contain NULLs, only readable: getAttachedAt().

Definition at line 334 of file PureManager.cpp.


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