Home You are here: Home > Support > Reference v1.0

Change language: German

TXmObjectList Class Template Reference

Inheritance diagram for TXmObjectList:

XmObjectList XmArray TXmObjectListObject List of all members.

Detailed Description

template<class C>
class exom::TXmObjectList< C >

List based container with XmArray interface managing references to classes of type C derived from XmObject.

In opposite to a vector, this container provide the possibility to hold different derivations of XmObject. Via an iterator you can iterate forward and backward through this list.

Additional to a normal list, this container provide also the possibility to attach items to an index and access them via this index. The access via an index will mostly be done in constant time, because of using a hast list.

In contrast to XmObjectList, this container provide increased type safty in handling and iterating its items.


Public Types

typedef TXmObjectListBox< C > box
 Small box including a reference to the enclosed object and its index.
typedef TXmObjectListIterator<
C > 
iterator
 Iterator for processing forward or backward through the items of an TXmObjectList.

Public Member Functions

int size () const
 Return number of items.
boxfront () const
 Return a reference to the first object box.
boxback ()
 Return a reference to the last object box.
iterator begin () const
 Return an iterator referencing the first element.
iterator end () const
 Return an iterator pointing behind the last element.
void push_front (C *obj)
 Push an object to the front of the list.
void push_back (C *obj)
 Push an object to the back of the list.
void insert (iterator before, C *obj)
 Insert an object in front of the specified iterator.
void erase (iterator i)
 Delete the specified object.
C * ExculdeObject (iterator i)
 Remove the given item without the deleting the attached object.
void clear ()
 Delete all items of the container.
void swap (TXmObjectList &list)
 Swap the items of two lists in constant time.
boxFindObjBox (int index) const
 Return the object box with the specified index.


Member Function Documentation

C* ExculdeObject iterator  i  )  [inline]
 

Remove the given item without the deleting the attached object.

Returns:
Removed object: have to be deleted by application.

Reimplemented from XmObjectList.

box* FindObjBox int  index  )  const [inline]
 

Return the object box with the specified index.

An object box can be safely converted into the iterator ::XmObjectListIterator.

Returns:
Objext box, if exists. Otherwise NULL.

Reimplemented from XmObjectList.


Copyright © 2006 Praetz Software Development - www.exomware.com