cohtml::ArgumentsBinder
Class for communicating between EventHandler and the scripting.
#include <EventHandler.h>
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| virtual | ~ArgumentsBinder() |
| template <typename T > void | Result(const T & value) Set the result to be send back to the scripting. |
| template <typename T > void | GetArgument(int argument, T & value) Read the nth argument into a C++ value. |
| virtual Binder * | ResultBegin() =0 Start sending the result to the scripting. This setups the binder that the next value will be the result of the call. |
| virtual void | ResultEnd() =0 Send the last bound value as result to the scripting. |
| virtual void | ResultVoid() =0 Send a void result to the scripting. |
| virtual Binder * | GetArgument(int argument) =0 Setup the binder for reading the n-th argument. |
| virtual int | GetArgumentsCount() const =0 Get the number of arguments for the current call. |
| virtual bool | HasError() const =0 Get whether there has been an error during argument conversion. |
Public Functions Documentation
Section titled “Public Functions Documentation”function ~ArgumentsBinder
Section titled “function ~ArgumentsBinder”inline virtual ~ArgumentsBinder()function Result
Section titled “function Result”template <typename T >inline void Result( const T & value)Set the result to be send back to the scripting.
Parameters:
- value - the value to be send back to the scripting
function GetArgument
Section titled “function GetArgument”template <typename T >inline void GetArgument( int argument, T & value)Read the nth argument into a C++ value.
Parameters:
- argument - the index of the argument, starting from 0
- value - the C++ variable to be filled with the argument value
Note: The index of the argument is used only for logging errors. The next read operation always reads the next argument from JavaScript.
function ResultBegin
Section titled “function ResultBegin”virtual Binder * ResultBegin() =0Start sending the result to the scripting. This setups the binder that the next value will be the result of the call.
function ResultEnd
Section titled “function ResultEnd”virtual void ResultEnd() =0Send the last bound value as result to the scripting.
function ResultVoid
Section titled “function ResultVoid”virtual void ResultVoid() =0Send a void result to the scripting.
function GetArgument
Section titled “function GetArgument”virtual Binder * GetArgument( int argument) =0Setup the binder for reading the n-th argument.
Parameters:
- argument - the index of the argument to be read, starting from 0
Return: the binder instance for the view
function GetArgumentsCount
Section titled “function GetArgumentsCount”virtual int GetArgumentsCount() const =0Get the number of arguments for the current call.
Return: - the number of arguments for the current call
function HasError
Section titled “function HasError”virtual bool HasError() const =0Get whether there has been an error during argument conversion.
Return: true if there have been errors while converting the arguments
© 2026 Coherent Labs. All rights reserved.