package core:reflect

⌘K
Ctrl+K
or
/

    Index

    Variables (0)

    This section is empty.

    Procedures (107)
    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_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

    align_of_typeid ¶

    align_of_typeid :: proc(T: typeid) -> int {…}

    any_base ¶

    any_base :: proc(v: any) -> any {…}

    any_core ¶

    any_core :: proc(v: any) -> any {…}

    any_data ¶

    any_data :: proc(v: any) -> (data: rawptr, id: typeid) {…}

    are_types_identical ¶

    are_types_identical :: proc(a, b: ^runtime.Type_Info) -> bool {…}

    as_bool ¶

    as_bool :: proc(a: any) -> (value: bool, valid: bool) {…}

    as_bytes ¶

    as_bytes :: proc(v: any) -> []u8 {…}

    as_f64 ¶

    as_f64 :: proc(a: any) -> (value: f64, valid: bool) {…}

    as_i64 ¶

    as_i64 :: proc(a: any) -> (value: i64, valid: bool) {…}

    as_int ¶

    as_int :: proc(a: any) -> (value: int, valid: bool) {…}

    as_pointer ¶

    as_pointer :: proc(a: any) -> (value: rawptr, valid: bool) {…}

    as_raw_data ¶

    as_raw_data :: proc(a: any) -> (value: rawptr, valid: bool) {…}

    as_string ¶

    as_string :: proc(a: any) -> (value: string, valid: bool) {…}

    as_u64 ¶

    as_u64 :: proc(a: any) -> (value: u64, valid: bool) {…}

    as_uint ¶

    as_uint :: proc(a: any) -> (value: uint, valid: bool) {…}

    backing_type_kind ¶

    backing_type_kind :: proc(T: typeid) -> Type_Kind {…}
     

    TODO(bill): Better name

    bit_field_names ¶

    bit_field_names :: proc(T: typeid) -> []string {…}

    bit_field_offsets ¶

    bit_field_offsets :: proc(T: typeid) -> []uintptr {…}

    bit_field_sizes ¶

    bit_field_sizes :: proc(T: typeid) -> []uintptr {…}

    bit_field_tags ¶

    bit_field_tags :: proc(T: typeid) -> []Struct_Tag {…}

    bit_field_types ¶

    bit_field_types :: proc(T: typeid) -> []^runtime.Type_Info {…}

    bit_fields_zipped ¶

    bit_fields_zipped :: proc(T: typeid) -> (fields: #soa[]Bit_Field) {…}

    bit_set_is_big_endian ¶

    bit_set_is_big_endian :: proc(value: any, loc := #caller_location) -> bool {…}

    capacity ¶

    capacity :: proc(val: any) -> int {…}

    deref ¶

    deref :: proc(val: any) -> any {…}

    enum_field_names ¶

    enum_field_names :: proc(Enum_Type: typeid) -> []string {…}

    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 ¶

    enum_from_name :: proc($Enum_Type: typeid, name: string) -> (value: typeid, ok: bool) {…}
     

    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_name_from_value ¶

    enum_name_from_value :: proc(value: $T) -> (name: string, ok: bool) {…}

    enum_name_from_value_any ¶

    enum_name_from_value_any :: proc(value: any) -> (name: string, ok: bool) {…}

    enum_string ¶

    enum_string :: proc(a: any) -> string {…}

    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.

    equal ¶

    equal :: proc(a, b: any, including_indirect_array_recursion: bool = false, recursion_level: int = 0) -> bool {…}

    get_union_as_ptr_variants ¶

    get_union_as_ptr_variants :: proc(val: ^$T) -> (res: $T) {…}

    get_union_variant ¶

    get_union_variant :: proc(a: any) -> any {…}

    get_union_variant_raw_tag ¶

    get_union_variant_raw_tag :: proc(a: any) -> i64 {…}

    index ¶

    index :: proc(val: any, i: int, loc := #caller_location) -> any {…}

    is_any ¶

    is_any :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_array ¶

    is_array :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_bit_set ¶

    is_bit_set :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_boolean ¶

    is_boolean :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_byte ¶

    is_byte :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_complex ¶

    is_complex :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_cstring ¶

    is_cstring :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_dynamic_array ¶

    is_dynamic_array :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_dynamic_map ¶

    is_dynamic_map :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_endian_big ¶

    is_endian_big :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_endian_little ¶

    is_endian_little :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_endian_platform ¶

    is_endian_platform :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_enum ¶

    is_enum :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_enumerated_array ¶

    is_enumerated_array :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_float ¶

    is_float :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_integer ¶

    is_integer :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_multi_pointer ¶

    is_multi_pointer :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_nil ¶

    is_nil :: proc(v: any) -> bool {…}

    is_parameters ¶

    is_parameters :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_pointer ¶

    is_pointer :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_pointer_internally ¶

    is_pointer_internally :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_procedure ¶

    is_procedure :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_quaternion ¶

    is_quaternion :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_raw_union ¶

    is_raw_union :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_rune ¶

    is_rune :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_signed ¶

    is_signed :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_simd_vector ¶

    is_simd_vector :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_slice ¶

    is_slice :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_soa_pointer ¶

    is_soa_pointer :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_string ¶

    is_string :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_struct ¶

    is_struct :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_tuple ¶

    is_tuple :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_union ¶

    is_union :: proc(info: ^runtime.Type_Info) -> bool {…}

    is_unsigned ¶

    is_unsigned :: proc(info: ^runtime.Type_Info) -> bool {…}

    iterate_array ¶

    iterate_array :: proc(val: any, it: ^int) -> (elem: any, index: int, ok: bool) {…}

    iterate_map ¶

    iterate_map :: proc(val: any, it: ^int) -> (key, value: any, ok: bool) {…}

    length ¶

    length :: proc(val: any) -> int {…}

    not_equal ¶

    not_equal :: proc(a, b: any, including_indirect_array_recursion: bool = false, recursion_level: int = 0) -> bool {…}

    relative_pointer_to_absolute_raw ¶

    relative_pointer_to_absolute_raw :: proc(data: rawptr, base_integer_id: typeid) -> rawptr {…}

    set_union_value ¶

    set_union_value :: proc(dst: any, value: any) -> bool {…}

    set_union_variant_raw_tag ¶

    set_union_variant_raw_tag :: proc(a: any, tag: i64) {…}

    set_union_variant_type_info ¶

    set_union_variant_type_info :: proc(a: any, tag_ti: ^runtime.Type_Info) {…}

    set_union_variant_typeid ¶

    set_union_variant_typeid :: proc(a: any, id: typeid) {…}

    size_of_typeid ¶

    size_of_typeid :: proc(T: typeid) -> int {…}

    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_names ¶

    struct_field_names :: proc(T: typeid) -> []string {…}

    struct_field_offsets ¶

    struct_field_offsets :: proc(T: typeid) -> []uintptr {…}

    struct_field_tags ¶

    struct_field_tags :: proc(T: typeid) -> []Struct_Tag {…}

    struct_field_types ¶

    struct_field_types :: proc(T: typeid) -> []^runtime.Type_Info {…}

    struct_field_value ¶

    struct_field_value :: proc(a: any, field: Struct_Field) -> any {…}

    struct_field_value_by_name ¶

    struct_field_value_by_name :: proc(a: any, field: string, allow_using: bool = false) -> 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 {…}

    type_kind ¶

    type_kind :: proc(T: typeid) -> Type_Kind {…}

    typeid_elem ¶

    typeid_elem :: proc(id: typeid) -> typeid {…}

    underlying_type_kind ¶

    underlying_type_kind :: proc(T: typeid) -> Type_Kind {…}
     

    TODO(bill): Better name

    union_variant_type_info ¶

    union_variant_type_info :: proc(a: any) -> ^runtime.Type_Info {…}

    union_variant_typeid ¶

    union_variant_typeid :: proc(a: any) -> typeid {…}

    write_type_builder ¶

    write_type_builder :: proc(buf: ^strings.Builder, ti: ^runtime.Type_Info) -> int {…}

    write_type_writer ¶

    write_type_writer :: proc(w: io.Stream, ti: ^runtime.Type_Info, n_written: ^int = nil) -> (n: int, err: io.Error) {…}

    write_typeid_builder ¶

    write_typeid_builder :: proc(buf: ^strings.Builder, id: typeid, n_written: ^int = nil) -> (n: int, err: io.Error) {…}

    write_typeid_writer ¶

    write_typeid_writer :: proc(writer: io.Stream, id: typeid, n_written: ^int = nil) -> (n: int, err: io.Error) {…}

    Procedure Groups

    Source Files

    Generation Information

    Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-17 21:11:01.214913300 +0000 UTC