UCommon
|
An index container for maintaining an ordered list of objects. More...
#include <linked.h>
Public Member Functions | |
void | add (OrderedObject *ordered) |
Add an object into the ordered index. | |
LinkedObject * | begin (void) const |
Return first object in list for iterators. | |
unsigned | count (void) const |
Count of objects this list manages. | |
LinkedObject * | end (void) const |
Return last object in list for iterators. | |
LinkedObject * | find (unsigned offset) const |
Find a specific member in the ordered list. | |
LinkedObject * | get (void) |
Get (pull) object off the list. | |
LinkedObject * | getIndexed (unsigned index) const |
Get an indexed member from the ordered index. | |
LinkedObject ** | index (void) const |
Return a pointer to the head of the list. | |
virtual void | lock_index (void) |
Used to synchronize lists managed by multiple threads. | |
LinkedObject * | operator* () const |
Return head object pointer. | |
void | operator*= (OrderedObject *object) |
Add object to our list. | |
OrderedIndex () | |
Create and initialize an empty index. | |
void | purge (void) |
Purge the linked list and then set the index to empty. | |
void | reset (void) |
Reset linked list to empty without purging. | |
virtual void | unlock_index (void) |
Used to synchronize lists managed by multiple threads. | |
virtual | ~OrderedIndex () |
Destroy index. | |
Protected Attributes | |
OrderedObject * | head |
OrderedObject * | tail |
Friends | |
class | DLinkedObject |
class | LinkedList |
class | NamedObject |
class | OrderedObject |
An index container for maintaining an ordered list of objects.
This index holds a pointer to the head and tail of an ordered list of linked objects. Fundamental methods for supporting iterators are also provided.
void OrderedIndex::add | ( | OrderedObject * | ordered | ) |
Add an object into the ordered index.
ordered | object to add to the index. |
LinkedObject* OrderedIndex::begin | ( | void | ) | const [inline] |
unsigned OrderedIndex::count | ( | void | ) | const |
Count of objects this list manages.
LinkedObject* OrderedIndex::end | ( | void | ) | const [inline] |
LinkedObject* OrderedIndex::find | ( | unsigned | offset | ) | const |
Find a specific member in the ordered list.
offset | to member to find. |
LinkedObject* OrderedIndex::get | ( | void | ) |
Get (pull) object off the list.
The start of the list is advanced to the next object.
LinkedObject* OrderedIndex::getIndexed | ( | unsigned | index | ) | const [inline] |
Get an indexed member from the ordered index.
index | of member to fetch. |
Definition at line 256 of file linked.h.
LinkedObject** OrderedIndex::index | ( | void | ) | const |
Return a pointer to the head of the list.
This allows the head pointer to be used like a simple root list pointer for pure LinkedObject based objects.
virtual void OrderedIndex::lock_index | ( | void | ) | [virtual] |
Used to synchronize lists managed by multiple threads.
A derived locking method would be invoked.
LinkedObject* OrderedIndex::operator* | ( | ) | const [inline] |
void OrderedIndex::operator*= | ( | OrderedObject * | object | ) |
Add object to our list.
object | to add. |
virtual void OrderedIndex::unlock_index | ( | void | ) | [virtual] |
Used to synchronize lists managed by multiple threads.
A derived unlocking method would be invoked.