#include <CCNotificationCenter.h>
Public Member Functions | |
__NotificationCenter () | |
__NotificationCenter constructor More... | |
~__NotificationCenter () | |
__NotificationCenter destructor More... | |
void | addObserver (Ref *target, SEL_CallFuncO selector, const std::string &name, Ref *sender) |
Adds an observer for the specified target. More... | |
void | removeObserver (Ref *target, const std::string &name) |
Removes the observer by the specified target and name. More... | |
int | removeAllObservers (Ref *target) |
Removes all notifications registered by this target. More... | |
var | removeAllObservers ( var target) |
Removes all notifications registered by this target. More... | |
local | removeAllObservers ( local target) |
Removes all notifications registered by this target. More... | |
void | registerScriptObserver (Ref *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 (Ref *target, const std::string &name) |
Unregisters script observer. More... | |
void | postNotification (const std::string &name) |
Posts one notification event by name. More... | |
void | postNotification (const std::string &name, Ref *sender) |
Posts one notification event by name. More... | |
var | postNotification ( var name, var sender) |
Posts one notification event by name. More... | |
local | postNotification ( local name, local 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... | |
Public Member Functions inherited from Ref | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Release the ownership immediately. More... | |
Ref * | autorelease () |
Release the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
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 | |
Protected Member Functions inherited from Ref | |
Ref () | |
Constructor. More... | |
Protected Attributes inherited from Ref | |
unsigned int | _referenceCount |
count of references More... | |
__NotificationCenter constructor
var ctor | ( | ) |
__NotificationCenter constructor
local __NotificationCenter | ( | ) |
__NotificationCenter constructor
~__NotificationCenter | ( | ) |
__NotificationCenter destructor
void addObserver | ( | Ref * | target, |
SEL_CallFuncO | selector, | ||
const std::string & | name, | ||
Ref * | 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, |
Ref * | 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 | ( | Ref * | 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 | ( | Ref * | 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 | ( | Ref * | 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 | ( | Ref * | 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 |