cohtml::EventHandler
#include <EventHandler.h>
Inherits from cohtml::IEventHandler, cohtml::ThisHolder< FunctorTraits< Functor >::IsMember >
Public Types
| Name | |
|---|---|
| typedef FunctorTraits< Functor > | Traits |
Public Functions
| Name | |
|---|---|
| EventHandler(Functor functor) | |
| virtual void | Invoke(ArgumentsBinder * binder) Invoke the handler using the provided arguments binder. |
| virtual void | SetTarget(void * target) Set the current invocation target. |
| virtual const void * | GetTarget() Retrieve the current invocation target. |
Additional inherited members
Public Functions inherited from cohtml::IEventHandler
| Name | |
|---|---|
| virtual | ~IEventHandler() |
| void *COHERENT_CDECL | operator new(size_t bytes) |
| void COHERENT_CDECL | operator delete(void * memory) |
| void *COHERENT_CDECL | operator new[](size_t bytes) |
| void COHERENT_CDECL | operator delete[](void * memory) |
Public Functions inherited from cohtml::ThisHolder< FunctorTraits< Functor >::IsMember >
| Name | |
|---|---|
| void | SetObject(void * ) |
Detailed Description
template <typename Functor >
class cohtml::EventHandler;
Public Types Documentation
typedef Traits
typedef FunctorTraits<Functor> cohtml::EventHandler< Functor >::Traits;
Public Functions Documentation
function EventHandler
inline EventHandler(
Functor functor
)
function Invoke
inline virtual void Invoke(
ArgumentsBinder * binder
)
Invoke the handler using the provided arguments binder.
Parameters:
- binder Binder used to read arguments and write return values
Note: This method is called when the bound method or event is triggered from the scripting environment. Implementations are expected to read the arguments from binder, perform the desired action, and optionally write a return value back through the binder.
Reimplements: cohtml::IEventHandler::Invoke
function SetTarget
inline virtual void SetTarget(
void * target
)
Set the current invocation target.
Parameters:
- target Pointer to the target object for the upcoming invocation
Note: This method is called by the SDK before each invocation to ensure the handler is associated with the correct target object. Implementations should store the pointer and use it during Invoke().
Reimplements: cohtml::IEventHandler::SetTarget
function GetTarget
inline virtual const void * GetTarget()
Retrieve the current invocation target.
Return: Pointer to the current target object
Note: The returned pointer represents the object instance on which the method is being invoked, or an abstraction meaningful to the handler implementation.
Reimplements: cohtml::IEventHandler::GetTarget