Represents a particular type and provides information about it. More...

Classes

struct  BoxedValue
 TypeInfo structure for BoxedValue class. 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)
 
 TypeInfo (const char_t *name, uint32_t hash)
 
String get_Name () const
 Returns the name of the type represented by the current object. More...
 
String get_FullName () const
 
System::SharedPtr< System::Reflection::Assemblyget_Assembly () const
 
String get_AssemblyQualifiedName () const
 
bool IsSubclassOf (const TypeInfo &type) const
 
bool IsInstanceOfType (const SharedPtr< Object > &obj) const
 
bool IsAssignableFrom (const TypeInfo &type) const
 
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
 
bool operator!= (const TypeInfo &info) const
 
bool operator== (std::nullptr_t) const
 
bool operator!= (std::nullptr_t) const
 
void AddAttribute (const ObjectPtr &attribute)
 
void AddMember (SharedPtr< System::Reflection::MemberInfo > member)
 
ArrayPtr< SharedPtr< System::Reflection::MemberInfo > > GetMember (String name) const
 
ArrayPtr< SharedPtr< System::Reflection::MemberInfo > > get_DeclaredMember (String name) const
 
SharedPtr< System::Reflection::MethodInfoGetMethod (String name) const
 
ObjectPtr GetCustomAttribute (const TypeInfo &attributeType) const
 
ArrayPtr< ObjectPtrGetCustomAttributes () const
 Returns an array containing objects that represent all custom attributes applied to the type. More...
 
ArrayPtr< ObjectPtrGetCustomAttributes (const TypeInfo &attributeType, bool inherit) const
 
const TypeInfoget_BaseType () const
 
void SetBaseType (GetTypeInfoFunPtr basetype)
 

Static Public Member Functions

static uint32_t StringHash (const char_t *str)
 
template<class T >
static const TypeInfoBoxedValueType ()
 

Detailed Description

Represents a particular type and provides information about it.

Constructor & Destructor Documentation

◆ TypeInfo() [1/4]

System::TypeInfo::TypeInfo ( )

Default constructor (no type is set).

◆ TypeInfo() [2/4]

System::TypeInfo::TypeInfo ( std::nullptr_t  )

Null object constructor (no type is set).

◆ TypeInfo() [3/4]

System::TypeInfo::TypeInfo ( const char_t *  name)

Constructor.

Parameters
nameType name.

◆ TypeInfo() [4/4]

System::TypeInfo::TypeInfo ( const char_t *  name,
uint32_t  hash 
)

Constructor.

Parameters
nameType name.
hashType name hash.

Member Function Documentation

◆ AddAttribute()

void System::TypeInfo::AddAttribute ( const ObjectPtr attribute)

Adds the specified attribute to the list of type's attributes.

Parameters
attributeA constant reference to an object that represents an attribute to be added

◆ AddMember()

void System::TypeInfo::AddMember ( SharedPtr< System::Reflection::MemberInfo member)

Adds the specified member to the list of type's members.

Parameters
memberMember to add.

◆ BoxedValueType()

template<class T >
static const TypeInfo& System::TypeInfo::BoxedValueType ( )
inlinestatic

Provides unique TypeInfo structure for BoxedValue type to be shared by multiple Boxed* classes.

Template Parameters
TType to hold TypeInfo structure for.
Returns
TypeInfo structure which is unique per class.

◆ get_Assembly()

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.

◆ get_AssemblyQualifiedName()

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.

◆ get_BaseType()

const TypeInfo* System::TypeInfo::get_BaseType ( ) const

Returns base type descritor.

Returns
Pointer to base type descriptor or null if not found.

◆ get_DeclaredMember()

ArrayPtr<SharedPtr<System::Reflection::MemberInfo> > System::TypeInfo::get_DeclaredMember ( String  name) const

Gets list of the members with specified name.

Parameters
nameName of the member to get.
Returns
Array of member descriptors (empty if no member is found).

◆ get_FullName()

String System::TypeInfo::get_FullName ( ) const

