FBX C++ API Reference
FbxListener Class Reference

#include <fbxlistener.h>

Class 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 FbxListener::Bind(). Plug-in could be used as listener, since FbxPlugin is derived from FbxListener. 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 FbxListener::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
FbxEmitter FbxEventHandler FbxEvent FbxEventBase

Definition at line 41 of file fbxlistener.h.

+ Inheritance diagram for FbxListener:

Public Member Functions

Constructor and Destructor
 ~FbxListener ()
 Destructor. More...
 
 FbxListener ()
 Constructor. More...
 
Bind and unbind methods
template<typename EventType , typename ListenerType >
FbxEventHandlerBind (FbxEmitter &pEmitter, void(ListenerType::*pFunc)(const EventType *))
 Bind current listener and the specified emitter together via an automatically created event handler. More...
 
template<typename EventType , typename ListenerType >
FbxEventHandlerBind (FbxEmitter &pEmitter, void(ListenerType::*pFunc)(const EventType *) const)
 Bind current listener and the specified emitter together via an automatically created event handler. More...
 
template<typename EventType >
FbxEventHandlerBind (FbxEmitter &pEmitter, void(*pFunc)(const EventType *, FbxListener *))
 Bind current listener and the specified emitter together via an automatically created event handler. More...
 
void Unbind (const FbxEventHandler *aBindId)
 Unbind an event handler. More...
 

Constructor & Destructor Documentation

◆ ~FbxListener()

Destructor.

◆ FbxListener()

FbxListener ( )
inline

Constructor.

Definition at line 51 of file fbxlistener.h.

51 {}

Member Function Documentation

◆ Bind() [1/3]

FbxEventHandler* Bind ( FbxEmitter 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
pEmitterEvent emitter to bind. Current listener can listen to the event which is emitted by pEmitter.
pFuncThe callback function to process event date.
Returns
The automatically created event handler.

Definition at line 67 of file fbxlistener.h.

68  {
69  FbxMemberFuncEventHandler<EventType,ListenerType>* eventHandler =
70  FbxNew< FbxMemberFuncEventHandler<EventType,ListenerType> >(static_cast<ListenerType*>(this),pFunc);
71  pEmitter.AddListener(*eventHandler);
72  mEventHandler.PushBack(*eventHandler);
73  return eventHandler;
74  }
void AddListener(FbxEventHandler &pHandler)
Add the specified event handler to current emitter list.

◆ Bind() [2/3]

FbxEventHandler* Bind ( FbxEmitter 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
pEmitterEvent emitter to bind. Current listener can listen to the event which is emitted by pEmitter.
pFuncThe callback function to process event date.
Returns
The automatically created event handler.

Definition at line 83 of file fbxlistener.h.

84  {
85  FbxConstMemberFuncEventHandler<EventType,ListenerType>* eventHandler =
86  FbxNew< FbxConstMemberFuncEventHandler<EventType,ListenerType> >(static_cast<ListenerType*>(this),pFunc);
87  pEmitter.AddListener(*eventHandler);
88  mEventHandler.PushBack(*eventHandler);
89  return eventHandler;
90  }
void AddListener(FbxEventHandler &pHandler)
Add the specified event handler to current emitter list.

◆ Bind() [3/3]

FbxEventHandler* Bind ( FbxEmitter pEmitter,
void(*)(const EventType *, FbxListener *)  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
pEmitterEvent emitter to bind. Current listener can listen to the event which is emitted by pEmitter.
pFuncThe callback function to process event date.
Returns
The automatically created event handler.

Definition at line 99 of file fbxlistener.h.

100  {
101  FbxFuncEventHandler<EventType>* eventHandler =
102  FbxNew< FbxFuncEventHandler<EventType> >(this, pFunc);
103  pEmitter.AddListener(*eventHandler);
104  mEventHandler.PushBack(*eventHandler);
105  return eventHandler;
106  }
void AddListener(FbxEventHandler &pHandler)
Add the specified event handler to current emitter list.

◆ Unbind()

void Unbind ( const FbxEventHandler aBindId)

Unbind an event handler.

The specified event handler will be removed from the handlers list of current listener.

Parameters
aBindIdThe event handler to unbind.

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