Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

ObjList Class Reference

An object list class. More...

#include <yateclass.h>

Inheritance diagram for ObjList:

GenObject List of all members.

Public Member Functions

 ObjList ()
virtual ~ObjList ()
virtual void * getObject (const String &name) const
unsigned int length () const
unsigned int count () const
GenObjectget () const
GenObjectset (const GenObject *obj, bool delold=true)
ObjListnext () const
ObjListlast () const
ObjListskipNull () const
ObjListskipNext () const
ObjListoperator+ (int index) const
GenObjectoperator[] (int index) const
GenObjectoperator[] (const String &str) const
ObjListfind (const GenObject *obj) const
ObjListfind (const String &str) const
ObjListinsert (const GenObject *obj, bool compact=true)
ObjListappend (const GenObject *obj, bool compact=true)
GenObjectremove (bool delobj=true)
GenObjectremove (GenObject *obj, bool delobj=true)
void clear ()
bool autoDelete ()
void setDelete (bool autodelete)

Detailed Description

An object list class.

A simple single-linked object list handling class


Constructor & Destructor Documentation

ObjList  ) 
 

Creates a new, empty list.

virtual ~ObjList  )  [virtual]
 

Destroys the list and everything in it.


Member Function Documentation

ObjList* append const GenObject obj,
bool  compact = true
 

Append an object to the end of the list

Parameters:
obj Pointer to the object to append
compact True to replace NULL values in list if possible
Returns:
A pointer to the inserted list item

bool autoDelete  )  [inline]
 

Get the automatic delete flag

Returns:
True if will delete on destruct, false otherwise

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

Returns:
Count of items

ObjList* find const String str  )  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* find const GenObject obj  )  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

GenObject* get  )  const [inline]
 

Get the object associated to this list item

Returns:
Pointer to the object or NULL

virtual void* getObject const String name  )  const [virtual]
 

Get a pointer to a derived class given that class name

Parameters:
name Name of the class we are asking for
Returns:
Pointer to the requested class or NULL if this object doesn't implement it

Reimplemented from GenObject.

ObjList* insert const GenObject obj,
bool  compact = true
 

Insert an object at this point

Parameters:
obj Pointer to the object to insert
compact True to replace NULL values in list if possible
Returns:
A pointer to the inserted list item

ObjList* last  )  const
 

Get the last item in the list

Returns:
Pointer to the last item in list

unsigned int length  )  const
 

Get the number of elements in the list

Returns:
Count of items

ObjList* next  )  const [inline]
 

Get the next item in the list

Returns:
Pointer to the next item in list or NULL

ObjList* operator+ int  index  )  const
 

Pointer-like indexing operator

Parameters:
index Index of the list item to retrive
Returns:
Pointer to the list item or NULL

GenObject* operator[] const String str  )  const
 

Array-like indexing operator

Parameters:
str String value of the object to locate
Returns:
Pointer to the object or NULL

GenObject* operator[] int  index  )  const
 

Array-like indexing operator

Parameters:
index Index of the object to retrive
Returns:
Pointer to the object or NULL

GenObject* remove GenObject obj,
bool  delobj = true
 

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

GenObject* remove bool  delobj = true  ) 
 

Delete this list item

Parameters:
delobj True to delete the object (default)
Returns:
Pointer to the object if not destroyed

GenObject* set const GenObject obj,
bool  delold = true
 

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

void setDelete bool  autodelete  )  [inline]
 

Set the automatic delete flag

Parameters:
autodelete True to delete on destruct, false otherwise

ObjList* skipNext  )  const
 

Advance in the list skipping over NULL holding items

Returns:
Pointer to the next non NULL holding item in list or NULL

ObjList* skipNull  )  const
 

Skip over NULL holding items in the list

Returns:
Pointer to the first non NULL holding item in list or NULL


The documentation for this class was generated from the following file:
Generated on Fri Jul 7 03:11:38 2006 for Yate by  doxygen 1.4.4