System::TypeInfo 类

TypeInfo class

表示特定类型并提供其信息。

class TypeInfo

Nested classes

方法

方法描述
AddAttribute(const ObjectPtr&)将指定的属性添加到类型属性列表中。
AddDefaultConstructor()为类型 T 设置默认构造函数。
AddDefaultConstructor(DefaultConstructor)通过创建类实例的函数对象设置默认构造函数。
AddMember(const SharedPtr<System::Reflection::MemberInfo>&)将指定的成员添加到类型成员列表中。
static BoxedValueType()BoxedValue 类型提供唯一的 TypeInfo 结构,以便多个 Boxed* 类共享。
Equals(const TypeInfo&) const
get_Assembly() const未实现。返回指向当前对象所表示的类型所在程序集的指针。
get_AssemblyQualifiedName() const未实现。返回包括程序集名称在内的当前对象所表示的类型的完全限定名。
get_BaseType() const返回基类型描述符。
get_ContainsGenericParameters() const获取一个值,指示当前 Type 对象是否具有尚未被具体类型替换的类型参数。
get_DeclaredMember(const String&) const获取具有指定名称的成员列表。
get_FullName() const返回当前对象所表示的类型的完全限定名(但不包括程序集名称)。
get_GenericTypeArguments() const获取此类型的泛型类型参数数组。
get_IsAbstract() const获取一个值,指示该 Type 是否为抽象且必须被重写。
get_IsArray() const获取一个值,指示该类型是否为数组。
get_IsClass() const获取一个值,指示该 Type 是类还是委托;即不是值类型或接口。
get_IsEnum() const获取一个值,指示当前 Type 是否表示枚举。
get_IsGenericType() const
get_IsGenericTypeDefinition() const获取一个值,指示当前 Type 是否表示通用类型定义,可据此构造其他泛型类型。
get_IsInterface() const获取一个值,指示 Type 是否为接口;即不是类或值类型。
get_IsSealed() const获取一个值,指示 Type 是否被声明为 sealed。
get_IsValueType() const获取一个值,指示 Type 是否为值类型。
get_IsVisible() const获取一个值,指示 Type 是否可以被程序集外的代码访问。
get_Name() const返回当前对象所表示的类型的名称。
get_Namespace() const获取 Type 的命名空间。
GetConstructor(const ArrayPtr<TypeInfo>&) const搜索具有公共实例构造函数,其参数与指定数组中的类型匹配。
GetConstructors(System::Reflection::BindingFlags) const使用指定的 BindingFlags 搜索当前 Type 定义的构造函数。
GetConstructors() const返回为当前 Type 定义的所有公共构造函数。
GetCustomAttribute(const TypeInfo&) const搜索具有指定类型且应用于当前对象所表示的类型的自定义属性。
GetCustomAttributes() const返回一个数组,其中包含表示应用于该类型的所有自定义属性的对象。
GetCustomAttributes(const TypeInfo&, bool) const返回一个数组,其中包含表示应用于该类型的特定属性的对象。
GetElementType() const未实现。
GetField(const System::String&, System::Reflection::BindingFlags) const使用指定的绑定约束搜索指定的字段。
GetFields(System::Reflection::BindingFlags) const使用指定的绑定约束搜索为当前 Type 定义的字段。
GetGenericArguments() const获取此类型的泛型类型参数数组。
GetHashCode() const返回与此实例关联的哈希码。
GetInterfaces() const获取当前 Type 实现或继承的所有接口。
GetMember(const String&) const获取具有指定名称的成员列表。
GetMethod(const String&) const获取具有指定名称的方法。
GetProperties() const返回当前 Type 的所有公共属性。
GetProperties(System::Reflection::BindingFlags) const使用指定的绑定约束搜索当前 Type 的属性。
GetTemplParamType() const获取模板参数类型描述符。
Hash() const返回与当前对象所表示的类型关联的哈希值。
IsAssignableFrom(const TypeInfo&) const确定指定类型的实例是否可以分配给当前类型的变量。
IsDefined(const TypeInfo&, bool) const未实现。指示是否已将指定类型或其派生类型的一个或多个属性应用于此成员。
IsInstanceOfType(const SharedPtr<Object>&) const确定指定对象是否是当前类型的实例。
IsSubclassOf(const TypeInfo&) const确定当前对象所表示的类型是否是指定类的子类。
operator!=(const TypeInfo&) const确定当前的和指定的 TypeInfo 对象是否不相等。
operator!=(std::nullptr_t) const确定当前的 TypeInfo 对象是否不是空对象,即它表示某种类型。
operator==(const TypeInfo&) const确定当前的和指定的 TypeInfo 对象是否相等。
operator==(std::nullptr_t) const确定当前的 TypeInfo 对象是否为空对象,即不表示任何类型。
reset()TypeInfo 设置为 null。
set_IsValueType(bool)设置一个值,指示该类型是否为值类型。
SetBaseType(GetTypeInfoFunPtr)设置基类型描述符。
SetTemplParamType(const TypeInfo&)设置模板参数类型描述符。
static StringHash(const char_t *)计算指定字符串的哈希值。
ToString() const返回一个字符串,包含当前对象所表示的类型名称。
static Type()返回一个表示 TypeInfo 类的 TypeInfo 对象。
TypeInfo()默认构造函数(未设置类型)。
TypeInfo(std::nullptr_t)空对象构造函数(未设置类型)。
TypeInfo(const char_t *)构造函数。
TypeInfo(const char_t *, uint32_t)构造函数。
TypeInfo(const std::type_info&)构造函数。

字段

字段描述
static EmptyType表示空的 TypeInfo 列表的常量。
static EmptyTypes表示空的 TypeInfo 列表的常量。

Typedefs

类型定义描述
DefaultConstructor用于构造类型的函数指针。

另见