 |
OpendTect
6.6
|
Go to the documentation of this file.
33 inline bool isEmpty()
const {
return cbs_.isEmpty(); }
35 inline bool isEnabled()
const {
return !cbs_.hasAnyDisabled(); }
36 inline void enable(
bool yn=
true ){ cbs_.disableAll(!yn); }
37 inline void disable() { cbs_.disableAll(
true); }
133 {
if ( !cbs_.isEmpty() ) doTrigger( cbs_, cber_ ); }
135 {
if ( !cbs_.isEmpty() ) doTrigger( cbs_, &t ); }
137 {
if ( !cbs_.isEmpty() ) doTrigger( cbs_, c ); }
142 #define mAttachObjCB( objptr, notifier, func, chk ) \
143 attachCB( notifier, CallBack( objptr, mCBFn(func) ), chk )
144 #define mDetachObjCB( objptr, notifier, func ) \
145 detachCB( notifier, CallBack( objptr, mCBFn(func) ) )
147 #define mAttachCB( notifier, func ) \
148 mAttachObjCB( this, notifier, func, false )
150 #define mAttachCBIfNotAttached( notifier, func ) \
151 mAttachObjCB( this, notifier, func, true )
153 #define mDetachCB( notifier, func ) \
154 mDetachObjCB( this, notifier, func )
169 template <
class T,
class PayLoad>
178 doTrigger( cbs_, &caps );
188 doTrigger( cbs_, &caps );
236 { enableNotification(); }
238 { enableNotification(); }
240 { disableNotification(); }
248 #define mDeclInstanceCreatedNotifierAccess(clss) \
249 static Notifier<clss>& instanceCreated()
251 #define mDefineInstanceCreatedNotifierAccess(clss) \
252 Notifier<clss>& clss::instanceCreated() \
254 mDefineStaticLocalObject( Notifier<clss>, theNotif, (0)); \
258 #define mTriggerInstanceCreatedNotifier() \
259 instanceCreated().trigger( this )
virtual ~NotifierAccess()
bool isEmpty() const
Definition: notify.h:33
void trigger()
Definition: notify.h:132
bool removeShutdownSubscription(const CallBacker *, bool wait) const
bool isEnabled() const
Definition: notify.h:35
void disable()
Definition: notify.h:37
Notifier(T *c)
Definition: notify.h:130
bool removeWith(const CallBacker *, bool wait=true) const
CallBackSet & cbs_
Definition: notify.h:53
#define mExpClass(module)
Definition: commondefs.h:177
TypeSet of CallBacks with a few extras.
Definition: callback.h:152
void trigger(CallBacker *c)
Definition: notify.h:136
CallBacker * cber_
Definition: notify.h:54
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:185
static void doTrigger(CallBackSet &, const CallBacker *)
bool isdisabled_
Definition: notify.h:228
bool notifyIfNotNotified(const CallBack &) const
void addShutdownSubscription(const CallBacker *) const
CallBacks object-oriented (object + method).
Definition: callback.h:62
void remove(const CallBack &) const
void enableNotification()
Threads::Lock shutdownsubscriberlock_
Definition: notify.h:66
NotifyStopper(NotifierAccess &, const CallBacker *only_for=0)
void trigger(T &t)
Definition: notify.h:134
bool willCall(const CallBacker *) const
Interface class for Notifier. See comments there.
Definition: notify.h:22
#define mClass(module)
Definition: commondefs.h:181
#define mDeprecated(msg)
Definition: plfdefs.h:215
void trigger(PayLoad pl, CallBacker *cb)
Definition: notify.h:181
Class to help setup a callback handling.
Definition: notify.h:126
void trigger(PayLoad pl)
Definition: notify.h:175
void enable(bool yn=true)
Definition: notify.h:36
Temporarily disables a Notifier.
Definition: notify.h:217
bool isShutdownSubscribed(const CallBacker *) const
Only for debugging purposes, don't use.
void trigger(PayLoad pl, T &t)
Definition: notify.h:191
ObjectSet< const CallBacker > shutdownsubscribers_
Definition: notify.h:65
void transferCBSTo(const NotifierAccess &, const CallBacker *only_for, const CallBacker *not_for=0) const
void disableNotification()
NotifierAccess & thenotif_
Definition: notify.h:227
const CallBacker * onlyfor_
Definition: notify.h:229
CNotifier(T *cb)
Definition: notify.h:173
Capsule class to wrap any class into a CallBacker.
Definition: callback.h:255
void setEmpty()
Definition: notify.h:34
NotifierAccess(const NotifierAccess &)
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class.
Definition: threadlock.h:53
void notify(const CallBack &, bool first=false) const
Notifier with automatic capsule creation.
Definition: notify.h:171
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021