11. Runtime type information library¶
The RTTI module reflects runtime type information to Daslang. It also exposes Daslang compiler infrastructure to Daslang 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 |
promoteToBuiltin |
6 |
64 |
isDependency |
7 |
128 |
macroException |
8 |
256 |
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 |
macro_context |
7 |
128 |
folding_context |
8 |
256 |
audio |
9 |
512 |
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 |
isPrivate |
16 |
65536 |
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).
-
ModuleFlags is a bitfield
¶
field |
bit |
value |
---|---|---|
builtIn |
0 |
1 |
promoted |
1 |
2 |
isPublic |
2 |
4 |
isModule |
3 |
8 |
isSolidContext |
4 |
16 |
doNotAllowUnsafe |
5 |
32 |
Flags which represent the module’s state.
-
AnnotationDeclarationFlags is a bitfield
¶
field |
bit |
value |
---|---|---|
inherited |
0 |
1 |
Flags which represent properties of the AnnotationDeclaration object.
-
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<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.
-
FUNCINFO_LATE_INIT = 0x20
¶
Function flag which indicates that function initialization is ordered via custom init order.
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 |
option |
3 |
typeDecl |
4 |
typeMacro |
5 |
fakeContext |
6 |
fakeLineInfo |
7 |
anyArgument |
8 |
tVoid |
9 |
tBool |
10 |
tInt8 |
11 |
tUInt8 |
12 |
tInt16 |
13 |
tUInt16 |
14 |
tInt64 |
15 |
tUInt64 |
16 |
tInt |
17 |
tInt2 |
18 |
tInt3 |
19 |
tInt4 |
20 |
tUInt |
21 |
tUInt2 |
22 |
tUInt3 |
23 |
tUInt4 |
24 |
tFloat |
25 |
tFloat2 |
26 |
tFloat3 |
27 |
tFloat4 |
28 |
tDouble |
29 |
tRange |
30 |
tURange |
31 |
tRange64 |
32 |
tURange64 |
33 |
tString |
34 |
tStructure |
35 |
tHandle |
36 |
tEnumeration |
37 |
tEnumeration8 |
38 |
tEnumeration16 |
39 |
tEnumeration64 |
40 |
tBitfield |
41 |
tPointer |
42 |
tFunction |
43 |
tLambda |
44 |
tIterator |
45 |
tArray |
46 |
tTable |
47 |
tBlock |
48 |
tTuple |
49 |
tVariant |
50 |
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 |
|
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 |
|
Information about a section of the file stored in the FileAccess object.
-
Context
¶
Context fields are
breakOnException |
bool |
exception |
string const |
category |
|
alwaysErrorOnException |
bool |
alwaysStackWalkOnException |
bool |
contextMutex |
|
last_exception |
string const |
name |
|
exceptionAt |
|
Context property operators are
totalFunctions |
int |
totalVariables |
int |
getCodeAllocatorId |
uint64 |
Object which holds single Daslang Context. Context is the result of the simulation of the Daslang program.
-
Error
¶
Error fields are
fixme |
|
at |
|
what |
|
extra |
|
cerr |
|
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
moduleFlags |
|
name |
|
Collection of types, aliases, functions, classes, macros etc under a single namespace.
-
ModuleGroup
¶
Collection of modules.
-
AnnotationArgument
¶
AnnotationArgument fields are
fValue |
float |
at |
|
iValue |
int |
name |
|
sValue |
|
bValue |
bool |
basicType |
|
Single argument of the annotation, typically part of the AnnotationArgumentList.
-
Program
¶
Program fields are
thisModuleName |
|
_options |
|
errors |
vector<Error> |
flags |
|
Object representing full information about Daslang program during and after compilation (but not the simulated result of the program).
-
Annotation
¶
Annotation fields are
_module |
|
cppName |
|
name |
|
Annotation property operators are
isTypeAnnotation |
bool |
isBasicStructureAnnotation |
bool |
isStructureAnnotation |
bool |
isStructureTypeAnnotation |
bool |
isFunctionAnnotation |
bool |
isEnumerationAnnotation |
bool |
Handled type or macro.
-
AnnotationDeclaration
¶
AnnotationDeclaration fields are
annotation |
smart_ptr< rtti::Annotation > |
arguments |
|
at |
|
flags |
|
Annotation declaration, its location, and arguments.
-
TypeAnnotation
¶
TypeAnnotation fields are
_module |
|
cppName |
|
name |
|
TypeAnnotation property operators are
is_any_vector |
bool |
canMove |
bool |
canCopy |
bool |
canClone |
bool |
isPod |
bool |
isRawPod |
bool |
isRefType |
bool |
hasNonTrivialCtor |
bool |
hasNonTrivialDtor |
bool |
hasNonTrivialCopy |
bool |
canBePlacedInContainer |
bool |
isLocal |
bool |
canNew |
bool |
canDelete |
bool |
needDelete |
bool |
canDeletePtr |
bool |
isIterable |
bool |
isShareable |
bool |
isSmart |
bool |
avoidNullPtr |
bool |
sizeOf |
uint64 |
alignOf |
uint64 |
Handled type.
-
BasicStructureAnnotation
¶
BasicStructureAnnotation fields are
name |
|
cppName |
|
BasicStructureAnnotation property operators are
fieldCount |
int |
Handled type which represents structure-like object.
-
EnumValueInfo
¶
EnumValueInfo fields are
value |
int64 |
name |
string const |
Single element of enumeration, its name and value.
-
EnumInfo
¶
EnumInfo fields are
count |
uint |
name |
string const |
module_name |
string const |
hash |
uint64 |
fields |
|
Type object which represents enumeration.
-
StructInfo
¶
StructInfo fields are
init_mnh |
uint64 |
size |
uint |
count |
uint |
name |
string const |
module_name |
string const |
hash |
uint64 |
firstGcField |
uint |
flags |
|
fields |
|
Type object which represents structure or class.
-
TypeInfo
¶
TypeInfo fields are
argTypes |
|
size |
uint |
secondType |
|
dimSize |
uint |
hash |
uint64 |
argNames |
string const? |
argCount |
uint |
basicType |
|
firstType |
|
flags |
|
TypeInfo property operators are
enumType |
|
isRef |
bool |
isRefType |
bool |
isRefValue |
bool |
canCopy |
bool |
isPod |
bool |
isRawPod |
bool |
isConst |
bool |
isTemp |
bool |
isImplicit |
bool |
annotation |
|
structType |
|
Object which represents any Daslang type.
-
VarInfo
¶
VarInfo fields are
argTypes |
|
size |
uint |
value |
any |
secondType |
|
dimSize |
uint |
nextGcField |
uint |
name |
string const |
hash |
uint64 |
argNames |
string const? |
argCount |
uint |
sValue |
string |
offset |
uint |
basicType |
|
annotation_arguments |
rtti::AnnotationArguments const? const |
firstType |
|
flags |
|
Object which represents variable declaration.
-
LocalVariableInfo
¶
LocalVariableInfo fields are
visibility |
|
argTypes |
|
size |
uint |
secondType |
|
dimSize |
uint |
localFlags |
LocalVariableInfoFlags |
stackTop |
uint |
name |
string const |
hash |
uint64 |
argNames |
string const? |
argCount |
uint |
basicType |
|
firstType |
|
flags |
|
Object which represents local variable declaration.
-
FuncInfo
¶
FuncInfo fields are
locals |
|
stackSize |
uint |
result |
|
count |
uint |
globals |
|
cppName |
string const |
name |
string const |
globalCount |
uint |
hash |
uint64 |
localCount |
uint |
flags |
uint |
Object which represents function declaration.
-
SimFunction
¶
SimFunction fields are
stackSize |
uint |
mangledNameHash |
uint64 |
mangledName |
string |
name |
string |
debugInfo |
|
flags |
SimFunctionFlags |
SimFunction property operators are
lineInfo |
rtti::LineInfo const? const |
Object which represents simulated function in the Context.
-
CodeOfPolicies
¶
CodeOfPolicies fields are
aot_module |
bool |
fail_on_no_aot |
bool |
jit |
bool |
report_invisible_functions |
bool |
no_members_functions_in_struct |
bool |
fail_on_lack_of_aot_export |
bool |
profiler |
bool |
debugger |
bool |
aot_order_side_effects |
bool |
threadlock_context |
bool |
macro_context_collect |
bool |
rtti |
bool |
max_heap_allocated |
uint64 |
ignore_shared_modules |
bool |
no_deprecated |
bool |
aot |
bool |
allow_shared_lambda |
bool |
max_static_variables_size |
uint64 |
allow_local_variable_shadowing |
bool |
multiple_contexts |
bool |
heap_size_hint |
uint |
profile_module |
|
no_init |
bool |
always_report_candidates_threshold |
int |
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 |
smart_pointer_by_value_unsafe |
bool |
no_unused_block_arguments |
bool |
export_all |
bool |
solid_context |
bool |
max_string_heap_allocated |
uint64 |
no_local_class_members |
bool |
no_global_variables |
bool |
completion |
bool |
string_heap_size_hint |
uint |
macro_context_persistent_heap |
bool |
strict_properties |
bool |
no_unsafe |
bool |
jit_module |
|
local_ref_is_unsafe |
bool |
no_aliasing |
bool |
report_private_functions |
bool |
no_global_variables_at_all |
bool |
strict_smart_pointers |
bool |
no_fast_call |
bool |
only_fast_aot |
bool |
debug_module |
|
strict_unsafe_delete |
bool |
default_module_public |
bool |
Object which holds compilation and simulation settings and restrictions.
11.6. Handled types¶
-
recursive_mutex
¶
Holds system-specific recursive mutex object (typically std::recursive_mutex).
-
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: 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.
-
using
(arg0: block<(var arg0:recursive_mutex):void> const implicit)¶
argument |
argument type |
---|---|
arg0 |
block<( rtti::recursive_mutex ):void> const implicit |
Creates object which can be used inside of the block scope.
-
CodeOfPolicies
()
CodeOfPolicies returns rtti::CodeOfPolicies
CodeOfPolicies initializer.
-
using
(arg0: block<(var arg0:CodeOfPolicies):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<(var arg0:ModuleGroup):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: TypeInfo const? const implicit; b: 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.
-
get_type_size
(type: TypeInfo? const implicit)¶
get_type_size returns int
argument |
argument type |
---|---|
type |
rtti::TypeInfo ? const implicit |
Returns size of the type in bytes.
-
get_type_align
(type: TypeInfo? const implicit)¶
get_type_align returns int
argument |
argument type |
---|---|
type |
rtti::TypeInfo ? const implicit |
Returns alignment of the type in bytes.
-
is_compatible_cast
(from: StructInfo const? const implicit; to: 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_function_info (context:any;index:int const) : rtti::FuncInfo const&
get_variable_info (context:any;index:int const) : rtti::VarInfo const&
get_function_by_mnh (context:rtti::Context implicit;MNH:uint64 const) : function<>
get_line_info (depth:int const;context:__context const;line:__lineInfo const) : rtti::LineInfo
context_for_each_function (blk:block<(info:rtti::FuncInfo const):void> const) : auto
context_for_each_variable (blk:block<(info:rtti::VarInfo const):void> const) : auto
type_info (vinfo:rtti::LocalVariableInfo const) : rtti::TypeInfo const?
type_info (vinfo:rtti::VarInfo const) : rtti::TypeInfo const?
-
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; index: int const)¶
get_function_info returns rtti::FuncInfo const&
argument |
argument type |
---|---|
context |
any |
index |
int const |
Get function declaration info by index.
-
get_variable_info
(context: any; index: int const)¶
get_variable_info returns rtti::VarInfo const&
argument |
argument type |
---|---|
context |
any |
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: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: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<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<Program> const implicit; block: block<(var arg0: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<(var arg0:Module?):void> const implicit)¶
argument |
argument type |
---|---|
block |
block<( rtti::Module ?):void> const implicit |
Iterates through all registered modules of the Daslang runtime.
11.11. Module access¶
-
module_for_each_structure
(module: Module? const implicit; block: block<(arg0: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: Module? const implicit; block: block<(arg0: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: Module? const implicit; block: block<(arg0: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: Module? const implicit; block: block<(arg0: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: Module? const implicit; block: block<(arg0: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: Module? const implicit; block: block<(arg0: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<(var arg0:bool;var arg1:smart_ptr<Program>;arg2: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 Daslang program given as string.
-
compile
(module_name: string const implicit; codeText: string const implicit; codeOfPolicies: CodeOfPolicies const implicit; exportAll: bool const; block: block<(var arg0:bool;var arg1:smart_ptr<Program>;arg2: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 Daslang program given as string.
-
compile_file
(module_name: string const implicit; fileAccess: smart_ptr<FileAccess> const implicit; moduleGroup: ModuleGroup? const implicit; codeOfPolicies: CodeOfPolicies const implicit; block: block<(var arg0:bool;var arg1:smart_ptr<Program>;arg2: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 Daslang program given as file in the FileAccess object.
-
for_each_expected_error
(program: smart_ptr<Program> const implicit; block: block<(var arg0:CompilationError;var arg1: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<Program> const implicit; block: block<(var arg0:Module?;arg1:string const#;arg2:string const#;var arg3:bool;arg4: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<Program> const& implicit; block: block<(var arg0:bool;var arg1:smart_ptr<Context>;var arg2: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 Daslang 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<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<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<(var arg0:string;var arg1:string;arg2:TypeInfo const;var arg3: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.
-
basic_struct_for_each_parent
(annotation: BasicStructureAnnotation const implicit; block: block<(var arg0:Annotation?):void> const implicit)¶
argument |
argument type |
---|---|
annotation |
rtti::BasicStructureAnnotation const implicit |
block |
block<( rtti::Annotation ?):void> const implicit |
Iterates through each parent type of the BasicStructureAnnotation object.
-
structure_for_each_annotation
(st: StructInfo const; subexpr: block<(ann:Annotation const;args: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: 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: 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: 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: 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;context:__context const) : function<>
get_function_by_mangled_name_hash (src:uint64 const;context:rtti::Context implicit) : function<>
get_function_mangled_name_hash (src:function<> const;context:__context const) : uint64
get_function_address (MNH:uint64 const;at:rtti::Context implicit) : uint64
-
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_by_mangled_name_hash
(src: uint64 const; context: Context implicit)
get_function_by_mangled_name_hash returns function<>
argument |
argument type |
---|---|
src |
uint64 const |
context |
rtti::Context implicit |
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.
-
get_function_address
(MNH: uint64 const; at: Context implicit)¶
get_function_address returns uint64
argument |
argument type |
---|---|
MNH |
uint64 const |
at |
rtti::Context implicit |
Return function pointer SimFunction * given mangled name hash.
11.18. Context and mutex locking¶
-
lock_this_context
(block: block<void> const implicit)¶
argument |
argument type |
---|---|
block |
block<> const implicit |
Makes recursive critical section of the current Context object.
-
lock_context
(lock_context: Context implicit; block: block<void> const implicit)¶
argument |
argument type |
---|---|
lock_context |
rtti::Context implicit |
block |
block<> const implicit |
Makes recursive critical section of the given Context object.
-
lock_mutex
(mutex: recursive_mutex implicit; block: block<void> const implicit)¶
argument |
argument type |
---|---|
mutex |
rtti::recursive_mutex implicit |
block |
block<> const implicit |
Makes recursive critical section of the given recursive_mutex object.
11.19. Runtime data access¶
-
get_table_key_index
(table: void? const implicit; key: any; baseType: Type const; valueTypeSize: int const)¶
get_table_key_index returns int
argument |
argument type |
---|---|
table |
void? const implicit |
key |
any |
baseType |
rtti::Type const |
valueTypeSize |
int const |
Returns index of the key in the table.
11.20. Uncategorized¶
-
module_for_each_dependency
(module: Module? const implicit; block: block<(var arg0:Module?;var arg1:bool):void> const implicit)¶
argument |
argument type |
---|---|
module |
rtti::Module ? const implicit |
block |
block<( rtti::Module ?;bool):void> const implicit |
Iterates through each dependency of the module.
-
get_tuple_field_offset
(type: TypeInfo? const implicit; index: int const)¶
get_tuple_field_offset returns int
argument |
argument type |
---|---|
type |
rtti::TypeInfo ? const implicit |
index |
int const |
Returns offset of the tuple field.
-
get_variant_field_offset
(type: TypeInfo? const implicit; index: int const)¶
get_variant_field_offset returns int
argument |
argument type |
---|---|
type |
rtti::TypeInfo ? const implicit |
index |
int const |
Returns offset of the variant field.
-
each
(info: FuncInfo implicit ==const)¶
each returns iterator< rtti::VarInfo &>
argument |
argument type |
---|---|
info |
rtti::FuncInfo implicit! |
Iterates through each element of the object.
-
each
(info: FuncInfo const implicit ==const)
each returns iterator< rtti::VarInfo const&>
argument |
argument type |
---|---|
info |
rtti::FuncInfo const implicit! |
Iterates through each element of the object.
-
each
(info: StructInfo implicit ==const)
each returns iterator< rtti::VarInfo &>
argument |
argument type |
---|---|
info |
rtti::StructInfo implicit! |
Iterates through each element of the object.
-
each
(info: StructInfo const implicit ==const)
each returns iterator< rtti::VarInfo const&>
argument |
argument type |
---|---|
info |
rtti::StructInfo const implicit! |
Iterates through each element of the object.
-
each
(info: EnumInfo implicit ==const)
each returns iterator< rtti::EnumValueInfo &>
argument |
argument type |
---|---|
info |
rtti::EnumInfo implicit! |
Iterates through each element of the object.
-
each
(info: EnumInfo const implicit ==const)
each returns iterator< rtti::EnumValueInfo const&>
argument |
argument type |
---|---|
info |
rtti::EnumInfo const implicit! |
Iterates through each element of the object.