|
UCommon
|
Common base class for all objects that can be formed into a linked list. More...
#include <linked.h>


Public Member Functions | |
| 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 | isMember (LinkedObject *list) const |
| Search to see if we are a member of a specific list. | |
| virtual void | release (void) |
| Release list, mark as no longer linked. | |
| virtual void | retain (void) |
| Retain by marking as self referenced list. | |
Static Public Member Functions | |
| 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. | |
Static Public Attributes | |
| static const LinkedObject * | inv |
| Marker for invalid list pointer. | |
| static const LinkedObject * | nil |
| Marker for end of linked list. | |
Protected Member Functions | |
| LinkedObject (LinkedObject **root) | |
| Construct base class attached to a chain of objects. | |
| LinkedObject () | |
| Construct base class unattached to anyone. | |
Protected Attributes | |
| LinkedObject * | next |
Friends | |
| class | LinkedRing |
| class | NamedObject |
| class | ObjectStack |
| class | OrderedIndex |
Common base class for all objects that can be formed into a linked list.
This base class is used directly for objects that can be formed into a single linked list. It is also used directly as a type for a pointer to the start of list of objects that are linked together as a list.
| LinkedObject::LinkedObject | ( | LinkedObject ** | root | ) | [protected] |
Construct base class attached to a chain of objects.
| root | pointer to chain of objects we are part of. |
| LinkedObject::LinkedObject | ( | ) | [protected] |
Construct base class unattached to anyone.
This might be used to construct intermediary base classes that may form lists through indexing objects.
| static unsigned LinkedObject::count | ( | const LinkedObject * | root | ) | [static] |
Count the number of linked objects in a list.
| root | pointer to list we are counting. |
| void LinkedObject::delist | ( | LinkedObject ** | root | ) |
Locate and remove ourselves from a list of objects.
This searches the list to locate our object and if found relinks the list around us.
| root | pointer to list we are removing ourselves from. |
| void LinkedObject::enlist | ( | LinkedObject ** | root | ) |
Add our object to an existing linked list through a pointer.
This forms a container sorted in lifo order since we become the head of the list, and the previous head becomes our next.
| root | pointer to list we are adding ourselves to. |
| static LinkedObject* LinkedObject::getIndexed | ( | LinkedObject * | root, |
| unsigned | index | ||
| ) | [static] |
Get member by index.
| root | pointer to list we are indexing. |
| index | member to find. |
| LinkedObject* LinkedObject::getNext | ( | void | ) | const [inline] |
Get next effective object when iterating.
Reimplemented in OrderedObject, NamedObject, and LinkedList.
| bool LinkedObject::isMember | ( | LinkedObject * | list | ) | const |
Search to see if we are a member of a specific list.
| static void LinkedObject::purge | ( | LinkedObject * | root | ) | [static] |
Release all objects from a list.
| root | pointer to list we are purging. |
| virtual void LinkedObject::release | ( | void | ) | [virtual] |
Release list, mark as no longer linked.
Inherited from base Object.
Reimplemented from Object.
Reimplemented in ReusableObject, and PagerObject.
| virtual void LinkedObject::retain | ( | void | ) | [virtual] |
const LinkedObject* LinkedObject::nil [static] |