11. Runtime type information library

The RTTI module reflects runtime type information to daScript. It also exposes daScript compiler infrastructure to daScript runtime.

All functions and symbols are in “rtti” module, use require to get access to it.

require rtti

11.1. Type aliases

ProgramFlags is a bitfield

field

bit

value

failToCompile

0

1

_unsafe

1

2

isCompiling

2

4

isSimulating

3

8

isCompilingMacros

4

16

needMacroModule

5

32

Flags which represent state of the Program object, both during and after compilation.

context_category_flags is a bitfield

field

bit

value

dead

0

1

debug_context

1

2

thread_clone

2

4

job_clone

3

8

opengl

4

16

debugger_tick

5

32

debugger_attached

6

64

Flags which specify type of the Context.

TypeInfoFlags is a bitfield

field

bit

value

ref

0

1

refType

1

2

canCopy

2

4

isPod

3

8

isRawPod

4

16

isConst

5

32

isTemp

6

64

isImplicit

7

128

refValue

8

256

hasInitValue

9

512

isSmartPtr

10

1024

isSmartPtrNative

11

2048

isHandled

12

4096

heapGC

13

8192

stringHeapGC

14

16384

lockCheck

15

32768

Flags which specify properties of the TypeInfo object (any rtti type).

StructInfoFlags is a bitfield

field

bit

value

_class

0

1

_lambda

1

2

heapGC

2

4

stringHeapGC

3

8

lockCheck

4

16

Flags which represent properties of the StructInfo object (rtti object which represents structure type).

RttiValue is a variant type

tBool

bool

tInt

int

tUInt

uint

tInt64

int64

tUInt64

uint64

tFloat

float

tDouble

double

tString

string

nothing

any

Variant type which represents value of any annotation arguments and variable annotations.

FileAccessPtr = smart_ptr<rtti::FileAccess>

smart_ptr<FileAccess>, i.e pointer to the FileAccess object.

11.2. Constants

FUNCINFO_INIT = 0x1

Function flag which indicates that function is called during the Context initialization.

FUNCINFO_BUILTIN = 0x2

Function flag which indicates that function is a built-in function.

FUNCINFO_PRIVATE = 0x4

Function flag which indicates that function is private.

FUNCINFO_SHUTDOWN = 0x8

Function flag which indicates that function is called during the Context shutdown.

11.3. Enumerations

CompilationError

unspecified

0

mismatching_parentheses

10001

mismatching_curly_bracers

10002

string_constant_exceeds_file

10003

string_constant_exceeds_line

10004

unexpected_close_comment

10005

integer_constant_out_of_range

10006

comment_contains_eof

10007

invalid_escape_sequence

10008

invalid_line_directive

10009

syntax_error

20000

malformed_ast

20001

invalid_type

30101

invalid_return_type

30102

invalid_argument_type

30103

invalid_structure_field_type

30104

invalid_array_type

30105

invalid_table_type

30106

invalid_argument_count

30107

invalid_variable_type

30108

invalid_new_type

30109

invalid_index_type

30110

invalid_annotation

30111

invalid_swizzle_mask

30112

invalid_initialization_type

30113

invalid_with_type

30114

invalid_override

30115

invalid_name

30116

invalid_array_dimension

30117

invalid_iteration_source

30118

invalid_loop

30119

invalid_label

30120

invalid_enumeration

30121

invalid_option

30122

invalid_member_function

30123

function_already_declared

30201

argument_already_declared

30202

local_variable_already_declared

30203

global_variable_already_declared

30204

structure_field_already_declared

30205

structure_already_declared

30206

structure_already_has_initializer

30207

enumeration_already_declared

30208

enumeration_value_already_declared

30209

type_alias_already_declared

30210

field_already_initialized

30211

type_not_found

30301

structure_not_found

30302

operator_not_found

30303

function_not_found

30304

variable_not_found

30305

handle_not_found

30306

annotation_not_found

30307

enumeration_not_found

30308

enumeration_value_not_found

30309

type_alias_not_found

30310

bitfield_not_found

30311

cant_initialize

30401

cant_dereference

30501

cant_index

30502

cant_get_field

30503

cant_write_to_const

30504

cant_move_to_const

30505

cant_write_to_non_reference

30506

cant_copy

30507

cant_move

30508

cant_pass_temporary

30509

condition_must_be_bool

