cohtml::Property

Represents a property of a type exposed to the scripting.

#include <Property.h>

Inherited by cohtml::AdjustPointer, cohtml::TypedProperty< ValueType >, cohtml::TypedProperty< const PropertyType &>, cohtml::TypedProperty< const PropertyType(&)[ArraySize]>, cohtml::TypedProperty< ReturnsByRef< Getter >::ValuePassType >

Public Functions

Name
Property(const char * name, bool isByRef =true)
Create a new property.
virtual~Property()
const char *GetName() const
Get the name of the property.
boolIsByRef() const
Can this property be exported By-Ref. Temporaries can not be exported by reference.
virtual void *Bind(Binder * binder, void * object) const =0
Expose the property’s name and value to a binder.
virtual void *BindValue(Binder * binder, void * object) const =0
Expose only the value of the property to a binder.
virtual void *Read(Binder * binder, void * object) const =0
Read the value from a binder.
virtual void *ReadValue(Binder * binder, void * object) const =0
Read only the value of the property from a binder.
virtual Property *Clone() const =0
Clone the property.
virtual boolToBoolean(void * object, bool * boolean) const =0
Convert the property value to a boolean.
virtual boolToNumber(void * object, float * number) const =0
Convert the property value to a number.
virtual boolToString(void * object, char * buffer, size_t * length) const =0
Convert the property value to a string value.
virtual boolToColor(void * object, renoir::Color * color) const =0
Convert the property value to a color value.
virtual boolToTransformMatrix2D(void * object, float matrix[6]) const =0
Convert the property value to a matrix.
virtual boolToArray(Binder * binder, void * object, ArrayInfo * arrayInfo) const =0
Convert the property value to a array type information.
virtual boolToPair(Binder * binder, void * object, PairInfo * pairInfo) const =0
Convert the property value to a pair type information.
virtual boolToMap(Binder * binder, void * object, MapInfo * mapInfo) const =0
Convert the property value to a map type information.
virtual boolToObject(Binder * binder, void * object, ObjectInfo * typeInfo) const =0
Convert the property value to a object type information.
void *COHERENT_CDECLoperator new(size_t bytes)
void COHERENT_CDECLoperator delete(void * memory)
void *COHERENT_CDECLoperator new[](size_t bytes)
void COHERENT_CDECLoperator delete[](void * memory)

Protected Attributes

Name
const char *m_Name
boolm_IsByRef

Public Functions Documentation

function Property

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

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.

function ~Property

inline virtual ~Property()

function GetName

inline const char * GetName() const

Get the name of the property.

Return: the name of the property

function IsByRef

inline bool IsByRef() const

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

Return: true if the property can be exported safely by reference.

function Bind

virtual void * Bind(
    Binder * binder,
    void * object
) const =0

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

Parameters:

  • binder - the binder to use
  • object - object to get the property value from

Return: - adjusted object pointer if necessary

Reimplemented by: cohtml::FieldProperty< PropertyType(Class::*)>::Bind, cohtml::FieldProperty< PropertyType(Class::*)[ArraySize]>::Bind, cohtml::ConcreteProperty::Bind, cohtml::ConcretePropertyReadOnly::Bind, cohtml::AdjustPointer::Bind

function BindValue

virtual void * BindValue(
    Binder * binder,
    void * object
) const =0

Expose only the value of the property to a binder.

Parameters:

  • binder - the binder to use
  • object - object to get the property value from

Return: - adjusted object pointer if necessary

Reimplemented by: cohtml::FieldProperty< PropertyType(Class::*)>::BindValue, cohtml::FieldProperty< PropertyType(Class::*)[ArraySize]>::BindValue, cohtml::ConcreteProperty::BindValue, cohtml::ConcretePropertyReadOnly::BindValue, cohtml::AdjustPointer::BindValue

function Read

virtual void * Read(
    Binder * binder,
    void * object
) const =0

Read the value from a binder.

Parameters:

  • binder - the binder to use
  • object - the object to set the property into

Return: - adjusted object pointer if necessary

Reimplemented by: cohtml::FieldProperty< PropertyType(Class::*)>::Read, cohtml::FieldProperty< PropertyType(Class::*)[ArraySize]>::Read, cohtml::ConcreteProperty::Read, cohtml::ConcretePropertyReadOnly::Read, cohtml::AdjustPointer::Read

function ReadValue

virtual void * ReadValue(
    Binder * binder,
    void * object
) const =0

Read only the value of the property from a binder.

Parameters:

  • binder - the binder to use
  • object - the object to set the property into

Return: - adjusted object pointer if necessary

Reimplemented by: cohtml::FieldProperty< PropertyType(Class::*)>::ReadValue, cohtml::FieldProperty< PropertyType(Class::*)[ArraySize]>::ReadValue, cohtml::ConcreteProperty::ReadValue, cohtml::ConcretePropertyReadOnly::ReadValue, cohtml::AdjustPointer::ReadValue

