package core:reflect
Index
Types (36)
- Bit_Field
- Enum_Field
- Struct_Field
- Struct_Field_Count_Method
- Struct_Tag
- Type_Info
- Type_Info_Any
- Type_Info_Array
- Type_Info_Bit_Field
- Type_Info_Bit_Set
- Type_Info_Boolean
- Type_Info_Complex
- Type_Info_Dynamic_Array
- Type_Info_Enum
- Type_Info_Enum_Value
- Type_Info_Enumerated_Array
- Type_Info_Float
- Type_Info_Integer
- Type_Info_Map
- Type_Info_Matrix
- Type_Info_Multi_Pointer
- Type_Info_Named
- Type_Info_Parameters
- Type_Info_Pointer
- Type_Info_Procedure
- Type_Info_Quaternion
- Type_Info_Rune
- Type_Info_Simd_Vector
- Type_Info_Slice
- Type_Info_Soa_Pointer
- Type_Info_String
- Type_Info_Struct
- Type_Info_Tuple
- Type_Info_Type_Id
- Type_Info_Union
- Type_Kind
Constants (1)
Variables (0)
This section is empty.
Procedures (107)
- align_of_typeid
- any_base
- any_core
- any_data
- are_types_identical
- as_bool
- as_bytes
- as_f64
- as_i64
- as_int
- as_pointer
- as_raw_data
- as_string
- as_u64
- as_uint
- backing_type_kind
- bit_field_names
- bit_field_offsets
- bit_field_sizes
- bit_field_tags
- bit_field_types
- bit_fields_zipped
- bit_set_is_big_endian
- capacity
- deref
- enum_field_names
- enum_field_values
- enum_fields_zipped
- enum_from_name
- enum_from_name_any
- enum_name_from_value
- enum_name_from_value_any
- enum_string
- enum_value_has_name
- eq
- equal
- get_union_as_ptr_variants
- get_union_variant
- get_union_variant_raw_tag
- index
- is_any
- is_array
- is_bit_set
- is_boolean
- is_byte
- is_complex
- is_cstring
- is_dynamic_array
- is_dynamic_map
- is_endian_big
- is_endian_little
- is_endian_platform
- is_enum
- is_enumerated_array
- is_float
- is_integer
- is_multi_pointer
- is_nil
- is_parameters
- is_pointer
- is_pointer_internally
- is_procedure
- is_quaternion
- is_raw_union
- is_rune
- is_signed
- is_simd_vector
- is_slice
- is_soa_pointer
- is_string
- is_struct
- is_tuple
- is_union
- is_unsigned
- iterate_array
- iterate_map
- length
- ne
- not_equal
- relative_pointer_to_absolute_raw
- set_union_value
- set_union_variant_raw_tag
- set_union_variant_type_info
- set_union_variant_typeid
- size_of_typeid
- struct_field_at
- struct_field_by_name
- struct_field_count
- struct_field_names
- struct_field_offsets
- struct_field_tags
- struct_field_types
- struct_field_value
- struct_field_value_by_name
- struct_fields_zipped
- struct_tag_get
- struct_tag_lookup
- type_info_union_is_pure_maybe
- type_kind
- typeid_elem
- underlying_type_kind
- union_variant_type_info
- union_variant_typeid
- write_type_builder
- write_type_writer
- write_typeid_builder
- write_typeid_writer
Procedure Groups (2)
Types
Bit_Field ¶
Bit_Field :: struct { name: string, type: ^runtime.Type_Info, size: uintptr, // Size in bits offset: uintptr, // Offset in bits tag: Struct_Tag, }
Enum_Field ¶
Enum_Field :: struct { name: string, value: runtime.Type_Info_Enum_Value, }
Struct_Field ¶
Struct_Field :: struct { name: string, type: ^runtime.Type_Info, tag: Struct_Tag, offset: uintptr, is_using: bool, }
Related Procedures With Parameters
Related Procedures With Returns
Struct_Field_Count_Method ¶
Struct_Field_Count_Method :: enum int { Top_Level, Using, Recursive, }
Related Procedures With Parameters
Struct_Tag ¶
Struct_Tag :: distinct string
Struct_Tag represents the type of the string of a struct field
Through convention, tags are the concatenation of optionally space separationed key:"value" pairs. Each key is a non-empty string which contains no control characters other than space, quotes, and colon.
Related Procedures With Parameters
Type_Info ¶
Type_Info :: runtime.Type_Info
Type_Info_Any ¶
Type_Info_Any :: runtime.Type_Info_Any
Type_Info_Array ¶
Type_Info_Array :: runtime.Type_Info_Array
Type_Info_Bit_Field ¶
Type_Info_Bit_Field :: runtime.Type_Info_Bit_Field
Type_Info_Bit_Set ¶
Type_Info_Bit_Set :: runtime.Type_Info_Bit_Set
Type_Info_Boolean ¶
Type_Info_Boolean :: runtime.Type_Info_Boolean
Type_Info_Complex ¶
Type_Info_Complex :: runtime.Type_Info_Complex
Type_Info_Dynamic_Array ¶
Type_Info_Dynamic_Array :: runtime.Type_Info_Dynamic_Array
Type_Info_Enum ¶
Type_Info_Enum :: runtime.Type_Info_Enum
Type_Info_Enum_Value ¶
Type_Info_Enum_Value :: runtime.Type_Info_Enum_Value
Type_Info_Enumerated_Array ¶
Type_Info_Enumerated_Array :: runtime.Type_Info_Enumerated_Array
Type_Info_Float ¶
Type_Info_Float :: runtime.Type_Info_Float
Type_Info_Integer ¶
Type_Info_Integer :: runtime.Type_Info_Integer
Type_Info_Map ¶
Type_Info_Map :: runtime.Type_Info_Map
Type_Info_Matrix ¶
Type_Info_Matrix :: runtime.Type_Info_Matrix
Type_Info_Multi_Pointer ¶
Type_Info_Multi_Pointer :: runtime.Type_Info_Multi_Pointer
Type_Info_Named ¶
Type_Info_Named :: runtime.Type_Info_Named
Type_Info_Parameters ¶
Type_Info_Parameters :: runtime.Type_Info_Parameters
Type_Info_Pointer ¶
Type_Info_Pointer :: runtime.Type_Info_Pointer
Type_Info_Procedure ¶
Type_Info_Procedure :: runtime.Type_Info_Procedure
Type_Info_Quaternion ¶
Type_Info_Quaternion :: runtime.Type_Info_Quaternion
Type_Info_Rune ¶
Type_Info_Rune :: runtime.Type_Info_Rune
Type_Info_Simd_Vector ¶
Type_Info_Simd_Vector :: runtime.Type_Info_Simd_Vector
Type_Info_Slice ¶
Type_Info_Slice :: runtime.Type_Info_Slice
Type_Info_Soa_Pointer ¶
Type_Info_Soa_Pointer :: runtime.Type_Info_Soa_Pointer
Type_Info_String ¶
Type_Info_String :: runtime.Type_Info_String
Type_Info_Struct ¶
Type_Info_Struct :: runtime.Type_Info_Struct
Type_Info_Tuple ¶
Type_Info_Tuple :: runtime.Type_Info_Parameters
Type_Info_Type_Id ¶
Type_Info_Type_Id :: runtime.Type_Info_Type_Id
Type_Info_Union ¶
Type_Info_Union :: runtime.Type_Info_Union
Type_Kind ¶
Type_Kind :: enum int { Invalid, Named, Integer, Rune, Float, Complex, Quaternion, String, Boolean, Any, Type_Id, Pointer, Multi_Pointer, Procedure, Array, Enumerated_Array, Dynamic_Array, Slice, Tuple, Struct, Union, Enum, Map, Bit_Set, Simd_Vector, Matrix, Soa_Pointer, Bit_Field, }
Related Procedures With Returns
Constants
DEFAULT_EQUAL_MAX_RECURSION_LEVEL ¶
DEFAULT_EQUAL_MAX_RECURSION_LEVEL :: 32
Variables
This section is empty.
Procedures
backing_type_kind ¶
TODO(bill): Better name
bit_field_tags ¶
bit_field_tags :: proc(T: typeid) -> []Struct_Tag {…}
bit_set_is_big_endian ¶
bit_set_is_big_endian :: proc(value: any, loc := #caller_location) -> bool {…}
enum_field_values ¶
enum_field_values :: proc(Enum_Type: typeid) -> []runtime.Type_Info_Enum_Value {…}
enum_fields_zipped ¶
enum_fields_zipped :: proc(Enum_Type: typeid) -> (fields: #soa[]Enum_Field) {…}
enum_from_name ¶
Given a enum type and a value name, get the enum value.
enum_from_name_any ¶
enum_from_name_any :: proc(Enum_Type: typeid, name: string) -> (value: runtime.Type_Info_Enum_Value, ok: bool) {…}
enum_value_has_name ¶
enum_value_has_name :: proc(value: $T) -> bool {…}
Returns whether the value given has a defined name in the enum type.
get_union_as_ptr_variants ¶
get_union_as_ptr_variants :: proc(val: ^$T) -> (res: $T) {…}
struct_field_at ¶
struct_field_at :: proc(T: typeid, i: int) -> (field: Struct_Field) {…}
struct_field_by_name ¶
struct_field_by_name :: proc(T: typeid, name: string) -> (field: Struct_Field) {…}
struct_field_count ¶
struct_field_count :: proc(T: typeid, method: Struct_Field_Count_Method = Struct_Field_Count_Method.Top_Level) -> (count: int) {…}
Counts the number of fields in a struct
This procedure returns the number of fields in a struct, counting in one of three ways:
.Top_Level: Only counts the top-level fields
.Using: Same count as .Top_Level, and adds the field count of any using s: Struct
it encounters (in addition to itself)
.Recursive: The count of all top-level fields, plus the count of any child struct's fields, recursively
Inputs:
T: The struct type
method: The counting method
Returns:
The count
, enumerated using the method
, which will be 0
if the type is not a struct
Example:
symbols_loaded, ok := dynlib.initialize_symbols(&game_api, "game.dll")
symbols_expected := reflect.struct_field_count(Game_Api) - API_PRIVATE_COUNT
if symbols_loaded != symbols_expected {
fmt.eprintf("Expected %v symbols, got %v", symbols_expected, symbols_loaded)
return
}
struct_field_tags ¶
struct_field_tags :: proc(T: typeid) -> []Struct_Tag {…}
struct_field_value ¶
struct_field_value :: proc(a: any, field: Struct_Field) -> any {…}
struct_fields_zipped ¶
struct_fields_zipped :: proc(T: typeid) -> (fields: #soa[]Struct_Field) {…}
struct_tag_get ¶
struct_tag_get :: proc(tag: Struct_Tag, key: string) -> (value: string) {…}
struct_tag_lookup ¶
struct_tag_lookup :: proc(tag: Struct_Tag, key: string) -> (value: string, ok: bool) {…}
type_info_union_is_pure_maybe ¶
type_info_union_is_pure_maybe :: proc(info: runtime.Type_Info_Union) -> bool {…}
underlying_type_kind ¶
TODO(bill): Better name
Procedure Groups
write_type ¶
write_type :: proc{ write_type_builder, write_type_writer, }
write_typeid ¶
write_typeid :: proc{ write_typeid_builder, write_typeid_writer, }
Source Files
Generation Information
Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-17 21:11:01.214913300 +0000 UTC