class ObjList

An object list class. More...

Full nameTelEngine::ObjList
Definition#include <yateclass.h>
InheritsTelEngine::GenObject [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

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.

void*  getObject (const String& name)

getObject

[const virtual]

Get a pointer to a derived class given that class name

Parameters:
nameName 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.

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:
objPointer to the new object to set
deloldTrue 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*  skipNull ()

skipNull

[const]

Skip over NULL holding items in the list

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

ObjList*  skipNext ()

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*  operator+ (int index)

operator+

[const]

Pointer-like indexing operator

Parameters:
indexIndex of the list item to retrive

Returns: Pointer to the list item or NULL

GenObject*  operator[] (int index)

operator[]

[const]

Array-like indexing operator

Parameters:
indexIndex of the object to retrive

Returns: Pointer to the object or NULL

GenObject*  operator[] (const String& str)

operator[]

[const]

Array-like indexing operator

Parameters:
strString value of the object to locate

Returns: Pointer to the object or NULL

ObjList*  find (const GenObject* obj)

find

[const]

Get the item in the list that holds an object

Parameters:
objPointer 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:
strString value (toString) of the object to search for

Returns: Pointer to the found item or NULL

ObjList*  insert (const GenObject* obj, bool compact = true)

insert

Insert an object at this point

Parameters:
objPointer to the object to insert
compactTrue to replace NULL values in list if possible

Returns: A pointer to the inserted list item

ObjList*  append (const GenObject* obj, bool compact = true)

append

Append an object to the end of the list

Parameters:
objPointer to the object to append
compactTrue to replace NULL values in list if possible

Returns: A pointer to the inserted list item

GenObject*  remove (bool delobj = true)

remove

Delete this list item

Parameters:
delobjTrue 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:
objObject to search in the list
delobjTrue 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:
autodeleteTrue to delete on destruct, false otherwise


Generated by: root on dragoshel on Sat Apr 14 01:50:50 2007, using kdoc 2.0a54.