1.14.0.5
Hummingbird
A modern user interface library for games
cohtml::ArgumentsBinder Class Referenceabstract

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

Public Member Functions

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.
 
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 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.

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

◆ 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