Sender declares its use of the notification and issues it appropriately

The only interface change to the sender involves documenting for receivers which class of notification will be sent for each interest.

      class TShapeList : public TNotifier {
      public:
          TInterest               GetAddedShapeInterest();   // issues TShapeNotification
          TInterest               GetRemovedShapeInterest(); // issues TShapeNotification
      //  ...
      };
The sender generates a TShapeNotification instead of a TNotification, passing a reference to the new shape. Only the implementation of AdoptShape is shown; the implementation of OrphanShape is similar.

      void TShapeList::AdoptShape(MGraphic* shape)
      {
          fShapes.Add(shape);
          Notify(TShapeNotification(GetAddedShapeInterest(), *shape));
      }

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker