Represents a particular type and provides information about it. More...
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 | |
TypeInfo () | |
Default constructor (no type is set). More... | |
TypeInfo (std::nullptr_t) | |
Null object constructor (no type is set). More... | |
TypeInfo (const char_t *name) | |
Constructor. More... | |
TypeInfo (const char_t *name, uint32_t hash) | |
Constructor. More... | |
TypeInfo (const std::type_info &info) | |
Constructor. More... | |
String | get_Name () const |
Returns the name of the type represented by the current object. More... | |
String | get_Namespace () const |
Gets the namespace of the Type. More... | |
String | get_FullName () const |
Returns the fully qualified name (but without the assembly name) of the type represented by the current object. More... | |
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... | |
String | get_AssemblyQualifiedName () const |
NOT IMPLEMENTED. Returns the fully qualified name including the assembly name of the type represented by the current object. More... | |
bool | IsSubclassOf (const TypeInfo &type) const |
Determines whether the type represented by the current object is a subclass of the specified class. More... | |
bool | IsInstanceOfType (const SharedPtr< Object > &obj) const |
Determines whether the specified object is an instance of the current type. More... | |
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... | |
bool | get_IsSealed () const |
Gets a value indicating whether the Type is declared sealed. More... | |
bool | get_IsInterface () const |
Gets a value indicating whether the Type is an interface; that is, not a class or a value type. More... | |
bool | get_IsAbstract () const |
Gets a value indicating whether the Type is abstract and must be overridden. More... | |
bool | get_IsEnum () const |
Gets a value indicating whether the current Type represents an enumeration. More... | |
bool | get_IsArray () const |
Gets a value that indicates whether the type is an array. More... | |
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... | |
bool | get_IsValueType () const |
Gets a value indicating whether the Type is a value type. More... | |
bool | get_IsVisible () const |
Gets a value indicating whether the Type can be accessed by code outside the assembly. More... | |
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... | |
bool | get_IsGenericType () const |
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... | |
ArrayPtr< TypeInfo > | get_GenericTypeArguments () const |
Gets an array of the generic type arguments for this type. More... | |
ArrayPtr< TypeInfo > | GetInterfaces () const |
Gets all the interfaces implemented or inherited by the current Type. More... | |
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... | |
ArrayPtr< SharedPtr< System::Reflection::ConstructorInfo > > | GetConstructors () const |
Returns all the public constructors defined for the current Type. More... | |
SharedPtr< System::Reflection::ConstructorInfo > | GetConstructor (ArrayPtr< TypeInfo > types) const |
Searches for a public instance constructor whose parameters match the types in the specified array. More... | |
String | ToString () const |
Returns a string containing the name of the type represented by the current object. More... | |
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... | |
void | AddAttribute (const ObjectPtr &attribute) |
Adds the specified attribute to the list of type's attributes. More... | |
void | AddMember (SharedPtr< System::Reflection::MemberInfo > member) |
Adds the specified member to the list of type's members. More... | |
ArrayPtr< SharedPtr< System::Reflection::MemberInfo > > | GetMember (String name) const |
Gets list of the members with specified name. More... | |
ArrayPtr< SharedPtr< System::Reflection::MemberInfo > > | get_DeclaredMember (String name) const |
Gets list of the members with specified name. More... | |
SharedPtr< System::Reflection::MethodInfo > | GetMethod (String name) const |
Gets method with specified name. More... | |
ArrayPtr< SharedPtr< System::Reflection::PropertyInfo > > | GetProperties () const |
Returns all the public properties of the current Type. More... | |
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... | |
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... | |
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... | |
ArrayPtr< ObjectPtr > | GetCustomAttributes () const |
Returns an array containing objects that represent all custom attributes applied to the type. More... | |
ArrayPtr< ObjectPtr > | GetCustomAttributes (const TypeInfo &attributeType, bool inherit) const |
Returns an array containing objects that represent specific attributes applied to the type. More... | |
TypeInfo | get_BaseType () const |
Returns base type descritor. More... | |
void | SetBaseType (GetTypeInfoFunPtr basetype) |
Sets base type descritor. More... | |
void | SetTemplParamType (const TypeInfo &templParam) |
Sets template parameter type descritor. More... | |
TypeInfo | GetTemplParamType () const |
Gets template parameter type descritor. More... | |
void | reset () |
Sets TypeInfo to null. More... | |
template<class T > | |
void | AddDefaultConstructor () |
Sets default constructor for the type T. More... | |
void | AddDefaultConstructor (DefaultConstructor method) |
Sets default constructor by the functor that creates class instanse. More... | |
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 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.
System::TypeInfo::TypeInfo | ( | ) |
Default constructor (no type is set).
System::TypeInfo::TypeInfo | ( | std::nullptr_t | ) |
Null object constructor (no type is set).
System::TypeInfo::TypeInfo | ( | const char_t * | name | ) |
Constructor.
name | Type name. |
System::TypeInfo::TypeInfo | ( | const char_t * | name, |
uint32_t | hash | ||
) |
Constructor.
name | Type name. |
hash | Type name hash. |
System::TypeInfo::TypeInfo | ( | const std::type_info & | info | ) |
Constructor.
info | Information about a type. |
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.
void System::TypeInfo::AddDefaultConstructor | ( | DefaultConstructor | method | ) |
Sets default constructor by the functor that creates class instanse.
method | functor that creates class instanse |
void System::TypeInfo::AddMember | ( | 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. |
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.
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.
TypeInfo System::TypeInfo::get_BaseType | ( | ) | const |
Returns base type descritor.
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.
ArrayPtr<SharedPtr<System::Reflection::MemberInfo> > System::TypeInfo::get_DeclaredMember | ( | String | name | ) | const |
Gets list of the members with specified name.
name | Name of the member to get. |
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.
bool System::TypeInfo::get_IsAbstract | ( | ) | const |
Gets a value indicating whether the Type is abstract and must be overridden.
bool System::TypeInfo::get_IsArray | ( | ) | const |
Gets a value that indicates whether the type is an array.
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.
bool System::TypeInfo::get_IsEnum | ( | ) | const |
Gets a value indicating whether the current Type represents an enumeration.
bool System::TypeInfo::get_IsGenericType | ( | ) | const |
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.
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.
bool System::TypeInfo::get_IsSealed | ( | ) | const |
Gets a value indicating whether the Type is declared sealed.
bool System::TypeInfo::get_IsValueType | ( | ) | const |
Gets a value indicating whether the Type is a value type.
bool System::TypeInfo::get_IsVisible | ( | ) | const |
Gets a value indicating whether the Type can be accessed by code outside the assembly.
String System::TypeInfo::get_Name | ( | ) | const |
Returns the name of the type represented by the current object.
String System::TypeInfo::get_Namespace | ( | ) | const |
Gets the namespace of the Type.
SharedPtr<System::Reflection::ConstructorInfo> System::TypeInfo::GetConstructor | ( | ArrayPtr< TypeInfo > | types | ) | const |
Searches for a public instance constructor whose parameters match the types in the specified array.
ArrayPtr<SharedPtr<System::Reflection::ConstructorInfo> > System::TypeInfo::GetConstructors | ( | ) | const |
Returns all the public constructors defined for the current Type.
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.
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.
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. |
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.
ArrayPtr<SharedPtr<System::Reflection::MemberInfo> > System::TypeInfo::GetMember | ( | String | name | ) | const |
Gets list of the members with specified name.
name | Name of the member to get. |
SharedPtr<System::Reflection::MethodInfo> System::TypeInfo::GetMethod | ( | String | name | ) | const |
Gets method with specified name.
name | Name of the method to get. |
ArrayPtr<SharedPtr<System::Reflection::PropertyInfo> > System::TypeInfo::GetProperties | ( | ) | const |
Returns all the public properties of the current Type.
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.
TypeInfo System::TypeInfo::GetTemplParamType | ( | ) | const |
Gets template parameter type descritor.
uint32_t System::TypeInfo::Hash | ( | ) | const |
Returns a hash value associated with the type represented by the current object.
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 |
Determines whether the specified object is an instance of the current type.
obj | The object to compare with the current type |
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 |
void System::TypeInfo::reset | ( | ) |
Sets TypeInfo to null.
void System::TypeInfo::set_IsValueType | ( | bool | value | ) |
Sets a value indicating whether the Type is a value type.
void System::TypeInfo::SetBaseType | ( | GetTypeInfoFunPtr | basetype | ) |
Sets base type descritor.
basetype | Pointer to base type descriptor to set. |
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. |
String System::TypeInfo::ToString | ( | ) | const |
Returns a string containing the name of the type represented by the current object.
|
static |