class asIScriptStruct { public: // Memory management int AddRef(); int Release(); // Struct type int GetStructTypeId(); // Struct properties int GetPropertyCount(); int GetPropertyTypeId(asUINT prop); const char *GetPropertyName(asUINT prop); void *GetPropertyPointer(asUINT prop); int CopyFrom(asIScriptStruct *other); };
int AddRef();
This method increases the internal reference counter of the object and returns the count. The returned value shouldn't be used for anything else but debugging.
Call AddRef() each time you assign a reference to a new variable.
The internal reference counter.
int Release();
Decreases the internal reference counter and returns the count. If the counter reaches 0 the object is deleted and the memory is freed.
After calling Release() don't forget to set your reference to 0 so that you don't mistakenly try to use the reference again.
The internal reference counter.
int GetStructTypeId();
Returns the type id of the script structure.
The type id.
int GetPropertyCount();
Use this method to determine how many properties this structure has.
The number of properties.
int GetPropertyTypeId(asUINT prop);
Use the returned type id, to determine how to handle the property pointer.
prop |
The zero based index of the property of interest. |
If the index is within range, then the method returns the type id of the property, otherwise the value will be negative.
const char *GetPropertyName(asUINT prop);
The method returns a string with the name of the property as declared in the script.
prop |
The zero based index of the property of interest. |
A pointer to the string, or null if out of range.
void *GetPropertyPointer(asUINT prop);
The method returns a pointer to the memory location for the property. Use the type id for the property to determine the content of the pointer, and how to handle it.
prop |
The zero based index of the property of interest. |
A pointer to the property.
int CopyFrom(asIScriptStruct *other);
This method copies the contents of the other object to this one.
other |
A pointer to the other struct object. |
A negative value on error.