Observers
Applications can be notified when the state of a manager changes. This notification mechanism is based on IlvManagerObserver, a subclass of IlvObserver. Observers are created by the application and set on the manager. The manager is in charge of sending messages to the observer under certain circumstances called reasons.
Notification messages are classified by their reason into different categories. An observer can choose to receive messages of one or several categories by setting its interest mask. The manager will only send a message to the observer if the notification reason belongs to a category of the observer interest mask. These categories are shown in Notification Categories:
Category Description |
Mask |
General |
IlvMgrMsgGeneralMask |
Manager view |
IlvMgrMsgViewMask |
Manager layer |
IlvMgrMsgLayerMask |
Manager contents |
IlvMgrMsgContentsMask |
Object geometry |
IlvMgrMsgObjectGeometryMask |
An application wishing to get notification messages must define a subclass of IlvManagerObserver and overload the virtual member function update. In this member function, the observer receives an instance of IlvManagerMessage, or a subclass, containing the reason and additional relevant information about the notification.