cohtml::ArrayInfo
On this page
Represents an array of a type exposed to the scripting.
#include <Property.h>
Public Attributes
| Name | |
|---|---|
| ElementType | Type Type of the elements in the array. |
| LengthGetter | GetLength Callback that returns the number of elements in the array. |
| ElementGetter | GetElement Callback that returns the element at the specified index. |
| ArrayElementBinder | BindElement Callback that binds the element at the specified index. It’s the same bind callback passed to TryBindArrayByRef. Used in the data binding for resolving arrays of complex types, such as arrays of strings, polymorphic arrays, nested arrays and arrays of other containers. |
| TypeInfo * | ArrayTypeInfo Type information for elements when Type is ET_UserType; null otherwise. |
| void * | UserData Pointer to the underlying array or container. May represent the actual container or an abstraction defined by the property implementation. |
Public Attributes Documentation
variable Type
ElementType Type;
Type of the elements in the array.
variable GetLength
LengthGetter GetLength;
Callback that returns the number of elements in the array.
variable GetElement
ElementGetter GetElement;
Callback that returns the element at the specified index.
Warning: When ElementType is a primitive type, except ET_String, GetElement must return a pointer to an actual value of that type. The SDK may cast it directly to that type when used; for example for ET_Boolean: (bool*)arrayInfo.GetElement(arrayInfo.UserData, index). The pointer returned by GetElement is not cached by the SDK and should remain valid only for the duration of the call, unless Safe data binding is disabled.
variable BindElement
ArrayElementBinder BindElement;
Callback that binds the element at the specified index. It’s the same bind callback passed to TryBindArrayByRef. Used in the data binding for resolving arrays of complex types, such as arrays of strings, polymorphic arrays, nested arrays and arrays of other containers.
Warning: Arrays that rely on BindElement may incur additional overhead due to JavaScript-side binding. If this is a concern, wrap the nested type in a class/struct instead of using it directly (e.g. use vector<Wrapper> where Wrapper contains the std::variant).
variable ArrayTypeInfo
TypeInfo * ArrayTypeInfo;
Type information for elements when Type is ET_UserType; null otherwise.
variable UserData
void * UserData;
Pointer to the underlying array or container. May represent the actual container or an abstraction defined by the property implementation.