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::ReusableObject Class Reference

Reusable objects for forming private heaps. More...

#include <linked.h>

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

Public Member Functions

ReusableObjectgetNext (void)
 Get next effective reusable object when iterating. More...
 
- 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...
 

Protected Member Functions

virtual void release (void) __OVERRIDE
 Release list, mark as no longer linked. 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)
 

Friends

class ReusableAllocator
 

Additional Inherited Members

- 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...
 
- Protected Attributes inherited from ucommon::LinkedObject
LinkedObjectNext
 

Detailed Description

Reusable objects for forming private heaps.

Reusable objects are linked objects that may be allocated in a private heap, and are returned to a free list when they are no longer needed so they can be reused without having to be re-allocated. The free list is the root of a linked object chain. This is used as a base class for those objects that will be managed through reusable heaps.

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

Definition at line 152 of file linked.h.

Member Function Documentation

◆ getNext()

ReusableObject * ucommon::ReusableObject::getNext ( void  )
inline

Get next effective reusable object when iterating.

Returns
next reusable object in list.

Definition at line 164 of file linked.h.

Referenced by ucommon::ReusableAllocator::next().

◆ release()

void ucommon::ReusableObject::release ( void  )
protectedvirtual

Release list, mark as no longer linked.

Inherited from base Object.

Reimplemented from ucommon::LinkedObject.

Definition at line 90 of file linked.cpp.

References ucommon::LinkedObject::Next.

Referenced by ucommon::ReusableAllocator::release().

Friends And Related Function Documentation

◆ ReusableAllocator

friend class ReusableAllocator
friend

Definition at line 154 of file linked.h.


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