ucommon  7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
  Fossies Dox: ucommon-7.0.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Loading...
Searching...
No Matches
ucommon::PagerObject Class Reference

This is a base class for objects that may be created in pager pools. More...

#include <memory.h>

Inheritance diagram for ucommon::PagerObject:
[legend]
Collaboration diagram for ucommon::PagerObject:
[legend]

Protected Member Functions

 PagerObject ()
 Create a pager object. More...
 
void reset (void)
 Reset state of object. More...
 
void retain (void) __OVERRIDE
 Retain by marking as self referenced list. More...
 
void release (void) __OVERRIDE
 Release a pager object reference. More...
 
void dealloc (void) __OVERRIDE
 Return the pager object back to it's originating pool. More...
 
- Protected Member Functions inherited from ucommon::LinkedObject
 LinkedObject (LinkedObject **root)
 Construct base class attached to a chain of objects. More...
 
 LinkedObject ()
 Construct base class unattached to anyone. More...
 
 LinkedObject (const LinkedObject &from)
 
- Protected Member Functions inherited from ucommon::CountedObject
 CountedObject ()
 Construct a counted object, mark initially as unreferenced. More...
 
 CountedObject (const ObjectProtocol &ref)
 Construct a copy of a counted object. More...
 
virtual void dealloc (void)
 Dealloc object no longer referenced. More...
 
void reset (void)
 Force reset of count. More...
 

Protected Attributes

PagerPoolpager
 
- Protected Attributes inherited from ucommon::LinkedObject
LinkedObjectNext
 

Private Member Functions

 __DELETE_COPY (PagerObject)
 

Friends

class PagerPool
 

Additional Inherited Members

- Public Member Functions inherited from ucommon::LinkedObject
virtual ~LinkedObject ()
 
virtual void release (void) __OVERRIDE
 Release list, mark as no longer linked. More...
 
virtual void retain (void) __OVERRIDE
 Retain by marking as self referenced list. More...
 
void enlist (LinkedObject **root)
 Add our object to an existing linked list through a pointer. More...
 
void delist (LinkedObject **root)
 Locate and remove ourselves from a list of objects. More...
 
bool is_member (LinkedObject *list) const
 Search to see if we are a member of a specific list. More...
 
LinkedObjectgetNext (void) const
 Get next effective object when iterating. More...
 
- Public Member Functions inherited from ucommon::CountedObject
bool is_copied (void) const
 Test if the object has copied references. More...
 
bool is_retained (void) const
 Test if the object has been referenced (retained) by anyone yet. More...
 
unsigned copied (void) const
 Return the number of active references (retentions) to our object. More...
 
void retain (void) __OVERRIDE
 Increase reference count when retained. More...
 
void release (void) __OVERRIDE
 Decrease reference count when released. More...
 
- Static Public Member Functions inherited from ucommon::LinkedObject
static void purge (LinkedObject *root)
 Release all objects from a list. More...
 
static unsigned count (const LinkedObject *root)
 Count the number of linked objects in a list. More...
 
static LinkedObjectgetIndexed (LinkedObject *root, unsigned index)
 Get member by index. More...
 

Detailed Description

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.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 783 of file memory.h.

Constructor & Destructor Documentation

◆ PagerObject()

ucommon::PagerObject::PagerObject ( )
protected

Create a pager object.

This is object is constructed by a PagerPool.

Definition at line 900 of file memory.cpp.

Member Function Documentation

◆ __DELETE_COPY()

ucommon::PagerObject::__DELETE_COPY ( PagerObject  )
private

◆ dealloc()

void ucommon::PagerObject::dealloc ( void  )
protectedvirtual

Return the pager object back to it's originating pool.

Reimplemented from ucommon::CountedObject.

Definition at line 911 of file memory.cpp.

References ucommon::PagerPool::put().

Here is the call graph for this function:

◆ release()

void ucommon::PagerObject::release ( void  )
protectedvirtual

Release a pager object reference.

Reimplemented from ucommon::LinkedObject.

Definition at line 916 of file memory.cpp.

References ucommon::CountedObject::release().

Here is the call graph for this function:

◆ reset()

void ucommon::PagerObject::reset ( void  )
protected

Reset state of object.

Definition at line 905 of file memory.cpp.

References ucommon::LinkedObject::Next, and ucommon::CountedObject::reset().

Referenced by ucommon::PagerPool::get().

Here is the call graph for this function:

◆ retain()

void ucommon::PagerObject::retain ( void  )
protectedvirtual

Retain by marking as self referenced list.

Inherited from base Object.

Reimplemented from ucommon::LinkedObject.

Definition at line 921 of file memory.cpp.

References ucommon::CountedObject::retain().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ PagerPool

friend class PagerPool
friend

Definition at line 789 of file memory.h.

Member Data Documentation

◆ pager

PagerPool* ucommon::PagerObject::pager
protected

Definition at line 791 of file memory.h.

Referenced by ucommon::PagerPool::get().


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