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

Change language: German

XmObjectList Class Reference

Inheritance diagram for XmObjectList:

XmArray TXmObjectList TXmObjectListObject List of all members.

Detailed Description

List based container with XmArray interface managing references to classes 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 hash list.

If you want to create a container holding items of a specialized class derived from XmObject you should create the container via TXmObjectList, to ensure type safe item handling.


Public Types

typedef XmObjectListBox box
 Small box including a reference to the enclosed object and its index.
typedef XmObjectListIterator iterator
 Iterator for processing forward or backward through the items of an XmObjectList.

Public Member Functions

int size () const
 Return number of items.
boxfront () const
 Return a reference to the first object box.
boxback () const
 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 (XmObject *obj)
 Push an object to the front of the list.
void push_back (XmObject *obj)
 Push an object to the back of the list.
void insert (iterator before, XmObject *obj)
 Insert an object in front of the specified iterator.
void erase (iterator i)
 Delete the specified object.
XmObjectExculdeObject (iterator i)
 Remove the given item without the deleting the attached object.
void clear ()
 Delete all items of the container.
void swap (XmObjectList &list)
 Swap the items of two lists in constant time.
boxFindObjBox (int index) const
 Return the object box with the specified index.
Overridables
virtual XmObjectCreateListObject (const XmObjectID &ID)
 Should be overriden by application to create an object depending on the given ID.
Overridables - XmArray
void manageItems (XmMan &m)
 Implement the handling and iteration for the different XmMan derivations.
XmObjectObjectAtIndex (int index) const
 Supply the item with index, if available.
void DeleteArrItem (int index)
 Delete item with the given index.
int MoveArrItem (int index, int offset)
 Move the item with given index at offset positions.
bool MoveArrItemEnable (int index, int offset)
 Check, if it is possible to move the given item.
void ClearArray ()
 Delete all items of the container.
void AppendNewItem (XmAppendCx &ac)
 Append an item to the container.
void ArrayProp (XmArrayProp &ap) const
 Set general array properties.


Member Function Documentation

XmObject* ExculdeObject iterator  i  ) 
 

Remove the given item without the deleting the attached object.

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

Reimplemented in TXmObjectList.

box* FindObjBox int  index  )  const
 

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 in TXmObjectList.

void manageItems XmMan m  )  [virtual]
 

Implement the handling and iteration for the different XmMan derivations.

see TXmObjectVectorObject, how to implement this member function.

Implements XmArray.


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