Returns the fully qualified name (but without the assembly name) of the type represented by the current object.

◆ get_Name()

String System::TypeInfo::get_Name ( ) const

Returns the name of the type represented by the current object.

◆ GetCustomAttribute()

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.

Parameters
attributeTypeThe constant reference to the TypeInfo object representing the type of the attribute to search
Returns
A pointer to an object representing the found attribute, or null-pointer if no attribute was foud matching the search criteria

◆ GetCustomAttributes() [1/2]

ArrayPtr<ObjectPtr> System::TypeInfo::GetCustomAttributes ( ) const

Returns an array containing objects that represent all custom attributes applied to the type.

◆ GetCustomAttributes() [2/2]

ArrayPtr<ObjectPtr> System::TypeInfo::GetCustomAttributes ( const TypeInfo attributeType,
bool  inherit 
) const

Returns an array containing objects that represent specific attributes applied to the type.

Parameters
attributeTypeType of the attribute to look for.
inheritWhether to look for inherited attributes as well.

◆ GetHashCode()

int System::TypeInfo::GetHashCode ( ) const
inline

Returns a hash code associated with this instance.

◆ GetMember()

ArrayPtr<SharedPtr<System::Reflection::MemberInfo> > System::TypeInfo::GetMember ( String  name) const

Gets list of the members with specified name.

Parameters
nameName of the member to get.
Returns
Array of member descriptors (empty if no member is found).

◆ GetMethod()

SharedPtr<System::Reflection::MethodInfo> System::TypeInfo::GetMethod ( String  name) const

Gets method with specified name.

Parameters
nameName of the method to get.
Returns
Method descriptor (or null if not found).

◆ Hash()

uint32_t System::TypeInfo::Hash ( ) const

Returns a hash value associated with the type represented by the current object.

◆ IsAssignableFrom()

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

Parameters
typethe type to compare with the current type

◆ IsInstanceOfType()

bool System::TypeInfo::IsInstanceOfType ( const SharedPtr< Object > &  obj) const

Determines whether the specified object is an instance of the current type.

Parameters
objThe object to compare with the current type
Returns
true if the current type is in the inheritance hierarchy of the object represented by obj

◆ IsSubclassOf()

bool System::TypeInfo::IsSubclassOf ( const TypeInfo type) const

Determines whether the type represented by the current object is a subclass of the specified class.

Parameters
typethe type to compare with the current type

◆ operator!=() [1/2]

bool System::TypeInfo::operator!= ( const TypeInfo info) const
inline

Determines if the current and the specified TypeInfo objects are not equal.

Parameters
infoThe TypeInfo object to compare with
Returns
True if the objects' hashes are not equal, otherwise - false

◆ operator!=() [2/2]

bool System::TypeInfo::operator!= ( std::nullptr_t  ) const
inline

Determines if the current TypeInfo object is not a null-object, i.e. it represents some type.

Returns
True if the current TypeInfo object is not a null-object, otherwise - false

◆ operator==() [1/2]

bool System::TypeInfo::operator== ( const TypeInfo info) const
inline

Determines if the current and the specified TypeInfo objects are equal.

Parameters
infoThe TypeInfo object to compare with
Returns
True if the objects' hashes are equal, otherwise - false

◆ operator==() [2/2]

bool System::TypeInfo::operator== ( std::nullptr_t  ) const
inline

Determines if the current TypeInfo object is a null-object, i.e. does not represent any type.

Returns
True if the current TypeInfo object is a null-object, otherwise - false

◆ SetBaseType()

void System::TypeInfo::SetBaseType ( GetTypeInfoFunPtr  basetype)

Sets base type descritor.

Parameters
basetypePointer to base type descriptor to set.

◆ StringHash()

static uint32_t System::TypeInfo::StringHash ( const char_t *  str)
inlinestatic

Calculates hash for specified string.

Parameters
strString to calculate hash for.
Returns
Hash value.

◆ ToString()

String System::TypeInfo::ToString ( ) const

Returns a string containing the name of the type represented by the current object.