Represents a particular type and provides information about it. More...
#include "type_info.h"
Classes | |
struct | BoxedValue |
TypeInfo structure for BoxedValue class. More... | |
Public Types | |
typedef std::function< ObjectPtr()> | DefaultConstructor |
Function pointer to construct type. More... | |
Public Member Functions | |
ASPOSECPP_SHARED_API | TypeInfo () |
Default constructor (no type is set). More... | |
ASPOSECPP_SHARED_API | TypeInfo (std::nullptr_t) |
Null object constructor (no type is set). More... | |
ASPOSECPP_SHARED_API | TypeInfo (const char_t *name) |
Constructor. More... | |
ASPOSECPP_SHARED_API | TypeInfo (const char_t *name, uint32_t hash) |
Constructor. More... | |
ASPOSECPP_SHARED_API | TypeInfo (const std::type_info &info) |
Constructor. More... | |
ASPOSECPP_SHARED_API String | get_Name () const |
Returns the name of the type represented by the current object. More... | |
ASPOSECPP_SHARED_API String | get_Namespace () const |
Gets the namespace of the Type. More... | |
ASPOSECPP_SHARED_API String | get_FullName () const |
Returns the fully qualified name (but without the assembly name) of the type represented by the current object. More... | |
ASPOSECPP_SHARED_API System::SharedPtr< System::Reflection::Assembly > | get_Assembly () const |
NOT IMPLEMENTED. Returns a pointer to the assembly in which the type represented by the current object is declared. More... | |
ASPOSECPP_SHARED_API String | get_AssemblyQualifiedName () const |
NOT IMPLEMENTED. Returns the fully qualified name including the assembly name of the type represented by the current object. More... | |
ASPOSECPP_SHARED_API bool | IsSubclassOf (const TypeInfo &type) const |
Determines whether the type represented by the current object is a subclass of the specified class. More... | |
ASPOSECPP_SHARED_API bool | IsInstanceOfType (const SharedPtr< Object > &obj) const |
Determines whether the specified object is an instance of the current type. More... | |
ASPOSECPP_SHARED_API bool | IsAssignableFrom (const TypeInfo &type) const |
Determines whether an instance of a specified type can be assigned to a variable of the current type. More... | |
ASPOSECPP_SHARED_API bool | get_IsSealed () const |
Gets a value indicating whether the Type is declared sealed. More... | |
ASPOSECPP_SHARED_API bool | get_IsInterface () const |
Gets a value indicating whether the Type is an interface; that is, not a class or a value type. More... | |
ASPOSECPP_SHARED_API bool | get_IsAbstract () const |
Gets a value indicating whether the Type is abstract and must be overridden. More... | |
ASPOSECPP_SHARED_API bool | get_IsEnum () const |
Gets a value indicating whether the current Type represents an enumeration. More... | |
ASPOSECPP_SHARED_API bool | get_IsArray () const |
Gets a value that indicates whether the type is an array. More... | |
ASPOSECPP_SHARED_API bool | get_IsClass () const |
Gets a value indicating whether the Type is a class or a delegate; that is, not a value type or interface. More... | |
ASPOSECPP_SHARED_API bool | get_IsValueType () const |
Gets a value indicating whether the Type is a value type. More... | |
ASPOSECPP_SHARED_API bool | get_IsVisible () const |
Gets a value indicating whether the Type can be accessed by code outside the assembly. More... | |
ASPOSECPP_SHARED_API bool | get_ContainsGenericParameters () const |
Gets a value indicating whether the current Type object has type parameters that have not been replaced by specific types. More... | |
ASPOSECPP_SHARED_API bool | get_IsGenericType () const |
ASPOSECPP_SHARED_API bool | get_IsGenericTypeDefinition () const |
Gets a value indicating whether the current Type represents a generic type definition, from which other generic types can be constructed. More... | |
ASPOSECPP_SHARED_API ArrayPtr< TypeInfo > | get_GenericTypeArguments () const |
Gets an array of the generic type arguments for this type. More... | |
ASPOSECPP_SHARED_API ArrayPtr< TypeInfo > | GetInterfaces () const |
Gets all the interfaces implemented or inherited by the current Type. More... | |
ASPOSECPP_SHARED_API TypeInfo | GetElementType () const |
NOT IMPLEMENTED. More... | |
ASPOSECPP_SHARED_API ArrayPtr< SharedPtr< System::Reflection::ConstructorInfo > > | GetConstructors (System::Reflection::BindingFlags bindingAttr) const |
searches for the constructors defined for the current Type, using the specified BindingFlags. More... | |
ASPOSECPP_SHARED_API ArrayPtr< SharedPtr< System::Reflection::ConstructorInfo > > | GetConstructors () const |
Returns all the public constructors defined for the current Type. More... | |
ASPOSECPP_SHARED_API SharedPtr< System::Reflection::ConstructorInfo > | GetConstructor (const ArrayPtr< TypeInfo > &types) const |
Searches for a public instance constructor whose parameters match the types in the specified array. More... | |
ASPOSECPP_SHARED_API String | ToString () const |
Returns a string containing the name of the type represented by the current object. More... | |
ASPOSECPP_SHARED_API uint32_t | Hash () const |
Returns a hash value associated with the type represented by the current object. More... | |
int | GetHashCode () const |
Returns a hash code associated with this instance. More... | |
bool | operator== (const TypeInfo &info) const |
Determines if the current and the specified TypeInfo objects are equal. More... | |
bool | operator!= (const TypeInfo &info) const |
Determines if the current and the specified TypeInfo objects are not equal. More... | |
bool | operator== (std::nullptr_t) const |
Determines if the current TypeInfo object is a null-object, i.e. does not represent any type. More... | |
bool | operator!= (std::nullptr_t) const |
Determines if the current TypeInfo object is not a null-object, i.e. it represents some type. More... | |
ASPOSECPP_SHARED_API void | AddAttribute (const ObjectPtr &attribute) |
Adds the specified attribute to the list of type's attributes. More... | |
ASPOSECPP_SHARED_API void | AddMember (const SharedPtr< System::Reflection::MemberInfo > &member) |
Adds the specified member to the list of type's members. More... | |
ASPOSECPP_SHARED_API ArrayPtr< SharedPtr< System::Reflection::MemberInfo > > | GetMember (const String &name) const |
Gets list of the members with specified name. More... | |
ASPOSECPP_SHARED_API ArrayPtr< SharedPtr< System::Reflection::MemberInfo > > | get_DeclaredMember (const String &name) const |
Gets list of the members with specified name. More... | |
ASPOSECPP_SHARED_API SharedPtr< System::Reflection::MethodInfo > | GetMethod (const String &name) const |
Gets method with specified name. More... | |
ASPOSECPP_SHARED_API ArrayPtr< SharedPtr< System::Reflection::PropertyInfo > > | GetProperties () const |
Returns all the public properties of the current Type. More... | |
ASPOSECPP_SHARED_API ArrayPtr< SharedPtr< System::Reflection::PropertyInfo > > | GetProperties (System::Reflection::BindingFlags bindingAttr) const |
Searches for the properties of the current Type, using the specified binding constraints. More... | |
ASPOSECPP_SHARED_API ArrayPtr< SharedPtr< System::Reflection::FieldInfo > > | GetFields (System::Reflection::BindingFlags bindingAttr) const |
Searches for the fields defined for the current Type, using the specified binding constraints. More... | |
ASPOSECPP_SHARED_API ObjectPtr | GetCustomAttribute (const TypeInfo &attributeType) const |
Searches for the custom attribute applied having the specified type and applied to the type reprsented by the current object. More... | |
ASPOSECPP_SHARED_API ArrayPtr< ObjectPtr > | GetCustomAttributes () const |
Returns an array containing objects that represent all custom attributes applied to the type. More... | |
ASPOSECPP_SHARED_API ArrayPtr< ObjectPtr > | GetCustomAttributes (const TypeInfo &attributeType, bool inherit) const |
Returns an array containing objects that represent specific attributes applied to the type. More... | |
ASPOSECPP_SHARED_API TypeInfo | get_BaseType () const |
Returns base type descritor. More... | |
ASPOSECPP_SHARED_API void | SetBaseType (GetTypeInfoFunPtr basetype) |
Sets base type descritor. More... | |
ASPOSECPP_SHARED_API void | SetTemplParamType (const TypeInfo &templParam) |
Sets template parameter type descritor. More... | |
ASPOSECPP_SHARED_API TypeInfo | GetTemplParamType () const |
Gets template parameter type descritor. More... | |
ASPOSECPP_SHARED_API void | reset () |
Sets TypeInfo to null. More... | |
template<class T > | |
void | AddDefaultConstructor () |
Sets default constructor for the type T. More... | |
ASPOSECPP_SHARED_API void | AddDefaultConstructor (DefaultConstructor method) |
Sets default constructor by the functor that creates class instanse. More... | |
ASPOSECPP_SHARED_API void | set_IsValueType (bool value) |
Sets a value indicating whether the Type is a value type. More... | |
Static Public Member Functions | |
static uint32_t | StringHash (const char_t *str) |
Calculates hash for specified string. More... | |
template<class T > | |
static const TypeInfo & | BoxedValueType () |
Provides unique TypeInfo structure for BoxedValue type to be shared by multiple Boxed* classes. More... | |
static const TypeInfo & | Type () |
Returns a TypeInfo object that represent TypeInfo class. More... | |
Static Public Attributes | |
static ASPOSECPP_SHARED_API ArrayPtr< TypeInfo > | EmptyTypes |
Constant representing empty list of TypeInfo. More... | |
Represents a particular type and provides information about it.
typedef std::function<ObjectPtr()> System::TypeInfo::DefaultConstructor |
Function pointer to construct type.
ASPOSECPP_SHARED_API System::TypeInfo::TypeInfo | ( | ) |
Default constructor (no type is set).
ASPOSECPP_SHARED_API System::TypeInfo::TypeInfo | ( | std::nullptr_t | ) |
Null object constructor (no type is set).
ASPOSECPP_SHARED_API System::TypeInfo::TypeInfo | ( | const char_t * | name | ) |
Constructor.
name | Type name. |
ASPOSECPP_SHARED_API System::TypeInfo::TypeInfo | ( | const char_t * | name, |
uint32_t | hash | ||
) |
Constructor.
name | Type name. |
hash | Type name hash. |
ASPOSECPP_SHARED_API System::TypeInfo::TypeInfo | ( | const std::type_info & | info | ) |
Constructor.
info | Information about a type. |
ASPOSECPP_SHARED_API void System::TypeInfo::AddAttribute | ( | const ObjectPtr & | attribute | ) |
Adds the specified attribute to the list of type's attributes.
attribute | A constant reference to an object that represents an attribute to be added |
|
inline |
Sets default constructor for the type T.
ASPOSECPP_SHARED_API void System::TypeInfo::AddDefaultConstructor | ( | DefaultConstructor | method | ) |
Sets default constructor by the functor that creates class instanse.
method | functor that creates class instanse |
ASPOSECPP_SHARED_API void System::TypeInfo::AddMember | ( | const SharedPtr< System::Reflection::MemberInfo > & | member | ) |
Adds the specified member to the list of type's members.
member | Member to add. |
|
inlinestatic |
Provides unique TypeInfo structure for BoxedValue type to be shared by multiple Boxed* classes.
T | Type to hold TypeInfo structure for. |
ASPOSECPP_SHARED_API System::SharedPtr<System::Reflection::Assembly> System::TypeInfo::get_Assembly | ( | ) | const |
NOT IMPLEMENTED. Returns a pointer to the assembly in which the type represented by the current object is declared.
ASPOSECPP_SHARED_API String System::TypeInfo::get_AssemblyQualifiedName | ( | ) | const |
NOT IMPLEMENTED. Returns the fully qualified name including the assembly name of the type represented by the current object.
ASPOSECPP_SHARED_API TypeInfo System::TypeInfo::get_BaseType | ( | ) | const |
Returns base type descritor.
ASPOSECPP_SHARED_API bool System::TypeInfo::get_ContainsGenericParameters | ( | ) | const |
Gets a value indicating whether the current Type object has type parameters that have not been replaced by specific types.
ASPOSECPP_SHARED_API ArrayPtr<SharedPtr<System::Reflection::MemberInfo> > System::TypeInfo::get_DeclaredMember | ( | const String & | name | ) | const |
Gets list of the members with specified name.
name | Name of the member to get. |
ASPOSECPP_SHARED_API String System::TypeInfo::get_FullName | ( | ) | const |
Returns the fully qualified name (but without the assembly name) of the type represented by the current object.
Gets an array of the generic type arguments for this type.
ASPOSECPP_SHARED_API bool System::TypeInfo::get_IsAbstract | ( | ) | const |
Gets a value indicating whether the Type is abstract and must be overridden.
ASPOSECPP_SHARED_API bool System::TypeInfo::get_IsArray | ( | ) | const |
Gets a value that indicates whether the type is an array.
ASPOSECPP_SHARED_API bool System::TypeInfo::get_IsClass | ( | ) | const |
Gets a value indicating whether the Type is a class or a delegate; that is, not a value type or interface.
ASPOSECPP_SHARED_API bool System::TypeInfo::get_IsEnum | ( | ) | const |
Gets a value indicating whether the current Type represents an enumeration.
ASPOSECPP_SHARED_API bool System::TypeInfo::get_IsGenericType | ( | ) | const |
ASPOSECPP_SHARED_API bool System::TypeInfo::get_IsGenericTypeDefinition | ( | ) | const |
Gets a value indicating whether the current Type represents a generic type definition, from which other generic types can be constructed.
ASPOSECPP_SHARED_API bool System::TypeInfo::get_IsInterface | ( | ) | const |
Gets a value indicating whether the Type is an interface; that is, not a class or a value type.
ASPOSECPP_SHARED_API bool System::TypeInfo::get_IsSealed | ( | ) | const |
Gets a value indicating whether the Type is declared sealed.
ASPOSECPP_SHARED_API bool System::TypeInfo::get_IsValueType | ( | ) | const |
Gets a value indicating whether the Type is a value type.
ASPOSECPP_SHARED_API bool System::TypeInfo::get_IsVisible | ( | ) | const |
Gets a value indicating whether the Type can be accessed by code outside the assembly.
ASPOSECPP_SHARED_API String System::TypeInfo::get_Name | ( | ) | const |
Returns the name of the type represented by the current object.
ASPOSECPP_SHARED_API String System::TypeInfo::get_Namespace | ( | ) | const |
Gets the namespace of the Type.
ASPOSECPP_SHARED_API SharedPtr<System::Reflection::ConstructorInfo> System::TypeInfo::GetConstructor | ( | const ArrayPtr< TypeInfo > & | types | ) | const |
Searches for a public instance constructor whose parameters match the types in the specified array.
ASPOSECPP_SHARED_API ArrayPtr<SharedPtr<System::Reflection::ConstructorInfo> > System::TypeInfo::GetConstructors | ( | System::Reflection::BindingFlags | bindingAttr | ) | const |
searches for the constructors defined for the current Type, using the specified BindingFlags.
ASPOSECPP_SHARED_API ArrayPtr<SharedPtr<System::Reflection::ConstructorInfo> > System::TypeInfo::GetConstructors | ( | ) | const |
Returns all the public constructors defined for the current Type.
ASPOSECPP_SHARED_API ObjectPtr System::TypeInfo::GetCustomAttribute | ( | const TypeInfo & | attributeType | ) | const |
Searches for the custom attribute applied having the specified type and applied to the type reprsented by the current object.
attributeType | The constant reference to the TypeInfo object representing the type of the attribute to search |
Returns an array containing objects that represent all custom attributes applied to the type.
ASPOSECPP_SHARED_API ArrayPtr<ObjectPtr> System::TypeInfo::GetCustomAttributes | ( | const TypeInfo & | attributeType, |
bool | inherit | ||
) | const |
Returns an array containing objects that represent specific attributes applied to the type.
attributeType | Type of the attribute to look for. |
inherit | Whether to look for inherited attributes as well. |
ASPOSECPP_SHARED_API TypeInfo System::TypeInfo::GetElementType | ( | ) | const |
NOT IMPLEMENTED.
NotImplementedException | Always |
ASPOSECPP_SHARED_API ArrayPtr<SharedPtr<System::Reflection::FieldInfo> > System::TypeInfo::GetFields | ( | System::Reflection::BindingFlags | bindingAttr | ) | const |
Searches for the fields defined for the current Type, using the specified binding constraints.
|
inline |
Returns a hash code associated with this instance.
Gets all the interfaces implemented or inherited by the current Type.
ASPOSECPP_SHARED_API ArrayPtr<SharedPtr<System::Reflection::MemberInfo> > System::TypeInfo::GetMember | ( | const String & | name | ) | const |
Gets list of the members with specified name.
name | Name of the member to get. |
ASPOSECPP_SHARED_API SharedPtr<System::Reflection::MethodInfo> System::TypeInfo::GetMethod | ( | const String & | name | ) | const |
Gets method with specified name.
name | Name of the method to get. |
ASPOSECPP_SHARED_API ArrayPtr<SharedPtr<System::Reflection::PropertyInfo> > System::TypeInfo::GetProperties | ( | ) | const |
Returns all the public properties of the current Type.
ASPOSECPP_SHARED_API ArrayPtr<SharedPtr<System::Reflection::PropertyInfo> > System::TypeInfo::GetProperties | ( | System::Reflection::BindingFlags | bindingAttr | ) | const |
Searches for the properties of the current Type, using the specified binding constraints.
ASPOSECPP_SHARED_API TypeInfo System::TypeInfo::GetTemplParamType | ( | ) | const |
Gets template parameter type descritor.
ASPOSECPP_SHARED_API uint32_t System::TypeInfo::Hash | ( | ) | const |
Returns a hash value associated with the type represented by the current object.
ASPOSECPP_SHARED_API bool System::TypeInfo::IsAssignableFrom | ( | const TypeInfo & | type | ) | const |
Determines whether an instance of a specified type can be assigned to a variable of the current type.
type | the type to compare with the current type |
ASPOSECPP_SHARED_API bool System::TypeInfo::IsInstanceOfType | ( | const SharedPtr< Object > & | obj | ) | const |
Determines whether the specified object is an instance of the current type.
obj | The object to compare with the current type |
ASPOSECPP_SHARED_API bool System::TypeInfo::IsSubclassOf | ( | const TypeInfo & | type | ) | const |
Determines whether the type represented by the current object is a subclass of the specified class.
type | the type to compare with the current type |
|
inline |
|
inline |
|
inline |
|
inline |
ASPOSECPP_SHARED_API void System::TypeInfo::reset | ( | ) |
Sets TypeInfo to null.
ASPOSECPP_SHARED_API void System::TypeInfo::set_IsValueType | ( | bool | value | ) |
Sets a value indicating whether the Type is a value type.
ASPOSECPP_SHARED_API void System::TypeInfo::SetBaseType | ( | GetTypeInfoFunPtr | basetype | ) |
Sets base type descritor.
basetype | Pointer to base type descriptor to set. |
ASPOSECPP_SHARED_API void System::TypeInfo::SetTemplParamType | ( | const TypeInfo & | templParam | ) |
Sets template parameter type descritor.
templParam | Pointer to template parameter type descriptor to set. |
|
inlinestatic |
Calculates hash for specified string.
str | String to calculate hash for. |
ASPOSECPP_SHARED_API String System::TypeInfo::ToString | ( | ) | const |
Returns a string containing the name of the type represented by the current object.
|
static |