1.7.2.9
Gameface
cohtml::Property Class Referenceabstract

Represents a property of a type exposed to the scripting. More...

+ Inheritance diagram for cohtml::Property:

Public Member Functions

 Property (const char *name, bool isByRef=true)
 Create a new property. More...
 
virtual ~Property ()
 
const char * GetName () const
 Get the name of the property. More...
 
bool IsByRef () const
 Can this property be exported By-Ref. Temporaries can not be exported by reference. More...
 
virtual void * Bind (Binder *binder, void *object) const =0
 Expose the property's name and value to a binder. More...
 
virtual void * BindValue (Binder *binder, void *object) const =0
 Expose only the value of the property to a binder. More...
 
virtual void * Read (Binder *binder, void *object) const =0
 Read the value from a binder. More...
 
virtual void * ReadValue (Binder *binder, void *object) const =0
 Read only the value of the property from a binder. More...
 
virtual PropertyClone () const =0
 Clone the property. More...
 
virtual bool ToBoolean (void *object, bool *boolean) const =0
 Convert the property value to a boolean. More...
 
virtual bool ToNumber (void *object, float *number) const =0
 Convert the property value to a number. More...
 
virtual bool ToString (void *object, char *buffer, size_t *length) const =0
 Convert the property value to a string value. More...
 
virtual bool ToColor (void *object, renoir::Color *color) const =0
 Convert the property value to a color value. More...
 
virtual bool ToTransformMatrix2D (void *object, float matrix[6]) const =0
 Convert the property value to a matrix. More...
 
virtual bool ToArray (Binder *binder, void *object, ArrayInfo *arrayInfo) const =0
 Convert the property value to a array type information. More...
 
virtual bool ToPair (Binder *binder, void *object, PairInfo *pairInfo) const =0
 Convert the property value to a pair type information. More...
 
virtual bool ToMap (Binder *binder, void *object, MapInfo *mapInfo) const =0
 Convert the property value to a map type information. More...
 
virtual bool ToObject (Binder *binder, void *object, ObjectInfo *typeInfo) const =0
 Convert the property value to a object type information. More...
 

Static Public Member Functions

static void *COHERENT_CDECL operator new (size_t bytes)
 
static void COHERENT_CDECL operator delete (void *memory)
 
static void *COHERENT_CDECL operator new[] (size_t bytes)
 
static void COHERENT_CDECL operator delete[] (void *memory)
 

Protected Attributes

const char * m_Name
 
bool m_IsByRef
 

Detailed Description

Represents a property of a type exposed to the scripting.

Constructor & Destructor Documentation

◆ Property()

cohtml::Property::Property ( const char *  name,
bool  isByRef = true 
)
inline

Create a new property.

Parameters
name- name of the property. This name will be used in the scripting
isByRef- whether this property can be exposed ByRef to the scripting
Note
name must live until cohtml::IViewListener::OnBindingsReleased is called.

◆ ~Property()

virtual cohtml::Property::~Property ( )
inlinevirtual

Member Function Documentation

◆ Bind()

virtual void* cohtml::Property::Bind ( Binder binder,
void *  object 
) const
pure virtual

Expose the property's name and value to a binder.

Parameters
binder- the binder to use
object- object to get the property value from
Returns
- adjusted object pointer if necessary

Implemented in cohtml::AdjustPointer, cohtml::ConcretePropertyReadOnly< Getter >, cohtml::ConcreteProperty< Getter, Setter >, cohtml::FieldProperty< PropertyType(Class::*)[ArraySize]>, and cohtml::FieldProperty< PropertyType(Class::*)>.

◆ BindValue()

virtual void* cohtml::Property::BindValue ( Binder binder,
void *  object 
) const
pure virtual

Expose only the value of the property to a binder.

Parameters
binder- the binder to use
object- object to get the property value from
Returns
- adjusted object pointer if necessary