30601

condition_must_be_static

30602

cant_pipe

30701

invalid_block

30801

return_or_break_in_finally

30802

module_not_found

30901

module_already_has_a_name

30902

cant_new_handle

31001

bad_delete

31002

cant_infer_generic

31100

cant_infer_missing_initializer

31101

cant_infer_mismatching_restrictions

31102

invalid_cast

31200

incompatible_cast

31201

unsafe

31300

index_out_of_range

31400

expecting_return_value

32101

not_expecting_return_value

32102

invalid_return_semantics

32103

invalid_yield

32104

typeinfo_reference

39901

typeinfo_auto

39902

typeinfo_undefined

39903

typeinfo_dim

39904

typeinfo_macro_error

39905

static_assert_failed

40100

run_failed

40101

annotation_failed

40102

concept_failed

40103

not_all_paths_return_value

40200

assert_with_side_effects

40201

only_fast_aot_no_cpp_name

40202

aot_side_effects

40203

no_global_heap

40204

no_global_variables

40205

unused_function_argument

40206

unsafe_function

40207

too_many_infer_passes

41000

missing_node

50100

Enumeration which represents error type for each of the errors which compiler returns and various stages.

Type

none

0

autoinfer

1

alias

2

fakeContext

3

fakeLineInfo

4

anyArgument

5

tVoid

6

tBool

7

tInt64

12

tUInt64

13

tInt

14

tInt2

15

tInt3

16

tInt4

17

tUInt

18

tUInt2

19

tUInt3

20

tUInt4

21

tFloat

22

tFloat2

23

tFloat3

24

tFloat4

25

tDouble

26

tRange

27

tURange

28

tString

29

tStructure

30

tHandle

31

tEnumeration

32

tPointer

36

tFunction

37

tLambda

38

tIterator

39

tArray

40

tTable

41

tBlock

42

tInt8

8

tUInt8

9

tInt16

10

tUInt16

11

tTuple

43

tEnumeration8

33

tEnumeration16

34

tVariant

44

tBitfield

35

One of the fundamental (base) types of any type object.

RefMatters

no

0

yes

1

Yes or no flag which indicates if reference flag of the type matters (during comparison).

ConstMatters

no

0

yes

1

Yes or no flag which indicates if constant flag of the type matters (during comparison).

TemporaryMatters

no

0

yes

1

Yes or no flag which indicates if temporary flag of the type matters (during comparison).

11.4. Handled structures

FileInfo

FileInfo fields are

name

builtin::das_string

tabSize

int

Information about a single file stored in the FileAccess object.

LineInfo

LineInfo fields are

last_column

uint

line

uint

last_line

uint

column

uint

fileInfo

rtti::FileInfo ?

Information about a section of the file stored in the FileAccess object.

Context

Context fields are

breakOnException

bool

exception

string const

category

context_category_flags

alwaysStackWalkOnException

bool

last_exception

string const

name

builtin::das_string

exceptionAt

rtti::LineInfo

Context properties are

totalVariables

int

totalFunctions

int

Object which holds single daScript Context. Context is the result of the simulation of the daScript program.

Error

Error fields are

fixme

builtin::das_string

at

rtti::LineInfo

what

builtin::das_string

extra

builtin::das_string

cerr

rtti::CompilationError

Object which holds information about compilation error or exception.

FileAccess

Object which holds collection of files as well as means to access them (Project).

Module

Module fields are

name

builtin::das_string

Collection of types, aliases, functions, classes, macros etc under a single namespace.

ModuleGroup

Collection of modules.

Program

Program fields are

thisModuleName

builtin::das_string

errors

builtin::dasvector`Error

flags

ProgramFlags

Object representing full information about daScript program during and after compilation (but not the simulated result of the program).

AnnotationArgument

AnnotationArgument fields are

fValue

float

at

rtti::LineInfo

iValue

int

name

builtin::das_string

sValue

builtin::das_string

bValue

bool

basicType

rtti::Type

Single argument of the annotation, typically part of the AnnotationArgumentList.

Annotation

Annotation fields are

_module

rtti::Module ?

cppName

builtin::das_string

name

builtin::das_string

Annotation properties are

isFunctionAnnotation

bool

isStructureTypeAnnotation

bool

isTypeAnnotation

bool

isEnumerationAnnotation

bool

isStructureAnnotation

bool

isBasicStructureAnnotation

bool

Handled type or macro.

AnnotationDeclaration

AnnotationDeclaration fields are

annotation

smart_ptr< rtti::Annotation >

arguments

rtti::AnnotationArgumentList

at

rtti::LineInfo

Annotation declaration, its location, and arguments.

TypeAnnotation

TypeAnnotation fields are

_module

rtti::Module ?

cppName

builtin::das_string

name

builtin::das_string

TypeAnnotation properties are

is_any_vector

bool

Handled type.

BasicStructureAnnotation

BasicStructureAnnotation fields are

cppName

builtin::das_string

name

builtin::das_string

BasicStructureAnnotation properties are

fieldCount

int

Handled type which represents structure-like object.

EnumValueInfo

EnumValueInfo fields are

value

int64

name

string

Single element of enumeration, its name and value.

EnumInfo

EnumInfo fields are

count

uint

name

string

module_name

string

hash

uint64

Type object which represents enumeration.

StructInfo

StructInfo fields are

init_mnh

uint64

size

uint

count

uint

name

string

module_name

string

hash

uint64

flags

StructInfoFlags

Type object which represents structure or class.

TypeInfo

TypeInfo fields are

argTypes

rtti::TypeInfo ??

size

uint

secondType

rtti::TypeInfo ?

dimSize

uint

enumType

rtti::EnumInfo ?

hash

uint64

argNames

string?

argCount

uint

basicType

rtti::Type

firstType

rtti::TypeInfo ?

structType

rtti::StructInfo ?

flags

TypeInfoFlags

TypeInfo properties are

isConst

bool

annotation

rtti::TypeAnnotation ?

isRawPod

bool

isRef

bool

isImplicit

bool

isRefType

bool

isPod

bool

isTemp

bool

isRefValue

bool

canCopy

bool

Object which represents any daScript type.

VarInfo

VarInfo fields are

argTypes

rtti::TypeInfo ??

size

uint

value

any

secondType

rtti::TypeInfo ?

dimSize

uint

enumType

rtti::EnumInfo ?

name

string

hash

uint64

argNames

string?

argCount

uint

sValue

string

offset

uint

basicType

rtti::Type

firstType

rtti::TypeInfo ?

annotation_arguments

rtti::AnnotationArguments const? const

structType

rtti::StructInfo ?

flags

TypeInfoFlags

VarInfo properties are

isConst

bool

annotation

rtti::TypeAnnotation ?

isRawPod

bool

isRef

bool

isImplicit

bool

isRefType

bool

isPod

bool

isTemp

bool

isRefValue

bool

canCopy

bool

Object which represents variable declaration.

LocalVariableInfo

LocalVariableInfo fields are

visibility

rtti::LineInfo

argTypes

rtti::TypeInfo ??

size

uint

secondType

rtti::TypeInfo ?

dimSize

uint

localFlags

LocalVariableInfoFlags

enumType

rtti::EnumInfo ?

stackTop

uint

name

string

hash

uint64

argNames

string?

argCount

uint

basicType

rtti::Type

firstType

rtti::TypeInfo ?

structType

rtti::StructInfo ?

flags

TypeInfoFlags

LocalVariableInfo properties are

isConst

bool

annotation

rtti::TypeAnnotation ?

isRawPod

bool

isRef

bool

isImplicit

bool

isRefType

bool

isPod

bool

isTemp

bool

isRefValue

bool

canCopy

bool

Object which represents local variable declaration.

FuncInfo

FuncInfo fields are

locals

rtti::LocalVariableInfo ??

stackSize

uint

result

rtti::TypeInfo ?

count

uint

cppName

string

name

string

hash

uint64

localCount

uint

flags

uint

Object which represents function declaration.

SimFunction

SimFunction fields are

stackSize

uint

mangledNameHash

uint64

mangledName

string

name

string

debugInfo

rtti::FuncInfo ?

flags

SimFunctionFlags

Object which represents simulated function in the Context.

CodeOfPolicies

CodeOfPolicies fields are

aot_module

bool

fail_on_no_aot

bool

fail_on_lack_of_aot_export

bool

debugger

bool

aot_order_side_effects

bool

rtti

bool

ignore_shared_modules

bool

aot

bool

allow_shared_lambda

bool

multiple_contexts

bool

allow_local_variable_shadowing

bool

heap_size_hint

uint

persistent_heap

bool

no_global_heap

bool

intern_strings

bool

no_optimizations

bool

allow_block_variable_shadowing

bool

no_unused_function_arguments

bool

stack

uint

no_unused_block_arguments

bool

smart_pointer_by_value_unsafe

bool

solid_context

bool

no_global_variables

bool

string_heap_size_hint

uint

no_unsafe

bool

local_ref_is_unsafe

bool

no_global_variables_at_all

bool

only_fast_aot

bool

default_module_public

bool

Object which holds compilation and simulation settings and restrictions.

11.5. Typeinfo macros

rtti_typeinfo

Generates TypeInfo for the given expression or type.

11.6. Handled types

AnnotationArguments

List of annotation arguments.

AnnotationArgumentList

List of annotation arguments and properties.

AnnotationList

List of all annotations attached to the object (function or structure).

11.7. Initialization and finalization

LineInfo()

LineInfo returns rtti::LineInfo

LineInfo initializer.

LineInfo(arg0: rtti::FileInfo? const implicit; arg1: int const; arg2: int const; arg3: int const; arg4: int const)

LineInfo returns rtti::LineInfo

argument

argument type

arg0

rtti::FileInfo ? const implicit

arg1

int const

arg2

int const

arg3

int const

arg4

int const

LineInfo initializer.

CodeOfPolicies()

CodeOfPolicies returns rtti::CodeOfPolicies

CodeOfPolicies initializer.

using(arg0: block<(rtti::CodeOfPolicies# explicit):void> const implicit)

argument

argument type

arg0

block<( rtti::CodeOfPolicies #):void> const implicit

Creates object which can be used inside of the block scope.

using(arg0: block<(rtti::ModuleGroup# explicit):void> const implicit)

argument

argument type

arg0

block<( rtti::ModuleGroup #):void> const implicit

Creates object which can be used inside of the block scope.

RttiValue_nothing()

RttiValue_nothing returns auto

Constructs new RttiValue of type ‘nothing’.

11.8. Type access

get_dim(typeinfo: TypeInfo const implicit; index: int const)

get_dim returns int

argument

argument type

typeinfo

rtti::TypeInfo const implicit

index

int const

Get dim property of the type, i.e. size of the static array.

get_dim(typeinfo: VarInfo const implicit; index: int const)

get_dim returns int

argument

argument type

typeinfo

rtti::VarInfo const implicit

index

int const

Get dim property of the type, i.e. size of the static array.

builtin_is_same_type(a: rtti::TypeInfo const? const implicit; b: rtti::TypeInfo const? const implicit; refMatters: RefMatters const; cosntMatters: ConstMatters const; tempMatters: TemporaryMatters const; topLevel: bool const)

builtin_is_same_type returns bool

argument

argument type

a

rtti::TypeInfo const? const implicit

b

rtti::TypeInfo const? const implicit

refMatters

rtti::RefMatters const

cosntMatters

rtti::ConstMatters const

tempMatters

rtti::TemporaryMatters const

topLevel

bool const

Returns true if two TypeInfo objects are the same given comparison criteria.

is_compatible_cast(from: rtti::StructInfo const? const implicit; to: rtti::StructInfo const? const implicit)

is_compatible_cast returns bool

argument

argument type

from

rtti::StructInfo const? const implicit

to

rtti::StructInfo const? const implicit

Returns true if from type can be casted to to type.

get_das_type_name(type: Type const)

get_das_type_name returns string

argument

argument type

type

rtti::Type const

Returns name of the Type object.

is_same_type(a: TypeInfo const; b: TypeInfo const; refMatters: RefMatters const; constMatters: ConstMatters const; temporaryMatters: TemporaryMatters const; topLevel: bool const)

is_same_type returns auto

argument

argument type

a

rtti::TypeInfo const

b

rtti::TypeInfo const

refMatters

rtti::RefMatters const

constMatters

rtti::ConstMatters const

temporaryMatters

rtti::TemporaryMatters const

topLevel

bool const

Returns true if two TypeInfo objects are the same given comparison criteria.

is_compatible_cast(a: StructInfo const; b: StructInfo const)

is_compatible_cast returns auto

argument

argument type

a

rtti::StructInfo const

b

rtti::StructInfo const

Returns true if from type can be casted to to type.

each_dim(info: TypeInfo const)

each_dim returns auto

argument

argument type

info

rtti::TypeInfo const

Iterates through all dim values of the rtti type object, i.e. through all size properties of the array.

each_dim(info: VarInfo const)

each_dim returns auto

argument

argument type

info

rtti::VarInfo const

Iterates through all dim values of the rtti type object, i.e. through all size properties of the array.

arg_types(info: TypeInfo const)

arg_types returns auto

argument

argument type

info

rtti::TypeInfo const

Iterates through argument types of the rtti type object.

arg_types(info: VarInfo const)

arg_types returns auto

argument

argument type

info

rtti::VarInfo const

Iterates through argument types of the rtti type object.

arg_names(info: TypeInfo const)

arg_names returns auto

argument

argument type

info

rtti::TypeInfo const

Iterates through argument names of the rtti type object.

arg_names(info: VarInfo const)

arg_names returns auto

argument

argument type

info

rtti::VarInfo const

Iterates through argument names of the rtti type object.

11.9. Rtti context access

get_total_functions(context: Context implicit)

get_total_functions returns int

argument

argument type

context

rtti::Context implicit

Get total number of functions in the context.

get_total_variables(context: Context implicit)

get_total_variables returns int

argument

argument type

context

rtti::Context implicit

Get total number of global variables in the context.

get_function_info(context: any const; index: int const)

get_function_info returns rtti::FuncInfo const&

argument

argument type

context

any const

index

int const

Get function declaration info by index.

get_variable_info(context: any const; index: int const)

get_variable_info returns rtti::VarInfo const&

argument

argument type

context

any const

index

int const

Get global variable type information by variable index.

get_variable_value(varInfo: VarInfo const implicit)

get_variable_value returns RttiValue

argument

argument type

varInfo

rtti::VarInfo const implicit

Return RttiValue which represents value of the global variable.

get_function_info(context: Context implicit; function: function<> const)

get_function_info returns rtti::FuncInfo const? const

argument

argument type

context

rtti::Context implicit

function

function<> const

Get function declaration info by index.

get_function_by_mnh(context: Context implicit; MNH: uint64 const)

get_function_by_mnh returns function<>

argument

argument type

context

rtti::Context implicit

MNH

uint64 const

Returns SimFunction by mangled name hash.

get_line_info()

get_line_info returns rtti::LineInfo

Returns LineInfo object for the current line (line where get_line_info is called from).

get_line_info(depth: int const)

get_line_info returns rtti::LineInfo

argument

argument type

depth

int const

Returns LineInfo object for the current line (line where get_line_info is called from).

this_context()

this_context returns rtti::Context &

Returns current Context object.

context_for_each_function(blk: block<(info:rtti::FuncInfo const):void> const)

context_for_each_function returns auto

argument

argument type

blk

block<(info: rtti::FuncInfo const):void> const

Iterates through all functions in the Context.

context_for_each_variable(blk: block<(info:rtti::VarInfo const):void> const)

context_for_each_variable returns auto

argument

argument type

blk

block<(info: rtti::VarInfo const):void> const

Iterates through all variables in the Context.

class_info(cl: auto const)

class_info returns rtti::StructInfo const?

argument

argument type

cl

auto const

Returns StructInfo?` for the class.

