Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PINDEX PAbstractList::Insert ( const PObject before,
PObject obj 
) [virtual]

Insert a new object immediately before the specified object. If the object to insert before is not in the collection then the equivalent of the Append()# function is performed.

Note that the object values are compared for the search of the before# parameter, not the pointers. So the objects in the collection must correctly implement the PObject::Compare()# function.

Returns:
index of the newly inserted object.
Parameters:
beforeObject value to insert before.
objNew object to place into the collection.

Implements PCollection.

Definition at line 561 of file collect.cxx.

References GetObjectsIndex(), and InsertAt().

{
  if (PAssertNULL(obj) == NULL)
    return P_MAX_INDEX;
  
  PINDEX where = GetObjectsIndex(&before);
  InsertAt(where, obj);
  return where;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index