1.26.2.1
Gameface
cohtml::ArgumentsBinder Class Referenceabstract

Class for communicating between EventHandler and the scripting. More...

Public Member Functions

virtual ~ArgumentsBinder ()
 
template<typename T >
void Result (const T &value)
 Set the result to be send back to the scripting. More...
 
template<typename T >
void GetArgument (int argument, T &value)
 Read the nth argument into a C++ value. More...
 
virtual BinderResultBegin ()=0
 Start sending the result to the scripting. This setups the binder that the next value will be the result of the call. More...
 
virtual void ResultEnd ()=0
 Send the last bound value as result to the scripting. More...
 
virtual void ResultVoid ()=0
 Send a void result to the scripting. More...
 
virtual BinderGetArgument (int argument)=0
 Setup the binder for reading the n-th argument. More...
 
virtual int GetArgumentsCount () const =0
 Get the number of arguments for the current call. More...
 
virtual bool HasError () const =0
 Get whether there has been an error during argument conversion. More...
 

Detailed Description

Class for communicating between EventHandler and the scripting.

Constructor & Destructor Documentation

◆ ~ArgumentsBinder()

virtual cohtml::ArgumentsBinder::~ArgumentsBinder ( )
inlinevirtual

Member Function Documentation

◆ GetArgument() [1/2]

template<typename T >
void cohtml::ArgumentsBinder::GetArgument ( int  argument,
T &  value 
)
inline

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.

◆ GetArgument() [2/2]

virtual Binder* cohtml::ArgumentsBinder::GetArgument ( int  argument)
pure virtual

Setup the binder for reading the n-th argument.

Parameters
argument- the index of the argument to be read, starting from 0
Returns
the binder instance for the view

◆ GetArgumentsCount()

virtual int cohtml::ArgumentsBinder::GetArgumentsCount ( ) const
pure virtual

Get the number of arguments for the current call.

Returns
- the number of arguments for the current call

◆ HasError()

virtual bool cohtml::ArgumentsBinder::HasError ( ) const
pure virtual

Get whether there has been an error during argument conversion.

Returns
true if there have been errors while converting the arguments

◆ Result()

template<typename T >
void cohtml::ArgumentsBinder::Result ( const T &  value)
inline

Set the result to be send back to the scripting.

Parameters
value- the value to be send back to the scripting

◆ ResultBegin()

virtual Binder* cohtml::ArgumentsBinder::ResultBegin ( )
pure virtual

Start sending the result to the scripting. This setups the binder that the next value will be the result of the call.

◆ ResultEnd()

virtual void cohtml::ArgumentsBinder::ResultEnd ( )
pure virtual

Send the last bound value as result to the scripting.

◆ ResultVoid()

virtual void cohtml::ArgumentsBinder::ResultVoid ( )
pure virtual

Send a void result to the scripting.