type_info(vinfo: LocalVariableInfo const)

type_info returns rtti::TypeInfo const?

argument

argument type

vinfo

rtti::LocalVariableInfo const

Returns TypeInfo object for the local variable.

type_info(vinfo: VarInfo const)

type_info returns rtti::TypeInfo const?

argument

argument type

vinfo

rtti::VarInfo const

Returns TypeInfo object for the local variable.

11.10. Program access

get_this_module(program: smart_ptr<rtti::Program> const implicit)

get_this_module returns rtti::Module ?

argument

argument type

program

smart_ptr< rtti::Program > const implicit

Get current Program object currently compiled module.

get_module(name: string const implicit)

get_module returns rtti::Module ?

argument

argument type

name

string const implicit

Get Module object by name.

program_for_each_module(program: smart_ptr<rtti::Program> const implicit; block: block<(rtti::Module?):void> const implicit)

argument

argument type

program

smart_ptr< rtti::Program > const implicit

block

block<( rtti::Module ?):void> const implicit

Iterates through all modules of the Program object.

program_for_each_registered_module(block: block<(rtti::Module?):void> const implicit)

argument

argument type

block

block<( rtti::Module ?):void> const implicit

Iterates through all registered modules of the daScript runtime.

11.11. Module access

module_for_each_structure(module: rtti::Module? const implicit; block: block<(rtti::StructInfo const):void> const implicit)

