30 virtual ~NotifierAccess();
32 void notify(
const CallBack&,
bool first=
false)
const;
33 bool notifyIfNotNotified(
const CallBack&)
const;
36 bool removeWith(
const CallBacker*,
bool wait=
true)
const;
38 void transferCBSTo(
const NotifierAccess&,
41 inline bool isEnabled()
const {
return !cbs_.hasAnyDisabled(); }
42 inline void enable(
bool yn=
true ) {
return cbs_.disableAll(!yn); }
43 inline void disable() {
return cbs_.disableAll(
true); }
45 inline bool isEmpty()
const {
return cbs_.isEmpty(); }
54 bool isShutdownSubscribed(
const CallBacker*)
const;
60 void addShutdownSubscription(
const CallBacker*)
const;
61 bool removeShutdownSubscription(
const CallBacker*,
129 {
if ( !cbs_.isEmpty() ) doTrigger( cbs_, cber_ ); }
131 {
if ( !cbs_.isEmpty() ) doTrigger( cbs_, &t ); }
133 {
if ( !cbs_.isEmpty() ) doTrigger( cbs_, c ); }
138 #define mAttachObjCB( objptr, notifier, func, chk ) \ 139 attachCB( notifier, CallBack( objptr, mCBFn(func) ), chk ) 140 #define mDetachObjCB( objptr, notifier, func ) \ 141 detachCB( notifier, CallBack( objptr, mCBFn(func) ) ) 143 #define mAttachCB( notifier, func ) \ 144 mAttachObjCB( this, notifier, func, false ) 146 #define mAttachCBIfNotAttached( notifier, func ) \ 147 mAttachObjCB( this, notifier, func, true ) 149 #define mDetachCB( notifier, func ) \ 150 mDetachObjCB( this, notifier, func ) 165 template <
class T,
class PayLoad>
174 doTrigger( cbs_, &caps );
184 doTrigger( cbs_, &caps );
218 void enableNotification();
219 void disableNotification();
227 void setDisabled(
bool);
235 #define mDeclInstanceCreatedNotifierAccess(clss) \ 236 static Notifier<clss>& instanceCreated() 238 #define mDefineInstanceCreatedNotifierAccess(clss) \ 239 Notifier<clss>& clss::instanceCreated() \ 241 mDefineStaticLocalObject( Notifier<clss>, theNotif, (0)); \ 245 #define mTriggerInstanceCreatedNotifier() \ 246 instanceCreated().trigger( this ) #define mExpClass(module)
Definition: commondefs.h:157
Capsule class to wrap any class into a CallBacker.
Definition: callback.h:257
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
Temporarily disables a Notifier.
Definition: notify.h:212
bool isEmpty() const
Definition: notify.h:45
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:51
NotifierAccess & thenotif_
Definition: notify.h:223
Interface class for Notifier. See comments there.
Definition: notify.h:20
Threads::Lock shutdownsubscriberlock_
Definition: notify.h:67
void trigger()
Definition: notify.h:128
void trigger(PayLoad pl)
Definition: notify.h:171
void disable()
Definition: notify.h:43
friend class NotifierAccess
Definition: callback.h:184
const CallBacker * onlyfor_
Definition: notify.h:225
void trigger(CallBacker *c)
Definition: notify.h:132
Class to help setup a callback handling.
Definition: notify.h:121
void enable(bool yn=true)
Definition: notify.h:42
void trigger(T &t)
Definition: notify.h:130
CNotifier(T *cb)
Definition: notify.h:169
void trigger(PayLoad pl, T &t)
Definition: notify.h:187
bool isEnabled() const
Definition: notify.h:41
Notifier(T *c)
Definition: notify.h:126
TypeSet of CallBacks with a few extras.
Definition: callback.h:149
Notifier with automatic capsule creation.
Definition: notify.h:166
CallBackSet & cbs_
Definition: notify.h:51
ObjectSet< const CallBacker > shutdownsubscribers_
Definition: notify.h:66
#define mClass(module)
Definition: commondefs.h:161
bool isdisabled_
Definition: notify.h:224
void trigger(PayLoad pl, CallBacker *cb)
Definition: notify.h:177
CallBacks object-oriented (object + method).
Definition: callback.h:62
CallBacker * cber_
Definition: notify.h:52