Skip to content
SiteEmail

cohtml::AdjustPointer

#include <Property.h>

Inherits from cohtml::Property

Name
AdjustPointer(const char * name, int offset)
AdjustPointer(const AdjustPointer & o)
virtual void *Bind(Binder * binder, void * object) const override
Expose the property’s name and value to a binder.
virtual void *BindValue(Binder * binder, void * object) const override
Expose only the value of the property to a binder.
virtual void *Read(Binder * binder, void * object) const override
Read the value from a binder.
virtual void *ReadValue(Binder * binder, void * object) const override
Read only the value of the property from a binder.
virtual AdjustPointer *Clone() const override
Clone the property.
virtual boolToBoolean(void * object, bool * boolean) const override
Convert the property value to a boolean.
virtual boolToNumber(void * object, float * number) const override
Convert the property value to a number.
virtual boolToNumber(void * object, double * number) const override
Convert the property value to a number with double precision.
virtual boolToString(void * object, char * buffer, size_t * length) const override
Convert the property value to a string representation.
virtual boolToColor(void * object, renoir::Color * color) const override
Convert the property value to a color value. Implementation is optional. Provides improved performance for data-bind-style-* attributes that accept color values, such as background-color.
virtual boolToTransformMatrix2D(void * object, float matrix[6]) const override
Convert the property value to a matrix. Implementation is optional. Provides improved performance for data-bind-style-transform2d.
virtual boolToArray(Binder * binder, void * object, ArrayInfo * arrayInfo) const override
Convert the property value to an array type information. Conversion should succeed only when the underlying type is an array.
virtual boolToPair(Binder * binder, void * object, PairInfo * pairInfo) const override
Convert the property value to a pair type information. Conversion should succeed only when the underlying type is a pair.
virtual boolToMap(Binder * binder, void * object, MapInfo * mapInfo) const override
Convert the property value to a map type information. Conversion should succeed only when the underlying type is a map.
virtual boolToObject(Binder * binder, void * object, ObjectInfo * typeInfo) const override
Convert the property value to an object type information. Conversion should succeed only when the underlying type is an object (UserType).

Public Functions inherited from cohtml::Property

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.
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 inherited from cohtml::Property

Name
const char *m_Name
boolm_IsByRef
inline AdjustPointer(
const char * name,
int offset
)
inline AdjustPointer(
const AdjustPointer & o
)
inline virtual void * Bind(
Binder * binder,
void * object
) const override

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

Reimplements: cohtml::Property::Bind

inline virtual void * BindValue(
Binder * binder,
void * object
) const override

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

Note: This method should always bind a value. If there is no valid value, the implementation must call binder->BindNull();

Reimplements: cohtml::Property::BindValue

inline virtual void * Read(
Binder * binder,
void * object
) const override

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

Reimplements: cohtml::Property::Read

inline virtual void * ReadValue(
Binder * binder,
void * object
) const override

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

Reimplements: cohtml::Property::ReadValue

inline virtual AdjustPointer * Clone() const override

Clone the property.

Return: a heap allocated copy of the property

Reimplements: cohtml::Property::Clone

inline virtual bool ToBoolean(
void * object,
bool * boolean
) const override

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

Reimplements: cohtml::Property::ToBoolean

inline virtual bool ToNumber(
void * object,
float * number
) const override

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

Reimplements: cohtml::Property::ToNumber

inline virtual bool ToNumber(
void * object,
double * number
) const override

Convert the property value to a number with double precision.

Parameters:

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

Return: true if conversion is possible and successful

Warning: The base implementation uses ToNumber(void*, float*), which truncates the value to a float and is retained only for backwards compatibility. This method will become pure virtual in the future, so derived classes must override it.

Reimplements: cohtml::Property::ToNumber

inline virtual bool ToString(
void * object,
char * buffer,
size_t * length
) const override

Convert the property value to a string representation.

Parameters:

  • object - object to get the property value from
  • buffer - character buffer to receive the string data
  • length - input/output parameter; on input, specifies the size of buffer in bytes; on output, receives the total size required to store the full string (not including any null terminator)

Return: true if conversion is possible and successful

Note: The function writes up to *length bytes into buffer. These may or may not include a null terminator. The caller should append “\0’` if required. If the returned size is greater than the provided buffer capacity, the caller should allocate a larger buffer and call again.

Reimplements: cohtml::Property::ToString

inline virtual bool ToColor(
void * object,
renoir::Color * color
) const override

Convert the property value to a color value. Implementation is optional. Provides improved performance for data-bind-style-* attributes that accept color values, such as background-color.

Parameters:

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

Return: true if conversion is possible and successful

Reimplements: cohtml::Property::ToColor

inline virtual bool ToTransformMatrix2D(
void * object,
float matrix[6]
) const override

Convert the property value to a matrix. Implementation is optional. Provides improved performance for data-bind-style-transform2d.

Parameters:

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

Return: true if conversion is possible and successful

Reimplements: cohtml::Property::ToTransformMatrix2D

inline virtual bool ToArray(
Binder * binder,
void * object,
ArrayInfo * arrayInfo
) const override

Convert the property value to an array type information. Conversion should succeed only when the underlying type is an array.

Parameters:

  • binder - the binder to use
  • object - object to get the property value from
  • arrayInfo - output parameter. Information about array type - callbacks, properties, methods

Return: true if conversion is possible and successful

Reimplements: cohtml::Property::ToArray

inline virtual bool ToPair(
Binder * binder,
void * object,
PairInfo * pairInfo
) const override

Convert the property value to a pair type information. Conversion should succeed only when the underlying type is a pair.

Parameters:

  • binder - the binder to use
  • object - object to get the property value from
  • pairInfo - output parameter. Information about pair type - callbacks, properties, methods

Return: true if conversion is possible and successful

Reimplements: cohtml::Property::ToPair

inline virtual bool ToMap(
Binder * binder,
void * object,
MapInfo * mapInfo
) const override

Convert the property value to a map type information. Conversion should succeed only when the underlying type is a map.

Parameters:

  • binder - the binder to use
  • object - object to get the property value from
  • mapInfo - output parameter. Information about map type - callbacks, properties, methods

Return: true if conversion is possible and successful

Reimplements: cohtml::Property::ToMap

inline virtual bool ToObject(
Binder * binder,
void * object,
ObjectInfo * typeInfo
) const override

Convert the property value to an object type information. Conversion should succeed only when the underlying type is an object (UserType).

Parameters:

  • binder - the binder to use
  • object - object to get the property value from
  • typeInfo - output parameter. Information about object type - properties and methods if it’s user defined type

Return: true if conversion is possible and successful

Reimplements: cohtml::Property::ToObject