argument

argument type

module

rtti::Module ? const implicit

block

block<( rtti::StructInfo const):void> const implicit

Iterates through all structure declarations in the Module object.

module_for_each_enumeration(module: rtti::Module? const implicit; block: block<(rtti::EnumInfo const):void> const implicit)

argument

argument type

module

rtti::Module ? const implicit

block

block<( rtti::EnumInfo const):void> const implicit

Iterates through each enumeration in the module.

module_for_each_function(module: rtti::Module? const implicit; block: block<(rtti::FuncInfo const):void> const implicit)

argument

argument type

module

rtti::Module ? const implicit

block

block<( rtti::FuncInfo const):void> const implicit

Iterates through each function in the module.

module_for_each_generic(module: rtti::Module? const implicit; block: block<(rtti::FuncInfo const):void> const implicit)

argument

argument type

module

rtti::Module ? const implicit

block

block<( rtti::FuncInfo const):void> const implicit

Iterates through each generic function in the module.

module_for_each_global(module: rtti::Module? const implicit; block: block<(rtti::VarInfo const):void> const implicit)

argument

argument type

module

rtti::Module ? const implicit

block

block<( rtti::VarInfo const):void> const implicit

Iterates through each global variable in the module.

module_for_each_annotation(module: rtti::Module? const implicit; block: block<(rtti::Annotation const):void> const implicit)

