KFbxEvent< EventT > Class Template Reference


Detailed Description

template<typename EventT>
class kfbxevents::KFbxEvent< EventT >

FBX event class, derived from KFbxEventBase, and it contains a type ID for event.

It's a template class. You can derive your own types of even. Such as:

 class KFbxEventCustom : public kfbxevents::KFbxEvent<KFbxEventCustom> 
See also:
KFbxObjectPropertyChanged KFbxEventReferencedDocument KFbxEventPostExport
KFbxEventPostImport KFbxEventPreExport KFbxEventPreImport KFbxEventPopulateSystemLibrary
Remarks:
A FBX event is something that is emitted by an emitter, with the goal of being filled by the listener that listen to it. 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:
KFbxEventBase KFbxEventHandler KFbxListener KFbxEmitter

Definition at line 167 of file kfbxevents.h.

#include <kfbxevents.h>

Inheritance diagram for KFbxEvent< EventT >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual  ~KFbxEvent ()
  Destructor.
virtual int  GetTypeId () const
  Retrieve the event type ID.

Static Public Member Functions

static void  ForceTypeId (int pTypeId)
  Update the type ID of current event with the given type ID.
static int  GetStaticTypeId ()
  Retrieve the event type ID.

Constructor & Destructor Documentation

virtual ~KFbxEvent ( ) [inline, virtual]

Destructor.

Definition at line 171 of file kfbxevents.h.

{}

Member Function Documentation

static void ForceTypeId ( int  pTypeId ) [inline, static]

Update the type ID of current event with the given type ID.

Parameters:
pTypeId the new type ID.

Definition at line 176 of file kfbxevents.h.

        {
            kfbxmp::KFbxMutexHelper lLock( smMutex );

            // This is to handle specific cases where the type ID must be hard coded
            // It is useful for shared event across DLL. We can then guarantee that
            // The ID of a certain type will always have the same ID
            smTypeId = pTypeId;
        }
virtual int GetTypeId ( ) const [inline, virtual]

Retrieve the event type ID.

Note:
This may be called from multiple threads.
Returns:
type id

Implements KFbxEventBase.

Definition at line 190 of file kfbxevents.h.

        {
            return GetStaticTypeId();
        }
static int GetStaticTypeId ( ) [inline, static]

Retrieve the event type ID.

Returns:
type id

Definition at line 198 of file kfbxevents.h.

        {
            if( !smTypeId )
            {
                kfbxmp::KFbxMutexHelper lLock( smMutex );

                if( !smTypeId )
                {
                    // If this does not compile, you need to add 
                    // KFBXEVENT_DECLARE(YourEventClassName) to your class declaration
                    smTypeId  = KFbxEventBase::GetStaticTypeId(EventT::FbxEventName());
                }
            }

           return smTypeId;
        }

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