Implemented in cohtml::AdjustPointer, cohtml::ConcretePropertyReadOnly< Getter >, cohtml::ConcreteProperty< Getter, Setter >, cohtml::FieldProperty< PropertyType(Class::*)[ArraySize]>, and cohtml::FieldProperty< PropertyType(Class::*)>.

◆ Clone()

virtual Property* cohtml::Property::Clone ( ) const
pure virtual

◆ GetName()

const char* cohtml::Property::GetName ( ) const
inline

Get the name of the property.

Returns
the name of the property

◆ IsByRef()

bool cohtml::Property::IsByRef ( ) const
inline

Can this property be exported By-Ref. Temporaries can not be exported by reference.

Returns
true if the property can be exported safely by reference.

◆ operator delete()

static void COHERENT_CDECL cohtml::Property::operator delete ( void *  memory)
static

◆ operator delete[]()

static void COHERENT_CDECL cohtml::Property::operator delete[] ( void *  memory)
static

◆ operator new()

static void* COHERENT_CDECL cohtml::Property::operator new ( size_t  bytes)
static

◆ operator new[]()

static void* COHERENT_CDECL cohtml::Property::operator new[] ( size_t  bytes)
static

◆ Read()

virtual void* cohtml::Property::Read ( Binder binder,
void *  object 
) const
pure virtual

Read the value from a binder.

Parameters
binder- the binder to use
object- the object to set the property into
Returns
- adjusted object pointer if necessary

Implemented in cohtml::AdjustPointer, cohtml::ConcretePropertyReadOnly< Getter >, cohtml::ConcreteProperty< Getter, Setter >, cohtml::FieldProperty< PropertyType(Class::*)[ArraySize]>, and cohtml::FieldProperty< PropertyType(Class::*)>.

◆ ReadValue()

virtual void* cohtml::Property::ReadValue ( Binder binder,
void *  object 
) const
pure virtual

Read only the value of the property from a binder.

Parameters
binder- the binder to use
object- the object to set the property into
Returns
- adjusted object pointer if necessary

Implemented in cohtml::AdjustPointer, cohtml::ConcretePropertyReadOnly< Getter >, cohtml::ConcreteProperty< Getter, Setter >, cohtml::FieldProperty< PropertyType(Class::*)[ArraySize]>, and cohtml::FieldProperty< PropertyType(Class::*)>.

◆ ToArray()

virtual bool cohtml::Property::ToArray ( Binder binder,
void *  object,
ArrayInfo arrayInfo 
) const
pure virtual

Convert the property value to a array type information.

Parameters
binder- the binder to use
object- object to get the property value from
arrayInfo- information about array type - callbacks, properties, methods
Returns
true if conversion is possible and successful

Implemented in cohtml::AdjustPointer, cohtml::TypedProperty< ValueType >, cohtml::TypedProperty< const PropertyType(&)[ArraySize]>, cohtml::TypedProperty< ReturnsByRef< Getter >::ValuePassType >, and cohtml::TypedProperty< const PropertyType &>.

◆ ToBoolean()

virtual bool cohtml::Property::ToBoolean ( void *  object,
bool *  boolean 
) const
pure virtual

Convert the property value to a boolean.

Parameters
object- object to get the property value from
boolean- where to store the property value
Returns
true if conversion is possible and successful

Implemented in cohtml::AdjustPointer, cohtml::TypedProperty< ValueType >, cohtml::TypedProperty< const PropertyType(&)[ArraySize]>, cohtml::TypedProperty< ReturnsByRef< Getter >::ValuePassType >, and cohtml::TypedProperty< const PropertyType &>.

◆ ToColor()

virtual bool cohtml::Property::ToColor ( void *  object,
renoir::Color *  color 
) const
pure virtual

Convert the property value to a color value.

Parameters
object- object to get the property value from
color- where to store the property value
Returns
true if conversion is possible and successful

Implemented in cohtml::AdjustPointer, cohtml::TypedProperty< ValueType >, cohtml::TypedProperty< const PropertyType(&)[ArraySize]>, cohtml::TypedProperty< ReturnsByRef< Getter >::ValuePassType >, and cohtml::TypedProperty< const PropertyType &>.

