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

A double linked list object. More...

#include <linked.h>

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

Public Member Functions

void delist (void)
 Remove our object from the list it is currently part of. More...
 
void enlistHead (OrderedIndex *index)
 Attach our object to the start of a linked list though an ordered index. More...
 
void enlistTail (OrderedIndex *index)
 Attach our object to the end of a linked list though an ordered index. More...
 
void enlist (OrderedIndex *index)
 Attach our object to a linked list. More...
 
bool is_head (void) const
 Test if we are at the head of a list. More...
 
bool is_tail (void) const
 Test if we are at the end of a list. More...
 
DLinkedObjectgetPrev (void) const
 Get previous node in the list for reverse iteration. More...
 
DLinkedObjectgetNext (void) const
 Get next node in the list when iterating. More...
 
void insertTail (DLinkedObject *object)
 Insert object behind our object. More...
 
void insertHead (DLinkedObject *object)
 Insert object in front of our object. More...
 
virtual void insert (DLinkedObject *object)
 Insert object, method in derived object. More...
 
DLinkedObjectoperator+= (DLinkedObject *object)
 Insert object behind our object. More...
 
DLinkedObjectoperator-= (DLinkedObject *object)
 Insert object in front of our object. More...
 
DLinkedObjectoperator*= (DLinkedObject *object)
 Insert object in list with our object. More...
 
- Public Member Functions inherited from ucommon::OrderedObject
void enlistTail (OrderedIndex *index)
 List our ordered object at end of a linked list on an index. More...
 
void enlistHead (OrderedIndex *index)
 List our ordered object at start of a linked list on an index. More...
 
virtual void enlist (OrderedIndex *index)
 List our ordered object in default strategy mode. More...
 
void delist (OrderedIndex *index)
 Remove our ordered object from an existing index. More...
 
OrderedObjectgetNext (void) const
 Get next ordered member 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

 DLinkedObject (OrderedIndex *index)
 Construct and add our object to an existing double linked list at end. More...
 
 DLinkedObject ()
 Construct an unlinked object. More...
 
 DLinkedObject (const DLinkedObject &from)
 
virtual ~DLinkedObject ()
 Delete linked list object. More...
 
- Protected Member Functions inherited from ucommon::OrderedObject
 OrderedObject (OrderedIndex *index)
 Construct an ordered object aot end of a an index. More...
 
 OrderedObject ()
 Construct an ordered object unattached. More...
 
 OrderedObject (const OrderedObject &from)
 
- 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 Attributes

DLinkedObjectPrev
 
OrderedIndexRoot
 
- Protected Attributes inherited from ucommon::LinkedObject
LinkedObjectNext
 

Friends

class ObjectQueue
 

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...
 

Detailed Description

A double linked list object.

This is used as a base class for objects that will be organized through ordered double linked lists which allow convenient insertion and deletion of list members anywhere in the list.

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

Definition at line 768 of file linked.h.

Constructor & Destructor Documentation

◆ DLinkedObject() [1/3]

ucommon::DLinkedObject::DLinkedObject ( OrderedIndex index)
protected

Construct and add our object to an existing double linked list at end.

Parameters
indexof linked list we are listed in.

Definition at line 723 of file linked.cpp.

References enlist(), ucommon::LinkedObject::Next, Prev, and Root.

Here is the call graph for this function:

◆ DLinkedObject() [2/3]

ucommon::DLinkedObject::DLinkedObject ( )
protected

Construct an unlinked object.

Definition at line 709 of file linked.cpp.

References ucommon::LinkedObject::Next, Prev, and Root.

◆ DLinkedObject() [3/3]

ucommon::DLinkedObject::DLinkedObject ( const DLinkedObject from)
protected

Definition at line 716 of file linked.cpp.

References ucommon::LinkedObject::Next, Prev, and Root.

◆ ~DLinkedObject()

ucommon::DLinkedObject::~DLinkedObject ( )
protectedvirtual

Delete linked list object.

If it is a member of a list of objects, then the list is reformed around us.

Definition at line 846 of file linked.cpp.

References delist().

Here is the call graph for this function:

Member Function Documentation

◆ delist()

void ucommon::DLinkedObject::delist ( void  )

Remove our object from the list it is currently part of.

Definition at line 827 of file linked.cpp.

References ucommon::OrderedIndex::head, ucommon::LinkedObject::Next, Prev, Root, and ucommon::OrderedIndex::tail.

Referenced by enlistHead(), enlistTail(), insertHead(), insertTail(), and ~DLinkedObject().

◆ enlist()

