13 #ifndef _FBXSDK_CORE_EVENT_HANDLER_H_ 14 #define _FBXSDK_CORE_EVENT_HANDLER_H_ 68 #ifndef DOXYGEN_SHOULD_SKIP_THIS 79 #ifndef DOXYGEN_SHOULD_SKIP_THIS 81 template <
typename EventType,
typename ListenerType>
class FbxMemberFuncEventHandler :
public FbxEventHandler 83 typedef void (ListenerType::*CallbackFnc)(
const EventType*);
86 FbxMemberFuncEventHandler(ListenerType* pListenerInstance, CallbackFnc pFunction) : mListener(pListenerInstance), mFunction(pFunction){}
88 virtual void FunctionCall(
const FbxEventBase& pEvent){ (*mListener.*mFunction)(reinterpret_cast<const EventType*>(&pEvent)); }
92 ListenerType* mListener;
93 CallbackFnc mFunction;
96 template <
typename EventType,
typename ListenerType>
class FbxConstMemberFuncEventHandler :
public FbxEventHandler 98 typedef void (ListenerType::*CallbackFnc)(
const EventType*)
const;
101 FbxConstMemberFuncEventHandler(ListenerType* pListenerInstance, CallbackFnc pFunction) : mListener(pListenerInstance), mFunction(pFunction){}
103 virtual void FunctionCall(
const FbxEventBase& pEvent){ (*mListener.*mFunction)(reinterpret_cast<const EventType*>(&pEvent)); }
107 ListenerType* mListener;
108 CallbackFnc mFunction;
111 template <
typename EventType>
class FbxFuncEventHandler :
public FbxEventHandler 113 typedef void (*CallbackFnc)(
const EventType*,
FbxListener*);
116 FbxFuncEventHandler(
FbxListener* pListener, CallbackFnc pFunction) : mListener(pListener), mFunction(pFunction){}
118 virtual void FunctionCall(
const FbxEventBase& pEvent){ (*mFunction)(
reinterpret_cast<const EventType*
>(&pEvent), mListener); }
123 CallbackFnc mFunction;
FBX SDK environment definition.
Event handler class contains a listener and a callback function.
FBX SDK event base class.
Emitter event handler type.
virtual FbxListener * GetListener()=0
Get listener of current handler.
Listener event handler type.
EType
Event handler base type.
virtual void FunctionCall(const FbxEventBase &pEvent)=0
Call function that process event data.
Count of different event handler types.
virtual int GetHandlerEventType()=0
Get event type of current handler.