Code Map
module core.typeinfo;
//! The types of Volt, the type field of TypeInfo.
enum Type
{
Struct,
Class,
Interface,
Union,
Enum,
Attribute,
Void,
U8,
I8,
Char,
Bool,
U16,
I16,
Wchar,
U32,
I32,
Dchar,
F32,
U64,
I64,
F64,
Real,
Pointer,
Array,
StaticArray,
AA,
Function,
Delegate,
}
//! Information for a type that can be retrieved at runtime.
class TypeInfo
{
public:
//! The size of the type, in bytes.
size: size_t;
//! The specific type. A member of the Type enum.
type: i32;
//! The Volt mangled name (if any)
mangledName: char[];
//! Can this type mutate memory?
mutableIndirection: bool;
//! The class init struct, if this points at a class.
classInit: void*;
//! The size of the class, if this points at a class.
classSize: size_t;
//! The base type for arrays (dynamic and static), and pointers.
base: TypeInfo;
//! If this points at a static array, how long is it?
staticArrayLength: size_t;
key: TypeInfo;
//! The key and value types for AAs.
value: TypeInfo;
//! For functions and delegates, what's the return type?
ret: TypeInfo;
//! For functions and delegates, what are the parameter types?
args: TypeInfo[];
public:
this() { }
}
//! A TypeInfo used by classes.
class ClassInfo : TypeInfo
{
public:
//! The interfaces the class this refers to implements.
interfaces: InterfaceInfo[];
public:
this() { }
}
//! Type information for interfaces.
class InterfaceInfo
{
public:
//! The tinfo for the pointed at interface.
info: TypeInfo;
//! How many bytes after the vtable does the information for this
//! interface lie?
offset: size_t;
public:
this() { }
}
The types of Volt, the type
field of TypeInfo
.
Information for a type that can be retrieved at runtime.
This is the object that the typeid
expression returns.
The size of the type, in bytes.
The specific type. A member of the Type
enum.
The Volt mangled name (if any)
Can this type mutate memory?
The class init struct, if this points at a class.
The size of the class, if this points at a class.
The base type for arrays (dynamic and static), and pointers.
If this points at a static array, how long is it?
The key and value types for AAs.
For functions and delegates, what's the return type?
For functions and delegates, what are the parameter types?
A TypeInfo used by classes.
The interfaces the class this refers to implements.
Type information for interfaces.
The tinfo for the pointed at interface.
How many bytes after the vtable does the information for this interface lie?