#include <CCNotificationCenter.h>
Public Member Functions | |
__NotificationCenter () | |
__NotificationCenter constructor More... | |
ctor () | |
__NotificationCenter constructor More... | |
__NotificationCenter () | |
__NotificationCenter constructor More... | |
~__NotificationCenter () | |
__NotificationCenter destructor More... | |
void | addObserver (Object *target, SEL_CallFuncO selector, const std::string &name, Object *sender) |
Adds an observer for the specified target. More... | |
void | removeObserver (Object *target, const std::string &name) |
Removes the observer by the specified target and name. More... | |
int | removeAllObservers (Object *target) |
Removes all notifications registered by this target. More... | |
void | registerScriptObserver (Object *target, int handler, const std::string &name) |
Registers one hander for script binding. More... | |
var | registerScriptObserver ( var target, var handler, var name) |
Registers one hander for script binding. More... | |
local | registerScriptObserver ( local target, local handler, local name) |
Registers one hander for script binding. More... | |
void | unregisterScriptObserver (Object *target, const std::string &name) |
Unregisters script observer. More... | |
void | postNotification (const std::string &name) |
Posts one notification event by name. More... | |
var | postNotification ( var name) |
Posts one notification event by name. More... | |
local | postNotification ( local name) |
Posts one notification event by name. More... | |
void | postNotification (const std::string &name, Object *sender) |
Posts one notification event by name. More... | |
int | getScriptHandler () const |
Gets script handler. More... | |
int | getObserverHandlerByName (const std::string &name) |
Gets observer script handler. More... | |
![]() | |
Object () | |
Constructor. More... | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
void | release () |
Release the ownership immediately. More... | |
void | retain () |
Retains the ownership. More... | |
Object * | autorelease () |
Release the ownership sometime soon automatically. More... | |
bool | isSingleReference () const |
Returns a boolean value that indicates whether there is only one reference to the object. More... | |
unsigned int | retainCount () const |
Returns the object's current reference count. More... | |
local | retainCount () |
Returns the object's current reference count. More... | |
virtual bool | isEqual (const Object *object) |
Returns a boolean value that indicates whether this object and a given object are equal. More... | |
virtual void | acceptVisitor (DataVisitor &visitor) |
virtual void | update (float dt) |
Static Public Member Functions | |
static __NotificationCenter * | getInstance () |
Gets the single instance of __NotificationCenter. More... | |
static void | destroyInstance () |
Destroys the single instance of __NotificationCenter. More... | |
static CC_DEPRECATED_ATTRIBUTE __NotificationCenter * | sharedNotificationCenter (void) |
local | sharedNotificationCenter () |
static CC_DEPRECATED_ATTRIBUTE void | purgeNotificationCenter (void) |
local | purgeNotificationCenter () |
Friends | |
class | ScriptHandlerMgr |
Additional Inherited Members | |
![]() | |
unsigned int | _ID |
object id, ScriptSupport need public _ID More... | |
int | _luaID |
Lua reference id. More... | |
var | _luaID |
Lua reference id. More... | |
local | _luaID |
Lua reference id. More... | |
![]() | |
unsigned int | _reference |
count of references More... | |
var | _reference |
count of references More... | |
local | _reference |
count of references More... | |
unsigned int | _autoReleaseCount |
count of autorelease More... | |
var | _autoReleaseCount |
count of autorelease More... | |
local | _autoReleaseCount |
count of autorelease More... | |
__NotificationCenter constructor
var ctor | ( | ) |
__NotificationCenter constructor
local __NotificationCenter | ( | ) |
__NotificationCenter constructor
~__NotificationCenter | ( | ) |
__NotificationCenter destructor
void addObserver | ( | Object * | target, |
SEL_CallFuncO | selector, | ||
const std::string & | name, | ||
Object * | sender | ||
) |
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. |
sender | The object whose notifications the target wants to receive. Only notifications sent by this sender are delivered to the target. nullptr means that the sender is not used to decide whether to deliver the notification to target. |
var addObserver | ( | var | target, |
var | selector, | ||
var | name, | ||
var | sender | ||
) |
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. |
sender | The object whose notifications the target wants to receive. Only notifications sent by this sender are delivered to the target. nullptr means that the sender is not used to decide whether to deliver the notification to target. |
local addObserver | ( | local | target, |
local | selector, | ||
local | name, | ||
local | sender | ||
) |
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. |
sender | The object whose notifications the target wants to receive. Only notifications sent by this sender are delivered to the target. nullptr means that the sender is not used to decide whether to deliver the notification to target. |
|
static |
Destroys the single instance of __NotificationCenter.
|
static |
Destroys the single instance of __NotificationCenter.
|
static |
Destroys the single instance of __NotificationCenter.
|
static |
Gets the single instance of __NotificationCenter.
|
static |
Gets the single instance of __NotificationCenter.
|
static |
Gets the single instance of __NotificationCenter.
int getObserverHandlerByName | ( | const std::string & | name) |
Gets observer script handler.
name | The name of this notification. |
var getObserverHandlerByName | ( | var | name) |
Gets observer script handler.
name | The name of this notification. |
local getObserverHandlerByName | ( | local | name) |
Gets observer script handler.
name | The name of this notification. |
|
inline |
Gets script handler.
|
inline |
Gets script handler.
|
inline |
Gets script handler.
void postNotification | ( | const std::string & | name) |
Posts one notification event by name.
name | The name of this notification. |
var postNotification | ( | var | name) |
Posts one notification event by name.
name | The name of this notification. |
local postNotification | ( | local | name) |
Posts one notification event by name.
name | The name of this notification. |
void postNotification | ( | const std::string & | name, |
Object * | sender | ||
) |
Posts one notification event by name.
name | The name of this notification. |
sender | The object posting the notification. Can be nullptr |
var postNotification | ( | var | name, |
var | sender | ||
) |
Posts one notification event by name.
name | The name of this notification. |
sender | The object posting the notification. Can be nullptr |
local postNotification | ( | local | name, |
local | sender | ||
) |
Posts one notification event by name.
name | The name of this notification. |
sender | The object posting the notification. Can be nullptr |
|
static |
|
static |
|
static |
void registerScriptObserver | ( | Object * | target, |
int | handler, | ||
const std::string & | name | ||
) |
Registers one hander for script binding.
handler | The lua handler. |
var registerScriptObserver | ( | var | target, |
var | handler, | ||
var | name | ||
) |
Registers one hander for script binding.
handler | The lua handler. |
local registerScriptObserver | ( | local | target, |
local | handler, | ||
local | name | ||
) |
Registers one hander for script binding.
handler | The lua handler. |
int removeAllObservers | ( | Object * | target) |
Removes all notifications registered by this target.
target | The target of this notification. |
var removeAllObservers | ( | var | target) |
Removes all notifications registered by this target.
target | The target of this notification. |
local removeAllObservers | ( | local | target) |
Removes all notifications registered by this target.
target | The target of this notification. |
void removeObserver | ( | Object * | target, |
const std::string & | name | ||
) |
Removes the observer by the specified target and name.
target | The target of this notification. |
name | The name of this notification. |
var removeObserver | ( | var | target, |
var | name | ||
) |
Removes the observer by the specified target and name.
target | The target of this notification. |
name | The name of this notification. |
local removeObserver | ( | local | target, |
local | name | ||
) |
Removes the observer by the specified target and name.
target | The target of this notification. |
name | The name of this notification. |
|
static |
|
static |
|
static |
void unregisterScriptObserver | ( | Object * | target, |
const std::string & | name | ||
) |
Unregisters script observer.
var unregisterScriptObserver | ( | var | target, |
var | name | ||
) |
Unregisters script observer.
local unregisterScriptObserver | ( | local | target, |
local | name | ||
) |
Unregisters script observer.
|
friend |
|
friend |
|
friend |