KFbxListener Class Reference


Detailed Description

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.

Note:
The data will be process by the callback function of KFbxListener::Bind(). Plug-in could be used as listener, since KFbxPlugin is derived from KFbxListener. To emit event, you could create an emitter and a listener, and then bind them together via event handler. To listen to an event which is emitted by an emitter, you should bind current listener to the emitter by calling KFbxListener::Bind(). Event listener contains a list of event handlers.
Remarks:
An object(emitter) can emit a certain type of event, the plug-in(listener) who are listening to that type of event, will receive a signal and take action to process the event data.
The whole process of event is:
  • 1. Create an emitter and a listener, then bind them together via the same event handler.
  • 2. Emitter can emit an event at certain conditions. The event could be handled by event handler.
  • 3. Once an event is emitted, the listener to this event will receive a signal.
  • 4. And then the listener could process the event data according to the types of event, by calling event handler.
Note:
The event data is process by the callback function of event handler.
See also:
KFbxEmitter KFbxEventHandler KFbxEvent KFbxEventBase

Definition at line 73 of file kfbxlistener.h.

#include <kfbxlistener.h>

Inheritance diagram for KFbxListener:
Inheritance graph
[legend]

List of all members.

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.

Constructor & Destructor Documentation

Destructor.

KFbxListener ( ) [inline]

Constructor.

Definition at line 83 of file kfbxlistener.h.

{}

Member Function Documentation

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.

Parameters:
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.
Returns:
The automatically created event handler.

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.

Parameters:
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.
Returns:
The automatically created event handler.

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.

Parameters:
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.
Returns:
The automatically created event handler.

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.

Parameters:
aBindId The event handler to unbind.

The documentation for this class was generated from the following file:

KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener
KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener KFbxListener