26 #define DtDECLARE_OBSERVER_NOTIFIER(ClassName) \
27 class DT_DLL_VLUTIL DtObservee; \
28 class DT_DLL_VLUTIL ClassName##Notifier : public DtAbsNotifyObserver \
32 ClassName##Notifier(ClassName* observer); \
34 virtual ~ClassName##Notifier(); \
36 ClassName##Notifier(const ClassName##Notifier& orig); \
38 ClassName##Notifier& operator=(const ClassName##Notifier& orig); \
40 virtual bool notifyFromObserved(DtObservee* observed, \
41 const DtObservee::DtWhyNotifyObserver& why); \
45 ClassName* myObjectToNotify; \
56 #define DtDEFINE_OBSERVER_NOTIFIER(ClassName) \
57 ClassName##Notifier::ClassName##Notifier(ClassName* observer) : \
58 DtAbsNotifyObserver(), \
59 myObjectToNotify(observer) \
63 ClassName##Notifier::~ClassName##Notifier() \
67 ClassName##Notifier::ClassName##Notifier( \
68 const ClassName##Notifier& orig) : \
69 DtAbsNotifyObserver(orig), \
70 myObjectToNotify(orig.myObjectToNotify) \
74 ClassName##Notifier& ClassName##Notifier::operator=( \
75 const ClassName##Notifier& orig) \
82 DtAbsNotifyObserver::operator=(orig); \
84 myObjectToNotify = orig.myObjectToNotify; \
89 bool ClassName##Notifier::notifyFromObserved( \
90 DtObservee* observed, \
91 const DtObservee::DtWhyNotifyObserver& why) \
93 if (!myObjectToNotify) \
98 myObjectToNotify->notifyFromYourObserved(observed, why); \
This file declares DtAbsNotifyObserver.