void ucommon::DLinkedObject::enlist ( OrderedIndex index)
virtual

Attach our object to a linked list.

The default strategy is to add to tail.

Parameters
indexof linked list we are joining.

Reimplemented from ucommon::OrderedObject.

Definition at line 731 of file linked.cpp.

References enlistTail().

Referenced by DLinkedObject().

Here is the call graph for this function:

◆ enlistHead()

void ucommon::DLinkedObject::enlistHead ( OrderedIndex index)

Attach our object to the start of a linked list though an ordered index.

If we are already attached to a list we are delisted first.

Parameters
indexof linked list we are joining.

Definition at line 785 of file linked.cpp.

References delist(), ucommon::OrderedIndex::head, ucommon::LinkedObject::Next, Prev, Root, and ucommon::OrderedIndex::tail.

Here is the call graph for this function:

◆ enlistTail()

void ucommon::DLinkedObject::enlistTail ( OrderedIndex index)

Attach our object to the end of a linked list though an ordered index.

If we are already attached to a list we are delisted first.

Parameters
indexof linked list we are joining.

Definition at line 807 of file linked.cpp.

References delist(), ucommon::OrderedIndex::head, ucommon::LinkedObject::Next, Prev, Root, and ucommon::OrderedIndex::tail.

Referenced by enlist().

Here is the call graph for this function:

◆ getNext()

DLinkedObject * ucommon::DLinkedObject::getNext ( void  ) const
inline

Get next node in the list when iterating.

Returns
next node in list.

Definition at line 850 of file linked.h.

◆ getPrev()

DLinkedObject * ucommon::DLinkedObject::getPrev ( void  ) const
inline

Get previous node in the list for reverse iteration.

Returns
previous node in list.

Definition at line 842 of file linked.h.

◆ insert()

void ucommon::DLinkedObject::insert ( DLinkedObject object)
virtual

Insert object, method in derived object.

Parameters
objectto add to list.

Definition at line 738 of file linked.cpp.

References insertTail().

Here is the call graph for this function:

◆ insertHead()

void ucommon::DLinkedObject::insertHead ( DLinkedObject object)

Insert object in front of our object.

Parameters
objectto add to list.

Definition at line 745 of file linked.cpp.

References delist(), ucommon::OrderedIndex::head, ucommon::LinkedObject::Next, Prev, and Root.

Here is the call graph for this function:

◆ insertTail()

void ucommon::DLinkedObject::insertTail ( DLinkedObject object)

Insert object behind our object.

Parameters
objectto add to list.

Definition at line 765 of file linked.cpp.

References delist(), ucommon::LinkedObject::Next, Prev, Root, and ucommon::OrderedIndex::tail.

Referenced by insert().

Here is the call graph for this function:

◆ is_head()

bool ucommon::DLinkedObject::is_head ( void  ) const
inline

Test if we are at the head of a list.

Returns
true if we are the first node in a list.

Definition at line 826 of file linked.h.

References ucommon::OrderedIndex::head.

◆ is_tail()

bool ucommon::DLinkedObject::is_tail ( void  ) const
inline

Test if we are at the end of a list.

Returns
true if we are the last node in a list.

Definition at line 834 of file linked.h.

References ucommon::OrderedIndex::tail.

◆ operator*=()

DLinkedObject & ucommon::DLinkedObject::operator*= ( DLinkedObject object)
inline

Insert object in list with our object.

Parameters
objectto add to list.

Definition at line 894 of file linked.h.

◆ operator+=()

DLinkedObject & ucommon::DLinkedObject::operator+= ( DLinkedObject object)
inline

Insert object behind our object.

Parameters
objectto add to list.

Definition at line 876 of file linked.h.

◆ operator-=()

DLinkedObject & ucommon::DLinkedObject::operator-= ( DLinkedObject object)
inline

Insert object in front of our object.

Parameters
objectto add to list.

Definition at line 885 of file linked.h.

Friends And Related Function Documentation

◆ ObjectQueue

friend class ObjectQueue
friend

Definition at line 771 of file linked.h.

Member Data Documentation

◆ Prev

DLinkedObject* ucommon::DLinkedObject::Prev
protected

Definition at line 773 of file linked.h.

Referenced by delist(), DLinkedObject(), enlistHead(), enlistTail(), insertHead(), and insertTail().

◆ Root

OrderedIndex* ucommon::DLinkedObject::Root
protected

Definition at line 774 of file linked.h.

Referenced by delist(), DLinkedObject(), enlistHead(), enlistTail(), insertHead(), and insertTail().


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