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

Provides binding between C++ and the UI. More...

Public Member Functions

virtual TypeDescription RegisterType (const char *name, void *object)
 Register type in the binding. More...
 
virtual TypeDescription RegisterType (const char *name, const void *object)
 Register type in the binding. More...
 
virtual void ArrayBegin (size_t size)=0
 Start exporting an array. More...
 
virtual void ArrayEnd ()=0
 End exporting an array.
 
virtual void MapBegin (size_t size)=0
 Start exporting a map (object) More...
 
virtual void MapEnd ()=0
 End exporting a map.
 
virtual size_t ReadArrayBegin ()=0
 Start reading an array. More...
 
virtual void ReadArrayElement (size_t index)=0
 Read element from an array. More...
 
virtual void ReadArrayEnd ()=0
 End reading an array.
 
virtual size_t ReadMapBegin ()=0
 Start reading a map (object) More...
 
virtual void ReadKeyValuePair ()=0
 Read next key-value pair from a map.
 
virtual void ReadMapEnd ()=0
 End reading a map.
 
virtual ValueType PeekValueType ()=0
 Peek the type of the current value. More...
 

Detailed Description

Provides binding between C++ and the UI.

Member Function Documentation

◆ ArrayBegin()

virtual void cohtml::Binder::ArrayBegin ( size_t  size)
pure virtual

Start exporting an array.

Parameters
sizesize of the array

◆ MapBegin()

virtual void cohtml::Binder::MapBegin ( size_t  size)
pure virtual

Start exporting a map (object)

Parameters
sizesize of the map

◆ PeekValueType()

virtual ValueType cohtml::Binder::PeekValueType ( )
pure virtual

Peek the type of the current value.

Returns
the type of the current value

◆ ReadArrayBegin()

virtual size_t cohtml::Binder::ReadArrayBegin ( )
pure virtual

Start reading an array.

Returns
the size of the array

◆ ReadArrayElement()

virtual void cohtml::Binder::ReadArrayElement ( size_t  index)
pure virtual

Read element from an array.

Parameters
indexthe index of the element in the array

◆ ReadMapBegin()

virtual size_t cohtml::Binder::ReadMapBegin ( )
pure virtual

Start reading a map (object)

Returns
the size of the map

◆ RegisterType() [1/2]

virtual TypeDescription cohtml::Binder::RegisterType ( const char *  name,
void *  object 
)
virtual

Register type in the binding.

Parameters
namename for the type
objectinstance of this type
Returns
TypeDescription object to be used to describe the properties of object
Warning
The name of the type should be unique for each type. Using duplicated names is undefined behavior

◆ RegisterType() [2/2]

virtual TypeDescription cohtml::Binder::RegisterType ( const char *  name,
const void *  object 
)
virtual

Register type in the binding.

Parameters
namename for the type
objectinstance of this type
Returns
TypeDescription object to be used to describe the properties of object
Warning
The name of the type should be unique for each type. Using duplicated names is undefined behavior