Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
LinkedDouble Class Reference

Self managed double linked list object chain. More...

#include <object.h>

Collaboration diagram for LinkedDouble:
Collaboration graph
[legend]

Public Types

enum  InsertMode { modeAtFirst, modeAtLast, modeBefore, modeAfter }
 Requested in overloaded insert() method to indicate how to insert data into list. More...
 

Public Member Functions

virtual LinkedDoublegetFirst (void)
 Get first linked object in list. More...
 
virtual LinkedDoublegetLast (void)
 Gets the last object in the list. More...
 
virtual LinkedDoublegetInsert (void)
 Virtual to get the insert point to use when adding new members. More...
 
LinkedDoublegetNext (void)
 Get next object, for convenience. More...
 
LinkedDoublegetPrev (void)
 Get prev object in the list. More...
 
virtual void insert (LinkedDouble &obj, InsertMode position=modeAtLast)
 Insert object into chain at given position, as indicated by InsertMode; If no position is given, it defaults to modeAtLast, inserting element at list's end. More...
 
virtual void detach (void)
 Remove object from chain. More...
 
LinkedDoubleoperator+= (LinkedDouble &obj)
 
LinkedDoubleoperator-- ()
 

Protected Member Functions

 LinkedDouble ()
 
virtual ~LinkedDouble ()
 
virtual void enterLock (void)
 
virtual void leaveLock (void)
 
virtual LinkedDoublefirstObject ()
 
virtual LinkedDoublelastObject ()
 

Protected Attributes

LinkedDoublenextObject
 
LinkedDoubleprevObject
 

Detailed Description

Self managed double linked list object chain.

This is used for accumulating lists by using as a base class for a derived subclass.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org Accumulating double linked list.

Definition at line 229 of file object.h.

Member Enumeration Documentation

Requested in overloaded insert() method to indicate how to insert data into list.

Enumerator
modeAtFirst 

insert at first position in list pointed by current object

modeAtLast 

insert at last position in list pointed by current object

modeBefore 

insert in list before current object

modeAfter 

insert in list after current object

Definition at line 253 of file object.h.

Constructor & Destructor Documentation

LinkedDouble::LinkedDouble ( )
inlineprotected

Definition at line 234 of file object.h.

virtual LinkedDouble::~LinkedDouble ( )
protectedvirtual

Member Function Documentation

virtual void LinkedDouble::detach ( void  )
virtual

Remove object from chain.

virtual void LinkedDouble::enterLock ( void  )
protectedvirtual
virtual LinkedDouble* LinkedDouble::firstObject ( )
protectedvirtual
virtual LinkedDouble* LinkedDouble::getFirst ( void  )
virtual

Get first linked object in list.

This may be dynamically recast, and may refer to a master static bookmark pointer in a derived class. Otherwise it follows list to front.

Returns
pointer to first object in list.
virtual LinkedDouble* LinkedDouble::getInsert ( void  )
virtual

Virtual to get the insert point to use when adding new members.

This may be current, or always head or always tail. As a virtual, this allows derived class to establish "policy".

Returns
pointer to insertion point in list.
virtual LinkedDouble* LinkedDouble::getLast ( void  )
virtual

Gets the last object in the list.

This normally follows the links to the end. This is a virtual because derived class may include a static member bookmark for the current end.

Returns
pointer to last object in list.
LinkedDouble* LinkedDouble::getNext ( void  )
inline

Get next object, for convenience.

Derived class may use this with a dynamic cast.

Returns
next object in list.

Definition at line 294 of file object.h.

LinkedDouble* LinkedDouble::getPrev ( void  )
inline

Get prev object in the list.

Returns
pointer to previous object.

Definition at line 302 of file object.h.

virtual void LinkedDouble::insert ( LinkedDouble obj,
InsertMode  position = modeAtLast 
)
virtual

Insert object into chain at given position, as indicated by InsertMode; If no position is given, it defaults to modeAtLast, inserting element at list's end.

Parameters
objectbeing inserted.
positionwhere object is inserted.
virtual LinkedDouble* LinkedDouble::lastObject ( )
protectedvirtual
virtual void LinkedDouble::leaveLock ( void  )
protectedvirtual
LinkedDouble& LinkedDouble::operator+= ( LinkedDouble obj)
LinkedDouble& LinkedDouble::operator-- ( )

Field Documentation

LinkedDouble* LinkedDouble::nextObject
protected

Definition at line 232 of file object.h.

LinkedDouble * LinkedDouble::prevObject
protected

Definition at line 232 of file object.h.


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