index

Reference: Object types

asOBJ_REF
asOBJ_VALUE
asOBJ_GC
asOBJ_POD
asOBJ_NOHANDLE
asOBJ_APP_CLASS
asOBJ_APP_CLASS_CONSTRUCTOR
asOBJ_APP_CLASS_DESTRUCTOR
asOBJ_APP_CLASS_ASSIGNMENT
asOBJ_APP_PRIMITIVE
asOBJ_APP_FLOAT

asOBJ_REF

The object type should be treated as a reference type, i.e. it allows object handles to be taken and held.

Objects of this type cannot be passed by value to the application.

asOBJ_VALUE

The object type should be treated as a value type, i.e. it doesn't allow references to be held longer than the scope of the variable.

Objects of this type can be passed by value to the application, and must thus define how the type is treated by the application through the use of the asOBJ_APP_?? flags.

asOBJ_GC

This flag tells AngelScript that the object should be handled by the garbage collector. This flag can only be used together with asOBJ_REF.

asOBJ_POD

This flag tells AngelScript that the object is a binary structure that doesn't need special behaviour for initialization, uninitialization, and or copying. Combined with asOBJ_VALUE it will allow the use of the type without the need for registration of the asBEHAVE_CONSTRUCT, asBEHAVE_DESTRUCT, and asBEHAVE_ASSIGNMENT.

asOBJ_NOHANDLE

This flag tells AngelScript that the object type, although a reference type, doesn't allow handles to be used. This means that variables of this type cannot be instanciated in the script, only registered as property from the application. This is ideal for registering singleton classes.

asOBJ_APP_CLASS

The object is a class, structure, or union. This flag can optionally be combined with asOBJ_APP_CLASS_CONSTRUCTOR, asOBJ_APP_CLASS_DESTRUCTOR, and/or asOBJ_APP_CLASS_ASSIGNMENT.

There is also a short name for each of the combinations in the form of asOBJ_APP_CLASS_C, asOBJ_APP_CLASS_CD, asOBJ_APP_CLASS_CDA, etc.

asOBJ_APP_CLASS_CONSTRUCTOR

The class has a constructor.

asOBJ_APP_CLASS_DESTRUCTOR

The class has a destructor.

asOBJ_APP_CLASS_ASSIGNMENT

The class has an overloaded assignment operator.

asOBJ_APP_PRIMITIVE

The object is really a primitive type, e.g. int, char, pointer, etc. All primitive types except float and double should use this flag.

asOBJ_APP_FLOAT

The object is really a float or a double.

top