|
|
A simple single-linked object list handling class
ObjList ()
| ObjList |
Creates a new, empty list.
~ObjList ()
| ~ObjList |
[virtual]
Destroys the list and everything in it.
unsigned int length ()
| length |
[const]
Get the number of elements in the list
Returns: Count of items
unsigned int count ()
| count |
[const]
Get the number of non-null objects in the list
Returns: Count of items
inline GenObject * get ()
| get |
[const]
Get the object associated to this list item
Returns: Pointer to the object or NULL
GenObject * set (const GenObject *obj, bool delold = true)
| set |
Set the object associated to this list item
Parameters:
obj | Pointer to the new object to set |
delold | True to delete the old object (default) |
Returns: Pointer to the old object if not destroyed
inline ObjList * next ()
| next |
[const]
Get the next item in the list
Returns: Pointer to the next item in list or NULL
ObjList * last ()
| last |
[const]
Get the last item in the list
Returns: Pointer to the last item in list
ObjList * operator[] (int index)
| operator[] |
[const]
Indexing operator
Parameters:
index | Index of the item to retrive |
Returns: Pointer to the item or NULL
ObjList * find (const GenObject *obj)
| find |
[const]
Get the item in the list that holds an object
Parameters:
obj | Pointer to the object to search for |
Returns: Pointer to the found item or NULL
ObjList * find (const String &str)
| find |
[const]
Get the item in the list that holds an object by String value
Parameters:
str | String value (toString) of the object to search for |
Returns: Pointer to the found item or NULL
ObjList * insert (const GenObject *obj)
| insert |
Insert an object at this point
Parameters:
obj | Pointer to the object to insert |
Returns: A pointer to the inserted list item
ObjList * append (const GenObject *obj)
| append |
Append an object to the end of the list
Parameters:
obj | Pointer to the object to append |
Returns: A pointer to the inserted list item
GenObject * remove (bool delobj = true)
| remove |
Delete this list item
Parameters:
delold | True to delete the object (default) |
Returns: Pointer to the object if not destroyed
GenObject * remove (GenObject *obj, bool delobj = true)
| remove |
Delete the list item that holds a given object
Parameters:
obj | Object to search in the list |
delobj | True to delete the object (default) |
Returns: Pointer to the object if not destroyed
void clear ()
| clear |
Clear the list and optionally delete all contained objects
inline bool autoDelete ()
| autoDelete |
Get the automatic delete flag
Returns: True if will delete on destruct, false otherwise
inline void setDelete (bool autodelete)
| setDelete |
Set the automatic delete flag
Parameters:
autodelete | True to delete on destruct, false otherwise |
Generated by: kk on nyx on Sat Jun 4 19:29:41 2005, using kdoc 2.0a54. |