UCommon
|
This is a base class for objects that may be created in pager pools. More...
#include <memory.h>
Protected Member Functions | |
void | dealloc (void) |
Return the pager object back to it's originating pool. | |
PagerObject () | |
Create a pager object. | |
void | release (void) |
Release a pager object reference. | |
void | reset (void) |
Reset state of object. | |
void | retain (void) |
Retain by marking as self referenced list. | |
![]() | |
LinkedObject () | |
Construct base class unattached to anyone. | |
LinkedObject (const LinkedObject &from) | |
LinkedObject (LinkedObject **root) | |
Construct base class attached to a chain of objects. | |
![]() | |
CountedObject () | |
Construct a counted object, mark initially as unreferenced. | |
CountedObject (const ObjectProtocol &ref) | |
Construct a copy of a counted object. | |
void | reset (void) |
Force reset of count. | |
Protected Attributes | |
PagerPool * | pager |
![]() | |
LinkedObject * | Next |
Friends | |
class | PagerPool |
Additional Inherited Members | |
![]() | |
void | delist (LinkedObject **root) |
Locate and remove ourselves from a list of objects. | |
void | enlist (LinkedObject **root) |
Add our object to an existing linked list through a pointer. | |
LinkedObject * | getNext (void) const |
Get next effective object when iterating. | |
bool | is_member (LinkedObject *list) const |
Search to see if we are a member of a specific list. | |
![]() | |
ObjectProtocol * | copy (void) |
Retain (increase retention of) object when copying. | |
void | operator++ (void) |
Increase retention operator. | |
void | operator-- (void) |
Decrease retention operator. | |
virtual | ~ObjectProtocol () |
Required virtual destructor. | |
![]() | |
unsigned | copied (void) const |
Return the number of active references (retentions) to our object. | |
bool | is_copied (void) const |
Test if the object has copied references. | |
bool | is_retained (void) const |
Test if the object has been referenced (retained) by anyone yet. | |
![]() | |
static unsigned | count (const LinkedObject *root) |
Count the number of linked objects in a list. | |
static LinkedObject * | getIndexed (LinkedObject *root, unsigned index) |
Get member by index. | |
static void | purge (LinkedObject *root) |
Release all objects from a list. | |
This is a base class for objects that may be created in pager pools.
This is also used to create objects which can be maintained as managed memory and returned to a pool. The linked list is used when freeing and re-allocating the object. These objects are reference counted so that they are returned to the pool they come from automatically when falling out of scope. This can be used to create automatic garbage collection pools.
|
protected |
Create a pager object.
This is object is constructed by a PagerPool.
|
protectedvirtual |
Return the pager object back to it's originating pool.
Reimplemented from ucommon::CountedObject.
|
protectedvirtual |
Release a pager object reference.
Reimplemented from ucommon::LinkedObject.
|
protectedvirtual |
Retain by marking as self referenced list.
Inherited from base Object.
Reimplemented from ucommon::LinkedObject.