|
Yate
|
An object list class. More...
#include <yateclass.h>
Public Member Functions | |
| ObjList () | |
| virtual | ~ObjList () |
| virtual void * | getObject (const String &name) const |
| unsigned int | length () const |
| unsigned int | count () const |
| GenObject * | get () const |
| GenObject * | set (const GenObject *obj, bool delold=true) |
| ObjList * | next () const |
| ObjList * | last () const |
| ObjList * | skipNull () const |
| ObjList * | skipNext () const |
| GenObject * | at (int index) const |
| ObjList * | operator+ (int index) const |
| GenObject * | operator[] (signed int index) const |
| GenObject * | operator[] (unsigned int index) const |
| GenObject * | operator[] (const String &str) const |
| ObjList * | find (const GenObject *obj) const |
| ObjList * | find (const String &str) const |
| int | index (const GenObject *obj) const |
| int | index (const String &str) const |
| ObjList * | insert (const GenObject *obj, bool compact=true) |
| ObjList * | append (const GenObject *obj, bool compact=true) |
| GenObject * | remove (bool delobj=true) |
| GenObject * | remove (GenObject *obj, bool delobj=true) |
| GenObject * | remove (const String &str, bool delobj=true) |
| void | clear () |
| bool | autoDelete () |
| void | setDelete (bool autodelete) |
Static Public Member Functions | |
| static const ObjList & | empty () |
An object list class.
A simple single-linked object list handling class
| ObjList | ( | ) |
Creates a new, empty list.
| virtual ~ObjList | ( | ) | [virtual] |
Destroys the list and everything in it.
Append an object to the end of the list
| obj | Pointer to the object to append |
| compact | True to replace NULL values in list if possible |
Referenced by MimeLinesBody::addLine(), MimeSdpBody::addLine(), MimeMultipartBody::appendBody(), MimeBody::appendHdr(), and JGSession::sendContent().
| GenObject* at | ( | int | index | ) | const |
Get the object at a specific index in list
| index | Index of the object to retrive |
| bool autoDelete | ( | ) | [inline] |
Get the automatic delete flag
| void clear | ( | ) |
Clear the list and optionally delete all contained objects
| unsigned int count | ( | ) | const |
Get the number of non-null objects in the list
| static const ObjList& empty | ( | ) | [static] |
A static empty object list
Get the item in the list that holds an object
| obj | Pointer to the object to search for |
| GenObject* get | ( | ) | const [inline] |
Get the object associated to this list item
Referenced by JIDResourceList::getFirst(), and JBStream::lastEvent().
| virtual void* getObject | ( | const String & | name | ) | const [virtual] |
Get a pointer to a derived class given that class name
| name | Name of the class we are asking for |
Reimplemented from GenObject.
| int index | ( | const GenObject * | obj | ) | const |
Get the position in list of a GenObject by a pointer to it
| obj | Pointer to the object to search for |
| int index | ( | const String & | str | ) | const |
Insert an object at this point
| obj | Pointer to the object to insert |
| compact | True to replace NULL values in list if possible |
| ObjList* last | ( | ) | const |
Get the last item in the list
Referenced by JBStream::lastEvent().
| unsigned int length | ( | ) | const |
Get the number of elements in the list
| ObjList* next | ( | ) | const [inline] |
Get the next item in the list
| ObjList* operator+ | ( | int | index | ) | const |
Pointer-like indexing operator
| index | Index of the list item to retrive |
| GenObject* operator[] | ( | signed int | index | ) | const [inline] |
Array-like indexing operator with signed parameter
| index | Index of the object to retrive |
| GenObject* operator[] | ( | unsigned int | index | ) | const [inline] |
Array-like indexing operator with unsigned parameter
| index | Index of the object to retrive |
Array-like indexing operator
| str | String value of the object to locate |
Delete the first list item that holds an object with a iven value
| str | String value (toString) of the object to remove |
| delobj | True to delete the object (default) |
Delete the list item that holds a given object
| obj | Object to search in the list |
| delobj | True to delete the object (default) |
| GenObject* remove | ( | bool | delobj = true | ) |
Delete this list item
| delobj | True to delete the object (default) |
Referenced by MimeMultipartBody::removeBody(), and MimeBody::removeHdr().
Set the object associated to this list item
| obj | Pointer to the new object to set |
| delold | True to delete the old object (default) |
| void setDelete | ( | bool | autodelete | ) | [inline] |
Set the automatic delete flag
| autodelete | True to delete on destruct, false otherwise |
Referenced by JGSession::sendContent().
| ObjList* skipNext | ( | ) | const |
Advance in the list skipping over NULL holding items
| ObjList* skipNull | ( | ) | const |
Skip over NULL holding items in the list
Referenced by JIDResourceList::getFirst().
1.7.3