Method CreateStructType
CreateStructType(String)
Create an empty structure type
Declaration
public IStructType CreateStructType(string name)
Parameters
public IStructType CreateStructType(string name)
String | name | Name of the type |
Returns
IStructType | New type |
CreateStructType(Boolean, ITypeRef, ITypeRef[])
Create an anonymous structure type (e.g. Tuple)
Declaration
public IStructType CreateStructType(bool packed, [ValidatedNotNull] ITypeRef element0, params ITypeRef[] elements)
Parameters
public IStructType CreateStructType(bool packed, [ValidatedNotNull] ITypeRef element0, params ITypeRef[] elements)
Boolean | packed | Flag to indicate if the structure is "packed" |
ITypeRef | element0 | Type of the first field of the structure |
ITypeRef[] | elements | Types of any additional fields of the structure |
Returns
IStructType | IStructType with the specified body defined. |
CreateStructType(String, Boolean, ITypeRef[])
Creates a new structure type in this Context
Declaration
public IStructType CreateStructType(string name, bool packed, params ITypeRef[] elements)
Parameters
public IStructType CreateStructType(string name, bool packed, params ITypeRef[] elements)
String | name | Name of the structure |
Boolean | packed | Flag indicating if the structure is packed |
ITypeRef[] | elements | Types for the structures elements in layout order |
Returns
IStructType | IStructType with the specified body defined. |
Remarks
If the elements argument list is empty then an opaque type is created (e.g. a forward reference) The SetBody(Boolean, ITypeRef[]) method provides a means to add a body to an opaque type at a later time if the details of the body are required. (If only pointers to to the type are required the body isn't required)