◆ ToMap()

virtual bool cohtml::Property::ToMap ( Binder binder,
void *  object,
MapInfo mapInfo 
) const
pure virtual

Convert the property value to a map type information.

Parameters
binder- the binder to use
object- object to get the property value from
mapInfo- information about map type - callbacks, properties, methods
Returns
true if conversion is possible and successful

Implemented in cohtml::AdjustPointer, cohtml::TypedProperty< ValueType >, cohtml::TypedProperty< const PropertyType(&)[ArraySize]>, cohtml::TypedProperty< ReturnsByRef< Getter >::ValuePassType >, and cohtml::TypedProperty< const PropertyType &>.

◆ ToNumber()

virtual bool cohtml::Property::ToNumber ( void *  object,
float *  number 
) const
pure virtual

Convert the property value to a number.

Parameters
object- object to get the property value from
number- where to store the property value
Returns
true if conversion is possible and successful

Implemented in cohtml::AdjustPointer, cohtml::TypedProperty< ValueType >, cohtml::TypedProperty< const PropertyType(&)[ArraySize]>, cohtml::TypedProperty< ReturnsByRef< Getter >::ValuePassType >, and cohtml::TypedProperty< const PropertyType &>.

◆ ToObject()

virtual bool cohtml::Property::ToObject ( Binder binder,
void *  object,
ObjectInfo typeInfo 
) const
pure virtual

Convert the property value to a object type information.

Parameters
binder- the binder to use
object- object to get the property value from
typeInfo- information about object type - properties and methods if it's user defined type
Returns
true if conversion is possible and successful

Implemented in cohtml::AdjustPointer, cohtml::TypedProperty< ValueType >, cohtml::TypedProperty< const PropertyType(&)[ArraySize]>, cohtml::TypedProperty< ReturnsByRef< Getter >::ValuePassType >, and cohtml::TypedProperty< const PropertyType &>.

◆ ToPair()

virtual bool cohtml::Property::ToPair ( Binder binder,
void *  object,
PairInfo pairInfo 
) const
pure virtual

Convert the property value to a pair type information.

Parameters
binder- the binder to use
object- object to get the property value from
pairInfo- information about pair type - callbacks, properties, methods
Returns
true if conversion is possible and successful

Implemented in cohtml::AdjustPointer, cohtml::TypedProperty< ValueType >, cohtml::TypedProperty< const PropertyType(&)[ArraySize]>, cohtml::TypedProperty< ReturnsByRef< Getter >::ValuePassType >, and cohtml::TypedProperty< const PropertyType &>.

◆ ToString()

virtual bool cohtml::Property::ToString ( void *  object,
char *  buffer,
size_t *  length 
) const
pure virtual

Convert the property value to a string value.

Parameters
object- object to get the property value from
buffer- char buffer for the value
length- where to store the length of the converted value
Returns
true if conversion is possible and successful

Implemented in cohtml::AdjustPointer, cohtml::TypedProperty< ValueType >, cohtml::TypedProperty< const PropertyType(&)[ArraySize]>, cohtml::TypedProperty< ReturnsByRef< Getter >::ValuePassType >, and cohtml::TypedProperty< const PropertyType &>.

◆ ToTransformMatrix2D()

virtual bool cohtml::Property::ToTransformMatrix2D ( void *  object,
float  matrix[6] 
) const
pure virtual

Convert the property value to a matrix.

Parameters
object- object to get the property value from
matrix- where to store the property value
Returns
true if conversion is possible and successful

Implemented in cohtml::AdjustPointer, cohtml::TypedProperty< ValueType >, cohtml::TypedProperty< const PropertyType(&)[ArraySize]>, cohtml::TypedProperty< ReturnsByRef< Getter >::ValuePassType >, and cohtml::TypedProperty< const PropertyType &>.

Member Data Documentation

◆ m_IsByRef

bool cohtml::Property::m_IsByRef
protected

◆ m_Name

const char* cohtml::Property::m_Name
protected