FBX SDK listener class.
Once an event is emitted by an emitter, a listener should be created to listen to the event. The listener could receive a signal and take action to process the event data.
Definition at line 73 of file kfbxlistener.h.
#include <kfbxlistener.h>
Public Member Functions |
|
Constructor and Destructor
|
|
~KFbxListener () | |
Destructor. |
|
KFbxListener () | |
Constructor. |
|
Bind and unbind methods
|
|
template<typename EventType , typename ListenerType > | |
KFbxEventHandler * | Bind (KFbxEmitter &pEmitter, void(ListenerType::*pFunc)(const EventType *)) |
Bind current listener and the specified
emitter together via an automatically created event handler.
|
|
template<typename EventType , typename ListenerType > | |
KFbxEventHandler * | Bind (KFbxEmitter &pEmitter, void(ListenerType::*pFunc)(const EventType *) const) |
Bind current listener and the specified
emitter together via an automatically created event handler.
|
|
template<typename EventType > | |
KFbxEventHandler * | Bind (KFbxEmitter &pEmitter, void(*pFunc)(const EventType *, KFbxListener *)) |
Bind current listener and the specified
emitter together via an automatically created event handler.
|
|
void | Unbind (const KFbxEventHandler *aBindId) |
Unbind an event handler. |
~KFbxListener | ( | ) |
Destructor.
KFbxListener | ( | ) | [inline] |
KFbxEventHandler* Bind | ( | KFbxEmitter & | pEmitter, |
void(ListenerType::*)(const EventType *) | pFunc | ||
) | [inline] |
Bind current listener and the specified emitter together via an automatically created event handler.
An event handler will be created automatically and added to the handlers list of current listener and the specified emitter. After that, the listener can listen to the event which is emitted by the specified emitter.
pEmitter | Event emitter to bind. Current listener can listen to the event which is emitted by pEmitter. |
pFunc | The callback function to process event date. |
Definition at line 100 of file kfbxlistener.h.
{ KFbxMemberFuncEventHandler<EventType,ListenerType>* eventHandler = FbxSdkNew< KFbxMemberFuncEventHandler<EventType,ListenerType> >(static_cast<ListenerType*>(this),pFunc); pEmitter.AddListener(*eventHandler); mEventHandler.PushBack(*eventHandler); return eventHandler; }
KFbxEventHandler* Bind | ( | KFbxEmitter & | pEmitter, |
void(ListenerType::*)(const EventType *) const | pFunc | ||
) | [inline] |
Bind current listener and the specified emitter together via an automatically created event handler.
An event handler will be created automatically and added to the handlers list of current listener and the specified emitter. After that, the listener can listen to the event which is emitted by the specified emitter.
pEmitter | Event emitter to bind. Current listener can listen to the event which is emitted by pEmitter. |
pFunc | The callback function to process event date. |
Definition at line 118 of file kfbxlistener.h.
{ KFbxConstMemberFuncEventHandler<EventType,ListenerType>* eventHandler = FbxSdkNew< KFbxConstMemberFuncEventHandler<EventType,ListenerType> >(static_cast<ListenerType*>(this),pFunc); pEmitter.AddListener(*eventHandler); mEventHandler.PushBack(*eventHandler); return eventHandler; }
KFbxEventHandler* Bind | ( | KFbxEmitter & | pEmitter, |
void(*)(const EventType *, KFbxListener *) | pFunc | ||
) | [inline] |
Bind current listener and the specified emitter together via an automatically created event handler.
An event handler will be created automatically and added to the handlers list of current listener and the specified emitter. After that, the listener can listen to the event which is emitted by the specified emitter.
pEmitter | Event emitter to bind. Current listener can listen to the event which is emitted by pEmitter. |
pFunc | The callback function to process event date. |
Definition at line 135 of file kfbxlistener.h.
{ KFbxFuncEventHandler<EventType>* eventHandler = FbxSdkNew< KFbxFuncEventHandler<EventType> >(this, pFunc); pEmitter.AddListener(*eventHandler); mEventHandler.PushBack(*eventHandler); return eventHandler; }
void Unbind | ( | const KFbxEventHandler * | aBindId | ) |
Unbind an event handler.
The specified event handler will be removed from the handlers list of current listener.
aBindId | The event handler to unbind. |