// $Revision: 1.3 $ // Copyright (c) 1994-1995 Taligent, Inc. All Rights Reserved. // Notification Sample 2 #ifndef TaligentSamples_SENDER #include "Sender.h" #endif // ======================================================================================== TSender::TSender() : TNotifier(), fValue(0) { } TSender::~TSender() { } long TSender::GetValue() const { return fValue; } void TSender::IncrementValue() { fValue++; Notify(TNotification(GetValueIncrementedInterest())); } void TSender::DecrementValue() { fValue--; Notify(TNotification(GetValueDecrementedInterest())); } TInterest TSender::GetValueIncrementedInterest() const { static const TToken kValueIncremented("ValueIncremented"); // Cast away const. return TInterest((TNotifier*)this, kValueIncremented); } TInterest TSender::GetValueDecrementedInterest() const { static const TToken kValueDecremented("ValueDecremented"); // Cast away const. return TInterest((TNotifier*)this, kValueDecremented); }