ZFFramework
|
observer types for ZFObject More...
Go to the source code of this file.
Classes | |
class | ZFListener |
listener as ZFCallback, mostly used by ZFObject::observerNotify More... | |
class | ZFObserver |
holder object for observer logic, see ZFObject::observerNotify More... | |
Macros | |
#define | ZFEVENT(YourEvent) |
see ZFObject::observerNotify | |
#define | ZFEVENT_INLINE(YourEvent) |
see ZFEVENT | |
#define | ZFEVENT_REGISTER(YourClass, YourEvent) |
see ZFEVENT | |
#define | ZFEVENT_GLOBAL(YourEvent) |
declare a observer event in global scope, see ZFEVENT | |
#define | ZFEVENT_GLOBAL_REGISTER(YourEvent) |
see ZFEVENT | |
Functions | |
ZFObserver & | ZFGlobalObserver (void) |
all event notified by ZFObject::observerNotify would also be notified to the observers added by this method, see ZFObject::observerNotify | |
const zfchar * | ZFEventNameForId (zfidentity idValue) |
get id name from id value, or null if no such id, see ZFEventIdForName | |
zfidentity | ZFEventIdForName (const zfchar *idName) |
get id value from id name, or zfidentityInvalid if no such id name | |
zfidentity | ZFEventDynamicRegister (const zfchar *idName) |
dynamically register your own id | |
void | ZFEventDynamicUnregister (zfidentity idValue) |
unregister id that was registered by ZFEventDynamicRegister | |
observer types for ZFObject
#define ZFEVENT | ( | YourEvent | ) |
usage:
declare a event for ZFObject's observer logic, declared event name can be accessed by:
note that subclass may declare a event same as parent, while the final event name is different:
ParentClass::EventYourEvent() => "ParentClass.EventYourEvent"
ChildClass::EventYourEvent() => "ChildClass.EventYourEvent"
#define ZFEVENT_GLOBAL | ( | YourEvent | ) |
declare a observer event in global scope, see ZFEVENT
usage:
unlike ZFEVENT, this macro would declare event outside of class scope, typically you should use ZFEVENT_GLOBAL which have "ZFGlobalEvent" as namespace
|
extern |
all event notified by ZFObject::observerNotify would also be notified to the observers added by this method, see ZFObject::observerNotify
use only if necessary, which may cause performance issue
|
inline |
get id value from id name, or zfidentityInvalid if no such id name
the id name should looks like YourClass.EventYourIdName
or YourNamespace.EventYourIdName
note: can be found only if:
|
inline |
dynamically register your own id
assert fail if already registered
|
inline |
unregister id that was registered by ZFEventDynamicRegister
do nothing if no such id, assert fail if the id is not dynamically registered