Type reflection
Types
-
Describes one structure property.
-
Describes one enumeration option.
-
Describes one structure type.
-
Luna::GenericStructureInstantiateInfo
Describes the information of one generic structure instantiation operation.
-
Luna::GenericStructureTypeDesc
Describes one generic structure type.
-
Describes one enumeration type.
-
The functional obejct that can be overloaded to define custom behavior of typeof for user-defined types.
Alias types
-
using equal_to_func_t = bool(typeinfo_t type, const void lhs, const void rhs)
The equality testing function used by the reflection system.
-
using hash_func_t = usize(typeinfo_t type, const void* inst)
The hash code computing function used by the reflection system.
-
using structure_ctor_t = void(typeinfo_t type, void* inst)
The structure constructor used by the reflection system.
-
using structure_dtor_t = void(typeinfo_t type, void* inst)
The structure destructor used by the reflection system.
-
using structure_copy_ctor_t = void(typeinfo_t type, void dst, void src)
The structure copy constructor used by the reflection system.
-
using structure_move_ctor_t = void(typeinfo_t type, void dst, void src)
The structure move constructor used by the reflection system.
-
using structure_copy_assign_t = void(typeinfo_t type, void dst, void src)
The structure copy assignment operator used by the reflection system.
-
using structure_move_assign_t = void(typeinfo_t type, void dst, void src)
The structure move assignment operator used by the reflection system.
-
The generic structure instantiation function called by the reflection system when one new generic structure instanced type is required.
-
The opaque pointer that points to one type object.
Functions
-
bool is_primitive_type(typeinfo_t type)
Checks whether one type is a primitive type.
-
bool is_struct_type(typeinfo_t type)
Checks whether one type is a structure type.
-
bool is_enum_type(typeinfo_t type)
Checks whether one type is an enumeration type.
-
bool is_generic_struct_type(typeinfo_t type)
Checks whether one type is a generic structure type.
-
bool is_generic_struct_instanced_type(typeinfo_t type)
Checks whether one type is a generic instanced structure type.
-
typeinfo_t get_type_by_name(const Name &name, const Name &alias=Name())
Gets one type by its name.
-
Name get_type_name(typeinfo_t type, Name *alias=nullptr)
Gets the name of the specified type.
-
Guid get_type_guid(typeinfo_t type)
Gets the GUID of the specified type.
-
usize get_type_size(typeinfo_t type)
Gets the size of the specified type.
-
usize get_type_alignment(typeinfo_t type)
Gets the alignment requirement of the specified type.
-
void * get_type_private_data(typeinfo_t type, const Guid &data_guid)
Gets user defined private data for the specified type.
-
Sets user defined private data for the specified type.
-
bool is_type_trivially_constructable(typeinfo_t type)
Checks whether one type is a trivially constructable type.
-
bool is_type_trivially_destructable(typeinfo_t type)
Checks whether one type is a trivially destructable type.
-
bool is_type_trivially_copy_constructable(typeinfo_t type)
Checks whether one type is a trivially copy constructable type.
-
bool is_type_trivially_move_constructable(typeinfo_t type)
Checks whether one type is a trivially move constructable type.
-
bool is_type_trivially_copy_assignable(typeinfo_t type)
Checks whether one type is a trivially copy assignable type.
-
bool is_type_trivially_move_assignable(typeinfo_t type)
Checks whether one type is a trivially move assignable type.
-
bool is_type_trivially_relocatable(typeinfo_t type)
Checks whether one type is a trivially relocatable type.
-
void construct_type(typeinfo_t type, void *data)
Constructs one instance of the specified type.
-
void construct_type_range(typeinfo_t type, void *data, usize count)
Constructs one array of instances of the specified type.
-
void destruct_type(typeinfo_t type, void *data)
Destructs one instance of the specified type.
-
void destruct_type_range(typeinfo_t type, void *data, usize count)
Destructs one array of instances of the specified type.
-
void copy_construct_type(typeinfo_t type, void dst, void src)
Copy constructs one instance of the specified type.
-
void copy_construct_type_range(typeinfo_t type, void dst, void src, usize count)
Copy constructs one array of instances of the specified type.
-
void move_construct_type(typeinfo_t type, void dst, void src)
Move constructs one instance of the specified type.
-
void move_construct_type_range(typeinfo_t type, void dst, void src, usize count)
Move constructs one array of instances of the specified type.
-
void copy_assign_type(typeinfo_t type, void dst, void src)
Copy assigns one instance of the specified type.
-
void copy_assign_type_range(typeinfo_t type, void dst, void src, usize count)
Copy assigns one array of instances of the specified type.
-
void move_assign_type(typeinfo_t type, void dst, void src)
Move assigns one instance of the specified type.
-
void move_assign_type_range(typeinfo_t type, void dst, void src, usize count)
Move assigns one array of instances of the specified type.
-
void relocate_type(typeinfo_t type, void dst, void src)
Relocates one instance of the specified type.
-
void relocate_type_range(typeinfo_t type, void dst, void src, usize count)
Relocates one array of instances of the specified type.
-
bool is_type_equatable(typeinfo_t type)
Checks whether the specified type supports equality testing.
-
void set_equatable(typeinfo_t type, equal_to_func_t *func)
Sets one type to support equality testing.
-
bool equal_to_type(typeinfo_t type, const void lhs, const void rhs)
Checks whether two instances of one type are equal.
-
bool is_type_hashable(typeinfo_t type)
Checks whether the specified type supports hash code computing.
-
void set_hashable(typeinfo_t type, hash_func_t *func)
Sets one type to support hash code computing.
-
usize hash_type(typeinfo_t type, const void *inst)
Computes the hash code of one instance of the specified type.
-
void set_type_attribute(typeinfo_t type, const Name &name, const Variant &value=Variant())
Sets one attribute of the specified type.
-
void remove_type_attribute(typeinfo_t type, const Name &name)
Removes one attribute of the specified type.
-
bool check_type_attribute(typeinfo_t type, const Name &name)
Checks whether the attribute of the specified type exists.
-
Variant get_type_attribute(typeinfo_t type, const Name &name)
Gets the attribute of the specified type.
-
Vector< Name > get_type_attributes(typeinfo_t type)
Gets all attributes of the specified type.
-
Sets one attribute of the specified property.
-
void remove_property_attribute(typeinfo_t type, const Name &property, const Name &name)
Removes one attribute of the specified property.
-
bool check_property_attribute(typeinfo_t type, const Name &property, const Name &name)
Checks whether the attribute of the specified property exists.
-
Variant get_property_attribute(typeinfo_t type, const Name &property, const Name &name)
Gets the attribute of the specified property.
-
Vector< Name > get_property_attributes(typeinfo_t type, const Name &property)
Gets all attributes of the specified property.
-
typeinfo_t register_struct_type(const StructureTypeDesc &desc)
Registers one structure type.
-
typeinfo_t register_generic_struct_type(const GenericStructureTypeDesc &desc)
Registers one generic structure type.
-
typeinfo_t register_enum_type(const EnumerationTypeDesc &desc)
Registers one enumeration type.
-
Span< const StructurePropertyDesc > get_struct_properties(typeinfo_t type)
Gets properties of the specified structure.
-
typeinfo_t get_base_type(typeinfo_t type)
Gets the base type of the specified type.
-
Span< const EnumerationOptionDesc > get_enum_options(typeinfo_t type)
Gets options of the specified enumeration.
-
typeinfo_t get_enum_underlying_type(typeinfo_t type)
Gets the underlying type of the specified enumeration.
-
bool is_multienum_type(typeinfo_t type)
Checks if the specified type is a multi-value enumeration type.
-
i64 get_enum_instance_value(typeinfo_t type, const void *data)
Extracts the mapped value of the enumeration, regardless of the underlying type of the enumeration.
-
void set_enum_instance_value(typeinfo_t type, void *data, i64 value)
Sets the enumeration value to the specified mapped value.
-
typeinfo_t get_struct_generic_type(typeinfo_t type)
Gets the generic structure type from one generic structure instanced type.
-
Span< const typeinfo_t > get_struct_generic_arguments(typeinfo_t type)
Gets the generic arguments used to instantiate one generic structure instanced type.
-
Span< const Name > get_struct_generic_parameter_names(typeinfo_t type)
Gets the generic parameter names of the specified type.
-
bool default_equal_to(typeinfo_t type, const void lhs, const void rhs)
The default equality comparison function used by the reflection system.
-
usize default_hash(typeinfo_t type, const void *inst)
The default hashing function used by the reflection system.
-
void default_ctor(typeinfo_t type, void *inst)
The default constructor used by the reflection system.
-
void default_dtor(typeinfo_t type, void *inst)
The default destructor used by the reflection system.
-
void default_copy_ctor(typeinfo_t type, void dst, void src)
The default copy constructor used by the reflection system.
-
void default_move_ctor(typeinfo_t type, void dst, void src)
The default move constructor used by the reflection system.
-
void default_copy_assign(typeinfo_t type, void dst, void src)
The default copy assignment function used by the reflection system.
-
void default_move_assign(typeinfo_t type, void dst, void src)
The default move assignment function used by the reflection system.
-
Registers one structure type to the type system. The structure type must have one lustruct macro defined in the structure body.
-
typeinfo_t register_enum_type(Span< const EnumerationOptionDesc > options, bool multienum=false)
Registers one enumeration type to the type system. The enumeration type must have one luenum macro defined directly in
Luna
namespace. -
typeinfo_t get_type_by_guid(const Guid &guid)
Gets the type object from one type GUID.
-
Gets the type object of the specified type.
-
Gets the type object of
void
type. -
Gets the type object of
u8
type. -
Gets the type object of
i8
type. -
Gets the type object of
u16
type. -
Gets the type object of
i16
type. -
Gets the type object of
u32
type. -
Gets the type object of
i32
type. -
Gets the type object of
u64
type. -
Gets the type object of
i64
type. -
Gets the type object of
usize
type. -
Gets the type object of
isize
type. -
Gets the type object of
f32
type. -
Gets the type object of
f64
type. -
Gets the type object of
c8
type. -
Gets the type object of
c16
type. -
Gets the type object of
c32
type. -
Gets the type object of
bool
type. -
Gets the type object of
Guid
type. -
Gets the type object of
Version
type. -
Gets the type object of
Pair
generic type. -
Gets one instanced type of one generic type.
Macros
-
Declares the name and guid for one structure or class type.
-
luproperty(_struct, _type, _name)
Declares one property used in Luna::register_struct_type.
-
Declares the name and guid for one enumeration type.
-
Declares one option used in Luna::register_enum_type.