Skip to content
SiteEmail

cohtml::EventHandler

More…

#include <EventHandler.h>

Inherits from cohtml::IEventHandler, cohtml::ThisHolder< FunctorTraits< Functor >::IsMember >

Name
typedef FunctorTraits< Functor >Traits
Name
EventHandler(Functor functor)
virtual voidInvoke(ArgumentsBinder * binder)
Invoke the handler using the provided arguments binder.
virtual voidSetTarget(void * target)
Set the current invocation target.
virtual const void *GetTarget()
Retrieve the current invocation target.

Public Functions inherited from cohtml::IEventHandler

Name
virtual~IEventHandler()
void *COHERENT_CDECLoperator new(size_t bytes)
void COHERENT_CDECLoperator delete(void * memory)
void *COHERENT_CDECLoperator new[](size_t bytes)
void COHERENT_CDECLoperator delete[](void * memory)

Public Functions inherited from cohtml::ThisHolder< FunctorTraits< Functor >::IsMember >

Name
voidSetObject(void * )
template <typename Functor >
class cohtml::EventHandler;
typedef FunctorTraits<Functor> cohtml::EventHandler< Functor >::Traits;
inline EventHandler(
Functor functor
)
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

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

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