function Clone

virtual Property * Clone() const =0

Clone the property.

Return: a heap allocated copy of the property

Reimplemented by: cohtml::FieldProperty< PropertyType(Class::*)>::Clone, cohtml::FieldProperty< PropertyType(Class::*)[ArraySize]>::Clone, cohtml::ConcreteProperty::Clone, cohtml::ConcretePropertyReadOnly::Clone, cohtml::AdjustPointer::Clone

function ToBoolean

virtual bool ToBoolean(
    void * object,
    bool * boolean
) const =0

Convert the property value to a boolean.

Parameters:

  • object - object to get the property value from
  • boolean - where to store the property value

Return: true if conversion is possible and successful

Reimplemented by: cohtml::TypedProperty::ToBoolean, cohtml::TypedProperty::ToBoolean, cohtml::TypedProperty::ToBoolean, cohtml::TypedProperty::ToBoolean, cohtml::AdjustPointer::ToBoolean

function ToNumber

virtual bool ToNumber(
    void * object,
    float * number
) const =0

Convert the property value to a number.

Parameters:

  • object - object to get the property value from
  • number - where to store the property value

Return: true if conversion is possible and successful

Reimplemented by: cohtml::TypedProperty::ToNumber, cohtml::TypedProperty::ToNumber, cohtml::TypedProperty::ToNumber, cohtml::TypedProperty::ToNumber, cohtml::AdjustPointer::ToNumber

function ToString

virtual bool ToString(
    void * object,
    char * buffer,
    size_t * length
) const =0

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

Return: true if conversion is possible and successful

Reimplemented by: cohtml::TypedProperty::ToString, cohtml::TypedProperty::ToString, cohtml::TypedProperty::ToString, cohtml::TypedProperty::ToString, cohtml::AdjustPointer::ToString

function ToColor

virtual bool ToColor(
    void * object,
    renoir::Color * color
) const =0

Convert the property value to a color value.

Parameters:

  • object - object to get the property value from
  • color - where to store the property value

Return: true if conversion is possible and successful

Reimplemented by: cohtml::TypedProperty::ToColor, cohtml::TypedProperty::ToColor, cohtml::TypedProperty::ToColor, cohtml::TypedProperty::ToColor, cohtml::AdjustPointer::ToColor

function ToTransformMatrix2D

virtual bool ToTransformMatrix2D(
    void * object,
    float matrix[6]
) const =0

Convert the property value to a matrix.

Parameters:

  • object - object to get the property value from
  • matrix - where to store the property value

Return: true if conversion is possible and successful

Reimplemented by: cohtml::TypedProperty::ToTransformMatrix2D, cohtml::TypedProperty::ToTransformMatrix2D, cohtml::TypedProperty::ToTransformMatrix2D, cohtml::TypedProperty::ToTransformMatrix2D, cohtml::AdjustPointer::ToTransformMatrix2D

function ToArray

virtual bool ToArray(
    Binder * binder,
    void * object,
    ArrayInfo * arrayInfo
) const =0

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

Return: true if conversion is possible and successful

Reimplemented by: cohtml::TypedProperty::ToArray, cohtml::TypedProperty::ToArray, cohtml::TypedProperty::ToArray, cohtml::TypedProperty::ToArray, cohtml::AdjustPointer::ToArray

function ToPair

virtual bool ToPair(
    Binder * binder,
    void * object,
    PairInfo * pairInfo
) const =0

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

Return: true if conversion is possible and successful

Reimplemented by: cohtml::TypedProperty::ToPair, cohtml::TypedProperty::ToPair, cohtml::TypedProperty::ToPair, cohtml::TypedProperty::ToPair, cohtml::AdjustPointer::ToPair

function ToMap

virtual bool ToMap(
    Binder * binder,
    void * object,
    MapInfo * mapInfo
) const =0

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

Return: true if conversion is possible and successful

Reimplemented by: cohtml::TypedProperty::ToMap, cohtml::TypedProperty::ToMap, cohtml::TypedProperty::ToMap, cohtml::TypedProperty::ToMap, cohtml::AdjustPointer::ToMap

function ToObject

virtual bool ToObject(
    Binder * binder,
    void * object,
    ObjectInfo * typeInfo
) const =0

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

Return: true if conversion is possible and successful

Reimplemented by: cohtml::TypedProperty::ToObject, cohtml::TypedProperty::ToObject, cohtml::TypedProperty::ToObject, cohtml::TypedProperty::ToObject, cohtml::AdjustPointer::ToObject

function operator new

static void *COHERENT_CDECL operator new(
    size_t bytes
)

function operator delete

static void COHERENT_CDECL operator delete(
    void * memory
)

function operator new[]

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

function operator delete[]

static void COHERENT_CDECL operator delete[](
    void * memory
)

Protected Attributes Documentation

variable m_Name

const char * m_Name;

variable m_IsByRef

bool m_IsByRef;