#include <CCNotificationCenter.h>
Public Member Functions | |
NotificationObserver (Ref *target, SEL_CallFuncO selector, const std::string &name, Ref *sender) | |
NotificationObserver constructor. More... | |
~NotificationObserver () | |
NotificationObserver destructor function. More... | |
void | performSelector (Ref *sender) |
Invokes the callback function of this observer. More... | |
Ref * | getTarget () const |
SEL_CallFuncO | getSelector () const |
const std::string & | getName () const |
Ref * | getSender () const |
int | getHandler () const |
void | setHandler (int handler) |
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 () |
Additional Inherited Members | |
Protected Member Functions inherited from Ref | |
Ref () | |
Constructor. More... | |
Protected Attributes inherited from Ref | |
unsigned int | _referenceCount |
count of references More... | |
NotificationObserver | ( | Ref * | target, |
SEL_CallFuncO | selector, | ||
const std::string & | name, | ||
Ref * | sender | ||
) |
NotificationObserver constructor.
target | The target which wants to observer 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. |
~NotificationObserver | ( | ) |
NotificationObserver destructor function.
int getHandler | ( | ) | const |
const std::string& getName | ( | ) | const |
SEL_CallFuncO getSelector | ( | ) | const |
Ref* getSender | ( | ) | const |
Ref* getTarget | ( | ) | const |
void performSelector | ( | Ref * | sender) |
Invokes the callback function of this observer.
void setHandler | ( | int | handler) |