argument

argument type

module

rtti::Module ? const implicit

block

block<( rtti::Annotation const):void> const implicit

Iterates though each handled type in the module.

11.12. Annotation access

get_annotation_argument_value(info: AnnotationArgument const implicit)

get_annotation_argument_value returns RttiValue

argument

argument type

info

rtti::AnnotationArgument const implicit

Returns RttiValue which represents argument value for the specific annotation argument.

add_annotation_argument(annotation: AnnotationArgumentList implicit; name: string const implicit)

add_annotation_argument returns int

argument

argument type

annotation

rtti::AnnotationArgumentList implicit

name

string const implicit

Adds annotation argument to the AnnotationArgumentList object.

11.13. Compilation and simulation

compile(module_name: string const implicit; codeText: string const implicit; codeOfPolicies: CodeOfPolicies const implicit; block: block<(bool;smart_ptr<rtti::Program>;das_string const):void> const implicit)

argument

argument type

module_name

string const implicit

codeText

string const implicit

codeOfPolicies

rtti::CodeOfPolicies const implicit

block

block<(bool;smart_ptr< rtti::Program >; builtin::das_string const):void> const implicit

Compile daScript program given as string.

compile(module_name: string const implicit; codeText: string const implicit; codeOfPolicies: CodeOfPolicies const implicit; exportAll: bool const; block: block<(bool;smart_ptr<rtti::Program>;das_string const):void> const implicit)

argument

argument type

module_name

string const implicit

codeText

string const implicit

codeOfPolicies

rtti::CodeOfPolicies const implicit

exportAll

bool const

block

block<(bool;smart_ptr< rtti::Program >; builtin::das_string const):void> const implicit

Compile daScript program given as string.

compile_file(module_name: string const implicit; fileAccess: smart_ptr<rtti::FileAccess> const implicit; moduleGroup: rtti::ModuleGroup? const implicit; codeOfPolicies: CodeOfPolicies const implicit; block: block<(bool;smart_ptr<rtti::Program>;das_string const):void> const implicit)

argument

argument type

module_name

string const implicit

fileAccess

smart_ptr< rtti::FileAccess > const implicit

moduleGroup

rtti::ModuleGroup ? const implicit

codeOfPolicies

rtti::CodeOfPolicies const implicit

block

block<(bool;smart_ptr< rtti::Program >; builtin::das_string const):void> const implicit

Compile daScript program given as file in the FileAccess object.

for_each_expected_error(program: smart_ptr<rtti::Program> const implicit; block: block<(rtti::CompilationError;int):void> const implicit)

argument

argument type

program

smart_ptr< rtti::Program > const implicit

block

