TTypeId
Type ID
Represents a type. Type IDs can be compared for equality to find out if two types are equal.
Methods
Method SuperType:TTypeId()
Get super type
When called on an interface type ID, this method alwayss returns Object. To get the super interfaces of an interface, use Interfaces.
Method Interfaces:TList(list:TList = Null)
Get list of implemented interfaces of a class, or super interfaces of an interface.
Method UnderlyingType:TTypeId()
Get underlying type
Returns the underlying integral type of an enum type.
Method ArrayType:TTypeId(dims:Int = 1)
Get array type with this element type
Method ElementType:TTypeId()
Get element type
Method Dimensions:Int()
Get number of array dimensions
Method PointerType:TTypeId()
Get pointer type with this element type
Method VarType:TTypeId()
Get var type with this element type
Method FunctionType:TTypeId(argTypes:TTypeId[] = Null)
Get function type with this return type
Method ReturnType:TTypeId()
Get function return type
Method ArgTypes:TTypeId[]()
Get function argument types
Method ExtendsType:Int(typeId:TTypeId)
Determine if this type extends, implements, or equals another type
Method DerivedTypes:TList(list:TList = Null)
Get list of derived types
Method NewObject:Object()
Create a new object
Creates a new instance of this type with the default constructor. Can be used to create objects and struct instances. This method can not be used on array type IDs. To create an array, use NewArray instead.
Method NewObject:Object(constructor:TMethod, args:Object[])
Create a new object with the given constructor
Creates a new instance of this type by calling constructor, which must be one of the constructors for this type.
To get a list of available constructors, use FindMethods("New").
Can be used to create objects and struct instances.
This method can not be used on array type IDs. To create an array, use NewArray instead.
Method IsReferenceType:Int()
Determine if type is a reference type
Method IsValueType:Int()
Determine if type is a value type
Returns True for Var types
Method IsClass:Int()
Determine if type is a class
Method IsInterface:Int()
Determine if type is an interface
Method IsStruct:Int()
Determine if type is a struct
Method IsEnum:Int()
Determine if type is an enum
Method IsFlagsEnum:Int()
Determine if type is a flags enum
Method IsAbstract:Int()
Determine if type is abstract
Method IsFinal:Int()
Determine if type is final
Method IsArrayType:Int()
Determine if type is an array type
Method Constants:TList(list:TList = Null)
Get list of constants
Only returns constants declared in this type, not in super types.
Method Fields:TList(list:TList = Null)
Get list of fields
Only returns fields declared in this type, not in super types.
Method Globals:TList(list:TList = Null)
Get list of globals
Only returns globals declared in this type, not in super types.
Method Functions:TList(list:TList = Null)
Get list of functions
Only returns functions declared in this type, not in super types.
Method Methods:TList(list:TList = Null)
Get list of methods
Only returns methods declared in this type, not in super types.
Method FindConstant:TConstant(name:String)
Find a constant by name
Searches type hierarchy for a constant called name.
Method FindField:TField(name:String)
Find a field by name
Searches type hierarchy for a field called name.
Method FindGlobal:TGlobal(name:String)
Find a global by name
Searches type hierarchy for a global called name.
Method FindFunction:TFunction(name:String)
Find a function by name
Searches type hierarchy for a function called name.
If the function is overloaded, the first overload declared in the most derived type will be returned.
Method FindFunction:TFunction(name:String, argTypes:TTypeId[])
Find a specific overload of a function by name and parameter list
Searches type hierarchy for a function called name with the specified argument types.
This can be used to find a specific overload of a function.
Method FindFunctions:TList(name:String, list:TList = Null)
Find all overloads of a function by name
Searches type hierarchy for a function called name.
Same as FindFunction, except it returns all overloads of the function.
If an existing list is passed, retains the elements in that list and appends the results to the end. Otherwise, creates a new list.
Method FindMethod:TMethod(name:String)
Find a method by name
Searches type hierarchy for a method called name.
If the method is overloaded, the first overload declared in the most derived type will be returned.
Method FindMethod:TMethod(name:String, argTypes:TTypeId[])
Find a specific overload of a method by name and parameter list
Searches type hierarchy for a method called name with the specified argument types.
This can be used to find a specific overload of a method.
Method FindMethods:TList(name:String, list:TList = Null)
Find all overloads of a method by name
Searches type hierarchy for a method called name.
Same as FindMethod, except it returns all overloads of the method.
If an existing list is passed, retains the elements in that list and appends the results to the end. Otherwise, creates a new list.
Method EnumConstants:TList(list:TList = Null)
Enumerate all constants
Returns a list of all constants in type hierarchy.
If an existing list is passed, retains the elements in that list and appends the results to the end. Otherwise, creates a new list.
Method EnumFields:TList(list:TList = Null)
Enumerate all fields
Returns a list of all fields in type hierarchy.
If an existing list is passed, retains the elements in that list and appends the results to the end. Otherwise, creates a new list.
Method EnumGlobals:TList(list:TList = Null)
Enumerate all globals
Returns a list of all globals in type hierarchy.
If an existing list is passed, retains the elements in that list and appends the results to the end. Otherwise, creates a new list.
Method EnumFunctions:TList(list:TList = Null)
Enumerate all functions
Returns a list of all functions in type hierarchy, excluding ones that have been overridden.
If an existing list is passed, retains the elements in that list and appends the results to the end. Otherwise, creates a new list.
Method EnumMethods:TList(list:TList = Null)
Enumerate all methods
Returns a list of all methods in type hierarchy, excluding ones that have been overridden. Does not include unimplemented methods from interfaces implemented by this type.
If an existing list is passed, retains the elements in that list and appends the results to the end. Otherwise, creates a new list.
Method NullValue:Object()
Get Null value
For reference types, this returns the object. For structs, it returns a TBoxedValue. For other value types, it returns a string representation of the value.
Method NullValueBoxed:Object()
Get Null value
Like NullValue, but always returns a TBoxedValue for value types instead of converting the value to a string.
Method NewArray:Object(length:Int = 0, dims:Int[] = Null)
Create a new array
This method should only be called on an array type ID.
If dims is not specified, this method will create a one-dimensional array with length elements.
Otherwise, length is ignored and a new array with dimensions as specified by dims is created.
The elements of the array are not initialized to valid values.
Method ArraySlice:Object( _array:Object, _start:Int, _end:Int )
Slice an array
Method GetArrayElement:Object(_array:Object, index:Int)
Get an array element
This method should only be called on the type ID corresponding to the type of the array. For arrays of reference types, this returns the object from the array. For structs, it returns a TBoxedValue. For other value types, it returns a string representation of the value.
Method GetBoxedArrayElement:Object(_array:Object, index:Int)
Get an array element
This method should only be called on the type ID corresponding to the type of the array. Like Get, but always returns a TBoxedValue for arrays of value types instead of converting the value to a string.
Method GetStringArrayElement:String( _array:Object,index:Int )
Get an array element as String
This method should only be called on the type ID corresponding to the type of the array.
Method GetEnumArrayElementAsString:String( _array:Object,index:Int )
Get an array element as enum name String
This method should only be called on the type ID corresponding to the type of the array.
Method GetByteArrayElement:Byte( _array:Object,index:Int )
Get an array element as Byte
Method GetShortArrayElement:Short( _array:Object,index:Int )
Get an array element as Short
Method GetIntArrayElement:Int( _array:Object,index:Int )
Get an array element as Int
Method GetUIntArrayElement:UInt( _array:Object,index:Int )
Get an array element as UInt
Method GetLongArrayElement:Long( _array:Object,index:Int )
Get an array element as Long
Method GetULongArrayElement:ULong( _array:Object,index:Int )
Get an array element as ULong
Method GetSizeTArrayElement:Size_T( _array:Object,index:Int )
Get an array element as Size_T
Method GetFloatArrayElement:Float( _array:Object,index:Int )
Get an array element as Float
Method GetDoubleArrayElement:Double( _array:Object,index:Int )
Get an array element as Double
Method GetLongIntArrayElement:LongInt( _array:Object,index:Int )
Get an array element as LongInt
Method GetULongIntArrayElement:ULongInt( _array:Object,index:Int )
Get an array element as ULongInt
Method SetArrayElement(_array:Object, index:Int, value:Object)
Set an array element
This method should only be called on the type ID corresponding to the type of the array.
Method SetArrayElement( _array:Object,index:Int,value:Byte )
Set an array element from Byte
Method SetArrayElement( _array:Object,index:Int,value:Short )
Set an array element from Short
Method SetArrayElement( _array:Object,index:Int,value:Int )
Set an array element from Int
Method SetArrayElement( _array:Object,index:Int,value:UInt )
Set an array element from UInt
Method SetArrayElement( _array:Object,index:Int,value:Long )
Set an array element from Long
Method SetArrayElement( _array:Object,index:Int,value:ULong )
Set an array element from ULong
Method SetArrayElement( _array:Object,index:Int,value:Size_T )
Set an array element from Size_T
Method SetArrayElement( _array:Object,index:Int,value:Float )
Set an array element from Float
Method SetArrayElement( _array:Object,index:Int,value:Double )
Set an array element from Double
Method SetArrayElement( _array:Object,index:Int,value:LongInt )
Set an array element from LongInt
Method SetArrayElement( _array:Object,index:Int,value:ULongInt )
Set an array element from ULongInt
Method SetEnumArrayElement( _array:Object,index:Int,value:String )
Set an enum array element from String
Method SetByteArrayElement( _array:Object,index:Int,value:Byte )
Set an array element from Byte
Method SetShortArrayElement( _array:Object,index:Int,value:Short )
Set an array element from Short
Method SetIntArrayElement( _array:Object,index:Int,value:Int )
Set an array element from Int
Method SetUIntArrayElement( _array:Object,index:Int,value:UInt )
Set an array element from UInt
Method SetLongArrayElement( _array:Object,index:Int,value:Long )
Set an array element from Long
Method SetULongArrayElement( _array:Object,index:Int,value:ULong )
Set an array element from ULong
Method SetSizeTArrayElement( _array:Object,index:Int,value:Size_T )
Set an array element from Size_T
Method SetFloatArrayElement( _array:Object,index:Int,value:Float )
Set an array element from Float
Method SetDoubleArrayElement( _array:Object,index:Int,value:Double )
Set an array element from Double
Method SetLongIntArrayElement( _array:Object,index:Int,value:LongInt )
Set an array element from LongInt
Method SetULongIntArrayElement( _array:Object,index:Int,value:ULongInt )
Set an array element from ULongInt
Method SetStringArrayElement( _array:Object,index:Int,value:String )
Set an array element from String
Method Size:Size_T()
Size of the type in bytes
For reference types such as classes and interfaces, this function will return the size of the reference (equal to the size of PointerTypeId), not the size of the pointed to instance.
Functions
Function ArrayLength:Int(_array:Object, dim:Int = 0)
Get length of an array
Function ArrayDimensions:Int(_array:Object)
Get the number of dimensions of an array
Function ForName:TTypeId(name:String)
Get type by name
Function ForObject:TTypeId(obj:Object)
Get type by object
Function EnumTypes:TList()
Get list of all data types currently used in this program
Function EnumClasses:TList()
Get a list of all class types
Does not include array types.
Function EnumInterfaces:TList()
Get a list of all interface types
Function EnumStructs:TList()
Get a list of all struct types
Function EnumEnums:TList()
Get a list of all enum types
