2.8.6
Coherent GT
A modern user interface library for games
Coherent::UIGT::Binder Class Referenceabstract

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

#include <Coherent/Coherent/UIGT/Binding/Binder.h>

Public Member Functions

TypeDescription RegisterType (const char *name, void *object)
 Register type in the binding. More...
 
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...
 
virtual int ArgumentsCount () const =0
 Get the arguments count for the event being executed. More...
 
Property ** GetPropertiesForType (const char *type, size_t &outCount)
 Gets an array of the bound properties for a specified type. More...
 
TypeInfo * GetLastType () const
 
virtual Binder::BindingMode GetMode ()=0
 

Detailed Description

Provides binding between C++ and the UI.

Member Function Documentation

◆ ArgumentsCount()

virtual int Coherent::UIGT::Binder::ArgumentsCount ( ) const
pure virtual

Get the arguments count for the event being executed.

Warning
This method should be called only from inside EventHandler invocation
Returns
the number of arguments

◆ ArrayBegin()

virtual void Coherent::UIGT::Binder::ArrayBegin ( size_t  size)
pure virtual

Start exporting an array.

Parameters
sizesize of the array

◆ GetLastType()

TypeInfo* Coherent::UIGT::Binder::GetLastType ( ) const
Returns
A pointer to the TypeInfo of the last type that was bound with CoherentBind

◆ GetMode()

virtual Binder::BindingMode Coherent::UIGT::Binder::GetMode ( )
pure virtual
Returns
the last set binding mode

◆ GetPropertiesForType()

Property** Coherent::UIGT::Binder::GetPropertiesForType ( const char *  type,
size_t &  outCount 
)

Gets an array of the bound properties for a specified type.

Warning
The array is placed in shareable memory area and is valid until the next call to Binder::GetPropertiesForType
Note
Intended method usage is internal only
Parameters
typethe type to query about bound properties
outCountoutput parameter for the bound properties count
Returns
A pointer to an array with the properties for the given type

◆ MapBegin()

virtual void Coherent::UIGT::Binder::MapBegin ( size_t  size)
pure virtual

Start exporting a map (object)

Parameters
sizesize of the map

◆ PeekValueType()

virtual ValueType Coherent::UIGT::Binder::PeekValueType ( )
pure virtual

Peek the type of the current value.

Returns
the type of the current value

◆ ReadArrayBegin()

virtual size_t Coherent::UIGT::Binder::ReadArrayBegin ( )
pure virtual

Start reading an array.

Returns
the size of the array

◆ ReadArrayElement()

virtual void Coherent::UIGT::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 Coherent::UIGT::Binder::ReadMapBegin ( )
pure virtual

Start reading a map (object)

Returns
the size of the map

◆ RegisterType() [1/2]

TypeDescription Coherent::UIGT::Binder::RegisterType ( const char *  name,
void *  object 
)

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]

TypeDescription Coherent::UIGT::Binder::RegisterType ( const char *  name,
const void *  object 
)

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