block<( rtti::CompilationError ;int):void> const implicit

Iterates through each compilation error of the Program object.

for_each_require_declaration(program: smart_ptr<rtti::Program> const implicit; block: block<(rtti::Module?;string const#;string const#;bool;rtti::LineInfo const&):void> const implicit)

argument

argument type

program

smart_ptr< rtti::Program > const implicit

block

block<( rtti::Module ?;string const#;string const#;bool; rtti::LineInfo const&):void> const implicit

Iterates though each require declaration of the compiled program.

simulate(program: smart_ptr<rtti::Program> const& implicit; block: block<(bool;smart_ptr<rtti::Context>;das_string):void> const implicit)

argument

argument type

program

smart_ptr< rtti::Program > const& implicit

block

block<(bool;smart_ptr< rtti::Context >; builtin::das_string ):void> const implicit

Simulates daScript program and creates ‘Context’ object.

11.14. File access

make_file_access(project: string const implicit)

make_file_access returns smart_ptr< rtti::FileAccess >

argument

argument type

project

string const implicit

Creates new FileAccess object.

set_file_source(access: smart_ptr<rtti::FileAccess> const implicit; fileName: string const implicit; text: string const implicit)

set_file_source returns bool

argument

argument type

access

smart_ptr< rtti::FileAccess > const implicit

fileName

string const implicit

text

string const implicit

Sets source for the specified file in the FileAccess object.

add_file_access_root(access: smart_ptr<rtti::FileAccess> const implicit; mod: string const implicit; path: string const implicit)

add_file_access_root returns bool

argument

argument type

access

smart_ptr< rtti::FileAccess > const implicit

mod

string const implicit

path

string const implicit

Add extra root directory (search path) to the FileAccess object.

11.15. Structure access

rtti_builtin_structure_for_each_annotation(struct: StructInfo const implicit; block: block<> const implicit)

argument

argument type

struct

rtti::StructInfo const implicit

block

block<> const implicit

Iterates through each annotation for the Structure object.

basic_struct_for_each_field(annotation: BasicStructureAnnotation const implicit; block: block<(string;string;rtti::TypeInfo const;uint):void> const implicit)

argument

argument type

annotation

rtti::BasicStructureAnnotation const implicit

block

block<(string;string; rtti::TypeInfo const;uint):void> const implicit

Iterates through each field of the structure object.

structure_for_each_annotation(st: StructInfo const; subexpr: block<(ann:rtti::Annotation const;args:rtti::AnnotationArguments const):void> const)

structure_for_each_annotation returns auto

argument

argument type

st

rtti::StructInfo const

subexpr

block<(ann: rtti::Annotation const;args: rtti::AnnotationArguments const):void> const

Iterates through each annotation for the Structure object.

11.16. Data walking and printing

sprint_data(data: void? const implicit; type: rtti::TypeInfo const? const implicit; flags: bitfield const)

sprint_data returns string

argument

argument type

data

void? const implicit

type

rtti::TypeInfo const? const implicit

flags

bitfield<> const

Prints data given TypeInfo and returns result as a string, similar to print function.

sprint_data(data: float4 const; type: rtti::TypeInfo const? const implicit; flags: bitfield const)

sprint_data returns string

argument

argument type

data

float4 const

type

rtti::TypeInfo const? const implicit

flags

bitfield<> const

Prints data given TypeInfo and returns result as a string, similar to print function.

describe(type: rtti::TypeInfo const? const implicit)

describe returns string

argument

argument type

type

rtti::TypeInfo const? const implicit

Describe rtti object and return data as string.

describe(lineinfo: LineInfo const implicit; fully: bool const)

describe returns string

argument

argument type

lineinfo

rtti::LineInfo const implicit

fully

bool const

Describe rtti object and return data as string.

get_mangled_name(type: rtti::TypeInfo const? const implicit)

get_mangled_name returns string

argument

argument type

type

rtti::TypeInfo const? const implicit

Returns mangled name of the function.

11.17. Function and mangled name hash

get_function_by_mangled_name_hash(src: uint64 const)

get_function_by_mangled_name_hash returns function<>

argument

argument type

src

uint64 const

Returns function<> given mangled name hash.

get_function_mangled_name_hash(src: function<> const)

get_function_mangled_name_hash returns uint64

argument

argument type

src

function<> const

Returns mangled name hash of the function<> object.