cohtml::IEventHandler
Interface for handling method calls and UI event callbacks. More…
#include <EventHandler.h>
Inherited by cohtml::EventHandler< Functor >
Public Functions
| Name | |
|---|---|
| virtual | ~IEventHandler() |
| virtual void | Invoke(ArgumentsBinder * binder) =0 Invoke the handler using the provided arguments binder. |
| virtual const void * | GetTarget() =0 Retrieve the current invocation target. |
| virtual void | SetTarget(void * target) =0 Set the current invocation target. |
| 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) |
Detailed Description
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()andView::BindCall(). The SDK provides a default implementation viacohtml::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.
Public Functions Documentation
function ~IEventHandler
inline virtual ~IEventHandler()
function Invoke
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
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.
Reimplemented by: cohtml::EventHandler::Invoke
function GetTarget
virtual const void * GetTarget() =0
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.
Reimplemented by: cohtml::EventHandler::GetTarget
function SetTarget
virtual void SetTarget(
void * target
) =0
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().
Reimplemented by: cohtml::EventHandler::SetTarget
function operator new
static void *COHERENT_CDECL operator new(
size_t bytes
)
function operator delete
static void COHERENT_CDECL operator delete(
void * memory
)
function operator new[]
static void *COHERENT_CDECL operator new[](
size_t bytes
)
function operator delete[]
static void COHERENT_CDECL operator delete[](
void * memory
)