Classes | Public Member Functions | Protected Types | Protected Attributes

FbxEmitter Class Reference

Search for all occurrences

Detailed Description

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>

Inheritance diagram for FbxEmitter:
Inheritance graph
[legend]

List of all members.

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

Member Typedef Documentation

typedef FbxIntrusiveList<FbxEventHandler, FbxEventHandler::eEmitter> EventHandlerList [protected]

Definition at line 113 of file fbxemitter.h.


Constructor & Destructor Documentation

Constructor.

~FbxEmitter ( )

Destructor.


Member Function Documentation

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.

Note:
This is not a thread-safe method!
Parameters:
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.

Note:
This is not a thread-safe method!
Parameters:
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.

Note:
This is a thread-safe method!
Parameters:
pEvent specify the event type to emit. pEvent could be a specific class which derived from FbxEvent, such as FbxObjectPropertyChanged.
Remarks:
For example:
See also:
FbxEventBase FbxObjectPropertyChanged FbxEventReferencedDocument FbxEventPostExport
FbxEventPostImport FbxEventPreExport FbxEventPreImport FbxEventPopulateSystemLibrary

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);
            }
        }
    }

Member Data Documentation

Data* mData [protected]

Reimplemented in FbxCache.

Definition at line 120 of file fbxemitter.h.


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

FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter
FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter FbxEmitter