public class CMetaModel
extends java.lang.Object
For example a pointer in C is specified by its base type and its specification (e.g. base type 'int' and specification '**' makes a pointer on a pointer on integer). Another example are arrays, such as array of chars 'char[]'. Thus, a fully described type has a type signature (e.g. 'int**' or 'char[32]') and related types. The 'int**' pointer references an 'int*' pointer which references an 'int' value and the char[32] array references 'char' values, 32 of them.
This meta model represents a given type specification in a chain of types, such as: 'pointer on' → 'pointer on' → 'int' as representation for 'int**' or 'array of' → 'pointer on' -> 'char' for char*[].
Constructor and Description |
---|
CMetaModel(DNAModel model) |
Modifier and Type | Method and Description |
---|---|
CType |
getArrayType(java.lang.String typename,
java.lang.String typespec) |
static int |
getScalarSize(java.lang.String typeName,
int addressWidth) |
CStruct |
getStruct(int sdnaIndex) |
java.util.ArrayList<CStruct> |
getStructs() |
CType |
getType(java.lang.String typeSignature)
Retrieve a type description for a given type signature.
|
static boolean |
isScalar(java.lang.String typeName) |
public CMetaModel(DNAModel model)
public CType getArrayType(java.lang.String typename, java.lang.String typespec)
public static boolean isScalar(java.lang.String typeName)
public static int getScalarSize(java.lang.String typeName, int addressWidth)
public java.util.ArrayList<CStruct> getStructs()
public CStruct getStruct(int sdnaIndex)
public CType getType(java.lang.String typeSignature)
typeSignature
- Signature of the type (e.g. a struct name such as "Scene" or "Mesh" or a type signature such as "int" or "int*" etc.)