holder object for observer logic, see ZFObject::observerNotify More...
#include <ZFObjectObserver.h>
Public Member Functions | |
| void | observerAdd (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal) |
| see ZFObject::observerNotify | |
| void | observerAddForOnce (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal) |
| see ZFObject::observerNotify | |
| void | observerRemove (zfidentity eventId, const ZFListener &callback) |
| see ZFObject::observerNotify | |
| void | observerRemoveAll (zfidentity eventId) |
| see ZFObject::observerNotify | |
| void | observerRemoveAll (void) |
| see ZFObject::observerNotify | |
| zfbool | observerHasAdd (void) const |
| see ZFObject::observerNotify | |
| zfbool | observerHasAdd (zfidentity eventId) const |
| see ZFObject::observerNotify | |
| void | observerNotify (zfidentity eventId, const ZFArgs &zfargs=ZFArgs()) const |
| see ZFObject::observerNotify | |
| void | observerNotifyWithSender (ZFObject *customSender, zfidentity eventId, const ZFArgs &zfargs=ZFArgs()) const |
| see ZFObject::observerNotify | |
| void | observerNotifyReversely (zfidentity eventId, const ZFArgs &zfargs=ZFArgs()) const |
| see ZFObject::observerNotify | |
| void | observerNotifyReverselyWithSender (ZFObject *customSender, zfidentity eventId, const ZFArgs &zfargs=ZFArgs()) const |
| see ZFObject::observerNotify | |
| void | on (const zfstring &eventName, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal) |
| util to observerAdd | |
| void | on (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal) |
| util to observerAdd | |
| void | observerHasAddStateAttach (zfidentity eventId, zfuint *flag, zfuint flagBit) |
| attach a state that indicate whether the observer has add, for performance usage | |
| void | observerHasAddStateDetach (zfidentity eventId, zfuint *flag, zfuint flagBit) |
| see observerHasAddStateAttach | |
| void | objectInfoT (zfstring &ret) const |
| see objectInfo | |
| zfstring | objectInfo (void) const |
| return a short string describe the object | |
| zfany | observerOwner (void) const |
| owner object of this observer holder, or null if none | |
Static Public Member Functions | |
| static void | forwardOnAdd (ZFObject *owner, zfidentity eventId) |
| explicitly forward ZFObject::observerOnAdd to specified owner | |
| static void | forwardOnRemove (ZFObject *owner, zfidentity eventId) |
| see forwardOnAdd | |
| static void | forwardOnEvent (ZFObject *owner, const ZFArgs &zfargs) |
| see forwardOnAdd | |
holder object for observer logic, see ZFObject::observerNotify
| void ZFObserver::observerHasAddStateAttach | ( | zfidentity | eventId, |
| zfuint * | flag, | ||
| zfuint | flagBit ) |
attach a state that indicate whether the observer has add, for performance usage
notifying an observer requires much CPU to check and execute, even if no observer has ever added
to optimize this, you may attach a flag to indicate whether any observer has ever added
usage:
|
static |
explicitly forward ZFObject::observerOnAdd to specified owner
ZFObject::observerOnAdd won't be called for ZFCLASS_EXTEND, you may use this method to explicitly forward event dispatch