// $Revision: 1.3 $ // Copyright (c) 1994-1995 Taligent, Inc. All Rights Reserved. // Notification sample 2 #ifndef TaligentSamples_RECEIVER #include "Receiver.h" #endif #ifndef Taligent_ASSERTIONS #include #endif #ifndef TaligentSamples_LONGNOTIFICATION #include "LongNotification.h" #endif // ======================================================================================== VersionDefinitionsMacro(TReceiver, kOriginalVersion); TReceiver::TReceiver(TSender* sender) : fSender(sender), fConnection(this, &TReceiver::HandleValueChanged) { Assertion(fSender != NIL, "Must have sender."); fConnection.AddInterest(fSender->GetValueChangedInterest()); fConnection.Connect(); } TReceiver::~TReceiver() { } void TReceiver::HandleValueChanged(const TNotification& notification) { TLongNotification* longNotification = (TLongNotification*)¬ification; qprintf("Value changed from: %d to: %d\n", longNotification->GetValue(), fSender->GetValue()); }