Base class to emit event with the specified event type.
The event type could be a specific class which derived from FbxEvent. Please read FbxEmitter::Emit() for more details. Event emitter contains a list of event handlers. FBX object could be used as emitter, since FbxObject is derived from FbxEmitter. Before using emitter to emit an event, one or more event handlers must be added to the handlers list of current emitter. In other words, it's "bind event handlers to emitter". There are two ways to bind event handlers to emitter.
Definition at line 54 of file fbxemitter.h.
#include <fbxemitter.h>

Classes |
|
| struct | Data |
Public Member Functions |
|
| FbxEmitter () | |
| Constructor. |
|
| ~FbxEmitter () | |
| Destructor. |
|
| void | AddListener (FbxEventHandler &pHandler) |
| The specified event handler will be added to
the handlers list of current emitter. |
|
| void | RemoveListener (FbxEventHandler &pHandler) |
| The specified event handler will be removed
from the handlers list of current emitter. |
|
| template<typename EventType > | |
| void | Emit (const EventType &pEvent) const |
| Emit an event with the specified the event
type. |
|
Protected Types |
|
| typedef
FbxIntrusiveList < FbxEventHandler, FbxEventHandler::eEmitter > |
EventHandlerList |
Protected Attributes |
|
| Data * | mData |
typedef FbxIntrusiveList<FbxEventHandler,
FbxEventHandler::eEmitter> EventHandlerList
[protected] |
Definition at line 113 of file fbxemitter.h.
| FbxEmitter | ( | ) |
Constructor.
| ~FbxEmitter | ( | ) |
Destructor.
| void AddListener | ( | FbxEventHandler & | pHandler | ) |
The specified event handler will be added to the handlers list of current emitter.
Bind the specified event handler to current emitter actually.
| pHandler | the event handler will be added to the handlers list of current emitter. |
| void RemoveListener | ( | FbxEventHandler & | pHandler | ) |
The specified event handler will be removed from the handlers list of current emitter.
| pHandler | the event handler will be removed from the handlers list of current emitter. |
| void Emit | ( | const EventType & | pEvent | ) | const [inline] |
Emit an event with the specified the event type.
One the event is emitted, the listener to this event will receive a signal.
| pEvent | specify the event type to emit. pEvent could be a specific class which derived from FbxEvent, such as FbxObjectPropertyChanged. |
FbxObject::Emit(FbxObjectPropertyChanged(*pProperty));
Definition at line 88 of file fbxemitter.h.
{
if ( mData )
{
EventHandlerList::iterator itBegin = mData->mEventHandler.Begin();
EventHandlerList::iterator itEnd = mData->mEventHandler.End();
for (EventHandlerList::iterator it = itBegin; it!=itEnd; ++it)
{
if ((*it).GetHandlerEventType() == pEvent.GetTypeId())
(*it).FunctionCall(pEvent);
}
}
}