The Collection Classes include special classes that support notifications. For every concrete flat collection class (for example ISequence), there is a corresponding notification-enabled collection class (for example IVSequence).
All collection methods that modify a collection send notifications to observers. The class IVCollection defines four notification IDs for collection classes:
For notifications addId, removeId and replaceId, you can use INotificationEvent::eventData to access event data generated by collections. This event data is an object that includes a cursor method to access a collection cursor. The cursor points to the element referred to by the modification method. For example, if addId is the notification, the cursor points to the added element. The replaceId notification also gives you access to a copy of the element that was replaced.
Collection notifications addId, removeId and replaceId pass a pointer to the class IVCollectionEventData.
For the notifications addId and modifyId, the library sends notification after the modification occurs. For the notification removedId and replaceId the library sends notification before the collection is changed, otherwise you would not be able to use the cursor to refer to the element being removed.
Notifications are only sent if the collection is changed by the method. The following methods do not create a notification:
Introduction to the
Collection Classes
Adding Elements
Removing
Elements
Replacing
Elements
Adding an
Element to a Collection
Removing an
Element from a Collection
Using
Cursors to Locate and Access Elements
Using
Cursors to Iterate Over a Collection
Using
allElementsDo and Applicators to Iterate Over a Collection
Instantiating
the Collection Classes