Method CreateStructType
CreateStructType(String)
Create an opaque structure type (e.g. a forward reference)
Declaration
public IStructType CreateStructType(string name)
Parameters
public IStructType CreateStructType(string name)
String | name | Name of the type (use Empty for anonymous types) |
Returns
IStructType | New type |
Remarks
This method creates an opaque type. The SetBody(Boolean, ITypeRef[]) method provides a means to add a body, including indication of packed status, to an opaque type at a later time if the details of the body are required. (If only pointers to the type are required then the body isn't required)
CreateStructType(Boolean, ITypeRef[])
Create an anonymous structure type (e.g. Tuple)
Declaration
public IStructType CreateStructType(bool packed, params ITypeRef[] elements)
Parameters
public IStructType CreateStructType(bool packed, params ITypeRef[] elements)
Boolean | packed | Flag to indicate if the structure is "packed" |
ITypeRef[] | elements | Types of the 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 a complete 0 sized struct is created
CreateStructType(String, Boolean, IEnumerable<ITypeRef>)
Creates a new structure type in this Context
Declaration
public IStructType CreateStructType(string name, bool packed, IEnumerable<ITypeRef> elements)
Parameters
public IStructType CreateStructType(string name, bool packed, IEnumerable<ITypeRef> elements)
String | name | Name of the structure (use Empty for anonymous types) |
Boolean | packed | Flag indicating if the structure is packed |
IEnumerable<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 a complete 0 sized struct is created