Skip to content
SiteEmail

cohtml::IEventHandler

Interface for handling method calls and UI event callbacks. More…

#include <EventHandler.h>

Inherited by cohtml::EventHandler< Functor >

Name
virtual~IEventHandler()
virtual voidInvoke(ArgumentsBinder * binder) =0
Invoke the handler using the provided arguments binder.
virtual const void *GetTarget() =0
Retrieve the current invocation target.
virtual voidSetTarget(void * target) =0
Set the current invocation target.
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)
class cohtml::IEventHandler;

Interface for handling method calls and UI event callbacks.

IEventHandler abstracts an invocable callable that can be bound to the UI as a method or registered as an event handler. It is used by the SDK when:

  • binding methods on user-defined types via Binder::AddMethod(), and
  • dispatching UI events and calls registered through View::RegisterForEvent() and View::BindCall(). The SDK provides a default implementation via cohtml::MakeHandler, which wraps C++ callables. Users may implement this interface directly to integrate custom dispatch logic, such as forwarding calls to a scripting language (e.g. Lua) or invoking functions stored in an external runtime.

The SDK ensures that SetTarget() is invoked before each call to update the current target object.

inline virtual ~IEventHandler()
virtual void Invoke(
ArgumentsBinder * binder
) =0

Invoke the handler using the provided arguments binder.

Parameters:

  • binder Binder used to read arguments and write return values

Reimplemented by: cohtml::EventHandler::Invoke

virtual const void * GetTarget() =0

Retrieve the current invocation target.

Return: Pointer to the current target object

Reimplemented by: cohtml::EventHandler::GetTarget

virtual void SetTarget(
void * target
) =0

Set the current invocation target.

Parameters:

  • target Pointer to the target object for the upcoming invocation

Reimplemented by: cohtml::EventHandler::SetTarget

static void *COHERENT_CDECL operator new(
size_t bytes
)
static void COHERENT_CDECL operator delete(
void * memory
)
static void *COHERENT_CDECL operator new[](
size_t bytes
)
static void COHERENT_CDECL operator delete[](
void * memory
)