|
cocos2d-x
2.2.3-gd2.113-rev1ec524e
|
NA. More...
#include <CCNotificationCenter.h>
Public Member Functions | |
| CCNotificationCenter () | |
| CCNotificationCenter constructor. More... | |
| ~CCNotificationCenter () | |
| CCNotificationCenter destructor. More... | |
| void | addObserver (CCObject *target, SEL_CallFuncO selector, const char *name, CCObject *obj) |
| Adds an observer for the specified target. More... | |
| void | removeObserver (CCObject *target, const char *name) |
| Removes the observer by the specified target and name. More... | |
| int | removeAllObservers (CCObject *target) |
| Removes all notifications registered by this target. More... | |
| void | registerScriptObserver (CCObject *target, int handler, const char *name) |
| Registers one hander for script binding. More... | |
| void | unregisterScriptObserver (CCObject *target, const char *name) |
| Unregisters script observer. More... | |
| void | postNotification (const char *name) |
| Posts one notification event by name. More... | |
| void | postNotification (const char *name, CCObject *object) |
| Posts one notification event by name. More... | |
| int | getScriptHandler () |
| Gets script handler. More... | |
| int | getObserverHandlerByName (const char *name) |
| Gets observer script handler. More... | |
Public Member Functions inherited from CCObject | |
| CCObject (void) | |
| virtual | ~CCObject (void) |
| NA. More... | |
| void | release (void) |
| void | retain (void) |
| CCObject * | autorelease (void) |
| CCObject * | copy (void) |
| bool | isSingleReference (void) const |
| unsigned int | retainCount (void) const |
| virtual bool | isEqual (const CCObject *pObject) |
| virtual void | acceptVisitor (CCDataVisitor &visitor) |
| virtual void | update (float dt) |
| CCObject (const CCObject &) | |
| CCObject & | operator= (const CCObject &) |
| virtual void | encodeWithCoder (DS_Dictionary *) |
| virtual bool | canEncode () |
| CCObjectType | getObjType () const |
| virtual int | getTag () const |
| virtual void | setTag (int nTag) |
| void | setObjType (CCObjectType) |
Public Member Functions inherited from CCCopying | |
| virtual CCObject * | copyWithZone (CCZone *pZone) |
Static Public Member Functions | |
| static CCNotificationCenter * | sharedNotificationCenter (void) |
| Gets the single instance of CCNotificationCenter. More... | |
| static void | purgeNotificationCenter (void) |
| Destroys the single instance of CCNotificationCenter. More... | |
Static Public Member Functions inherited from CCObject | |
| static CCObject * | createWithCoder (DS_Dictionary *) |
Additional Inherited Members | |
Public Attributes inherited from CCObject | |
| unsigned int | m_uID |
| int | m_nLuaID |
Protected Attributes inherited from CCObject | |
| unsigned int | m_uReference |
| unsigned int | m_uAutoReleaseCount |
| int | m_nTag |
| int | m_eObjType |
| unsigned int | m_uObjectIdxInArray |
NA.
CCNotificationCenter constructor.
| ~CCNotificationCenter | ( | ) |
CCNotificationCenter destructor.
| void addObserver | ( | CCObject * | target, |
| SEL_CallFuncO | selector, | ||
| const char * | name, | ||
| CCObject * | obj | ||
| ) |
Adds an observer for the specified target.
| target | The target which wants to observe notification events. |
| selector | The callback function which will be invoked when the specified notification event was posted. |
| name | The name of this notification. |
| obj | The extra parameter which will be passed to the callback function. |
| int getObserverHandlerByName | ( | const char * | name | ) |
Gets observer script handler.
| name | The name of this notification. |
|
inline |
Gets script handler.
| void postNotification | ( | const char * | name | ) |
Posts one notification event by name.
| name | The name of this notification. |
| void postNotification | ( | const char * | name, |
| CCObject * | object | ||
| ) |
Posts one notification event by name.
| name | The name of this notification. |
| object | The extra parameter. |
|
static |
Destroys the single instance of CCNotificationCenter.
| void registerScriptObserver | ( | CCObject * | target, |
| int | handler, | ||
| const char * | name | ||
| ) |
Registers one hander for script binding.
| handler | The lua handler. |
| int removeAllObservers | ( | CCObject * | target | ) |
Removes all notifications registered by this target.
| target | The target of this notification. |
| void removeObserver | ( | CCObject * | target, |
| const char * | name | ||
| ) |
Removes the observer by the specified target and name.
| target | The target of this notification. |
| name | The name of this notification. |
|
static |
Gets the single instance of CCNotificationCenter.
| void unregisterScriptObserver | ( | CCObject * | target, |
| const char * | name | ||
| ) |
Unregisters script observer.