A template for ordered index of typed name key mapped objects.
More...
#include <linked.h>
Public Member Functions |
T * | begin (void) |
| Return first item in ordered list.
|
T * | create (char *name) |
| Create a new typed named object with default constructor.
|
T * | end (void) |
| Return last item in ordered list.
|
T * | find (char *name) |
| Find a specific object by name.
|
T ** | index (void) |
| Convert our linked list into a linear object pointer array.
|
T * | next (LinkedObject *current) |
| Iterate next object in list.
|
T * | offset (unsigned offset) |
T & | operator[] (unsigned offset) |
| Retrieve a specific object by position in list.
|
T & | operator[] (char *name) |
NamedObject ** | root (void) |
| Return a root node pointer to use in NamedObject constructors.
|
T ** | sort (void) |
| Convert our linked list into an alphabetically sorted linear object pointer array.
|
void | add (OrderedObject *ordered) |
| Add an object into the ordered index.
|
unsigned | count (void) |
| Count of objects this list manages.
|
LinkedObject * | find (unsigned offset) |
| Find a specific member in the ordered list.
|
LinkedObject * | get (void) |
| Get (pull) object off the list.
|
LinkedObject * | getIndexed (unsigned index) |
| Get an indexed member from the ordered index.
|
virtual void | lock_index (void) |
| Used to synchronize lists managed by multiple threads.
|
LinkedObject * | operator* () |
| 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.
|
Detailed Description
template<class T>
class ucommon::keylist< T >
A template for ordered index of typed name key mapped objects.
This is used to hold an iterable linked list of typed named objects where we can find objects by their name as well as through iteration.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 1838 of file linked.h.
Member Function Documentation
Return first item in ordered list.
This is commonly used to iterate the list.
- Returns
- first item in list or NULL if empty.
Reimplemented from ucommon::OrderedIndex.
Definition at line 1853 of file linked.h.
Create a new typed named object with default constructor.
This creates a new object which can be deleted.
- Parameters
-
- Returns
- typed named object.
Definition at line 1870 of file linked.h.
Return last item in ordered list.
This is commonly used to determine end of list iteration.
- Returns
- last item in list or NULL if empty.
Reimplemented from ucommon::OrderedIndex.
Definition at line 1861 of file linked.h.
Find a specific object by name.
- Parameters
-
- Returns
- type named object that matches or NULL if not found.
Definition at line 1886 of file linked.h.
Convert our linked list into a linear object pointer array.
The object pointer array is created from the heap and must be deleted when no longer used.
- Returns
- array of typed named object pointers.
Reimplemented from ucommon::OrderedIndex.
Definition at line 1909 of file linked.h.
Iterate next object in list.
- Parameters
-
current | object we are referencing. |
- Returns
- next logical object in linked list or NULL if end.
Definition at line 1878 of file linked.h.
Retrieve a specific object by position in list.
- Parameters
-
offset | in list for object we want. |
- Returns
- type named object or NULL if past end of list.
Definition at line 1897 of file linked.h.
Return a root node pointer to use in NamedObject constructors.
- Returns
- pointer to index root.
Definition at line 1845 of file linked.h.
Convert our linked list into an alphabetically sorted linear object pointer array.
The object pointer array is created from the heap and must be deleted when no longer used.
- Returns
- array of typed named object pointers.
Definition at line 1918 of file linked.h.
The documentation for this class was generated from the following file: