AngelScript
|
The interface for an object type.
Public Member Functions | |
Miscellaneous | |
virtual asIScriptEngine * | GetEngine () const =0 |
Returns a pointer to the script engine. More... | |
virtual const char * | GetConfigGroup () const =0 |
Returns the config group in which the type was registered. More... | |
virtual asDWORD | GetAccessMask () const =0 |
Returns the access mask for this type. More... | |
virtual asIScriptModule * | GetModule () const =0 |
Returns the module where the type is declared. More... | |
Memory management | |
virtual int | AddRef () const =0 |
Increases the reference counter. More... | |
virtual int | Release () const =0 |
Decrease reference counter. More... | |
Type info | |
virtual const char * | GetName () const =0 |
Returns a temporary pointer to the name of the datatype. More... | |
virtual const char * | GetNamespace () const =0 |
Return the namespace of the object type. More... | |
virtual asIObjectType * | GetBaseType () const =0 |
Returns the object type that this type derives from. More... | |
virtual bool | DerivesFrom (const asIObjectType *objType) const =0 |
Returns true if the type inherits directly or indirectly from the informed type. More... | |
virtual asDWORD | GetFlags () const =0 |
Returns the object type flags. More... | |
virtual asUINT | GetSize () const =0 |
Returns the size of the object type. More... | |
virtual int | GetTypeId () const =0 |
Returns the type id for the object type. More... | |
virtual int | GetSubTypeId (asUINT subTypeIndex=0) const =0 |
Returns the type id of the template sub type. More... | |
virtual asIObjectType * | GetSubType (asUINT subTypeIndex=0) const =0 |
Returns the template subtype, in case it is an object type. More... | |
virtual asUINT | GetSubTypeCount () const =0 |
Returns the number of template sub types. More... | |
Interfaces | |
virtual asUINT | GetInterfaceCount () const =0 |
Returns the number of interfaces implemented. More... | |
virtual asIObjectType * | GetInterface (asUINT index) const =0 |
Returns a temporary pointer to the specified interface or null if none are found. More... | |
virtual bool | Implements (const asIObjectType *objType) const =0 |
Returns true if the type implements the informed interface type. More... | |
Factories | |
virtual asUINT | GetFactoryCount () const =0 |
Returns the number of factory functions for the object type. More... | |
virtual asIScriptFunction * | GetFactoryByIndex (asUINT index) const =0 |
Returns the factory function by the index. More... | |
virtual asIScriptFunction * | GetFactoryByDecl (const char *decl) const =0 |
Returns the factory function by the declaration. More... | |
Methods | |
virtual asUINT | GetMethodCount () const =0 |
Returns the number of methods for the object type. More... | |
virtual asIScriptFunction * | GetMethodByIndex (asUINT index, bool getVirtual=true) const =0 |
Returns the method by index. More... | |
virtual asIScriptFunction * | GetMethodByName (const char *name, bool getVirtual=true) const =0 |
Returns the method by name. More... | |
virtual asIScriptFunction * | GetMethodByDecl (const char *decl, bool getVirtual=true) const =0 |
Returns the method by declaration. More... | |
Properties | |
virtual asUINT | GetPropertyCount () const =0 |
Returns the number of properties that the object contains. More... | |
virtual int | GetProperty (asUINT index, const char **name, int *typeId=0, bool *isPrivate=0, bool *isProtected=0, int *offset=0, bool *isReference=0, asDWORD *accessMask=0) const =0 |
Returns the attributes of the property. More... | |
virtual const char * | GetPropertyDeclaration (asUINT index, bool includeNamespace=false) const =0 |
Returns the declaration of the property. More... | |
Behaviours | |
virtual asUINT | GetBehaviourCount () const =0 |
Returns the number of behaviours. More... | |
virtual asIScriptFunction * | GetBehaviourByIndex (asUINT index, asEBehaviours *outBehaviour) const =0 |
Returns the function and type of the behaviour. More... | |
User data | |
virtual void * | SetUserData (void *data, asPWORD type=0)=0 |
Register the memory address of some user data. More... | |
virtual void * | GetUserData (asPWORD type=0) const =0 |
Returns the address of the previously registered user data. More... | |
|
pure virtual |
Call this method when storing an additional reference to the object.
|
pure virtual |
[in] | objType | The potential parent type. |
|
pure virtual |
|
pure virtual |
This method will only return a pointer in case of script classes that derives from another script class.
This does not increase the reference count of the returned object type.
|
pure virtual |
[in] | index | The index of the behaviour. |
[out] | outBehaviour | Receives the type of the behaviour. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
[in] | decl | The declaration of the function |
|
pure virtual |
[in] | index | The index of the factory function. |
|
pure virtual |
|
pure virtual |
Script classes are identified by having the asOBJ_SCRIPT_OBJECT flag set. Interfaces are identified as a script class with a size of zero.
|
pure virtual |
[in] | index | The interface index. |
|
pure virtual |
|
pure virtual |
[in] | decl | The method signature. |
[in] | getVirtual | Set to true if the virtual method or the real method should be retrieved. |
This method should be used to retrieve the script method for the object that you wish to execute. The method is then sent to the context's Prepare method.
The method will find the script method with the exact same declaration.
|
pure virtual |
[in] | index | The index of the method. |
[in] | getVirtual | Set to true if the virtual method or the real method should be retrieved. |
This method should be used to retrieve the script method for the object that you wish to execute. The method is then sent to the context's Prepare method.
By default this returns the virtual method for script classes. This will allow you to call the virtual method on classes, and rely on the polymorphism to call the correct implementation. If you wish to inspect the real method, then you should set the second parameter to false to retrieve the real method.
|
pure virtual |
[in] | name | The name of the method. |
[in] | getVirtual | Set to true if the virtual method or the real method should be retrieved. |
This method should be used to retrieve the script method for the object that you wish to execute. The method is then sent to the context's Prepare method.
|
pure virtual |
|
pure virtual |
The returned value can be null if the module doesn't exist anymore.
|
pure virtual |
|
pure virtual |
|
pure virtual |
[in] | index | The index of the property |
[out] | name | The name of the property |
[out] | typeId | The type of the property |
[out] | isPrivate | Whether the property is private or not |
[out] | isProtected | Whether the property is protected or not |
[out] | offset | The offset into the object where the property is stored |
[out] | isReference | True if the property is not stored inline |
[out] | accessMask | The access mask of the property |
asINVALID_ARG | The index is out of bounds |
|
pure virtual |
|
pure virtual |
[in] | index | The index of the property |
[in] | includeNamespace | Set to true if the namespace should be included in the declaration. |
|
pure virtual |
Application registered reference types doesn't store this information, as the script engine doesn't allocate memory for these itself.
|
pure virtual |
[in] | subTypeIndex | The zero based index of the template sub type. |
|
pure virtual |
|
pure virtual |
[in] | subTypeIndex | The zero based index of the template sub type. |
asERROR | The type is not a template type. |
|
pure virtual |
|
pure virtual |
[in] | type | An identifier used to identify which user data to get. |
|
pure virtual |
[in] | objType | The interface type. |
|
pure virtual |
Call this method when you will no longer use the references that you own.
|
pure virtual |
[in] | data | A pointer to the user data. |
[in] | type | An identifier used to identify which user data to set. |
This method allows the application to associate a value, e.g. a pointer, with the object type instance. Multiple different values can be defined where the type argument identifies which is referred to.
The user data types identifiers between 1000 and 1999 are reserved for use by official add-ons.
Optionally, a callback function can be registered to clean up the user data when the object type is destroyed.