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

Classes

struct  BoxedValue
 TypeInfo structure for BoxedValue class. More...
 

Public Member Functions

 TypeInfo ()
 Constructs an instance of TypeInfo class that does not represent any type. More...
 
template<uint32_t N>
 TypeInfo (const char_t(&name)[N], uint32_t hash)
 
 TypeInfo (const char_t *name)
 
 TypeInfo (std::nullptr_t)
 Constructs an instance of TypeInfo class that does not represent any type. More...
 
String get_Name () const
 Returns the name of the type represented by the current object. 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::Assemblyget_Assembly () const
 
String get_AssemblyQualifiedName () const
 
bool IsSubclassOf (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)
 
ObjectPtr GetCustomAttribute (const TypeInfo &attributeType) const
 
ArrayPtr< ObjectPtrGetCustomAttributes () const
 Returns an array containing objects that represent all custom attributes applied to the type represented by the current object. More...
 

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 ( )
inline

Constructs an instance of TypeInfo class that does not represent any type.

◆ TypeInfo() [2/4]

template<uint32_t N>
System::TypeInfo::TypeInfo ( const char_t(&)  name[N],
uint32_t  hash 
)
inline

Constructs an instance of TypeInfo class that represents a type with the specified name and associates the specified hash value with it.

Parameters
nameThe name of the type to be represented by the instance being constructed
hashThe hash value to associated with the type; if the argument is equal to 0, the hash value is generated

◆ TypeInfo() [3/4]

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

Constructs an instance of TypeInfo class that represents a type with the specified name and associates the specified hash value with it.

Parameters
nameThe name of the type to be represented by the instance being constructed

◆ TypeInfo() [4/4]

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

Constructs an instance of TypeInfo class that does not represent any type.

Member Function Documentation

◆ AddAttribute()

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

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

◆ 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_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()

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

Returns an array containing objects that represent all custom attributes applied to the type represented by the current object.

◆ GetHashCode()

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

Returns a hash code associated with this instance.

◆ Hash()

uint32_t System::TypeInfo::Hash ( ) const
inline

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

◆ IsSubclassOf()

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

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

◆ 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

◆ StringHash()

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

Calculates a hash value ofor the specified c-string.

Parameters
strA pointer to the beginning of a c-string
Returns
A 32-bit integer hash value for the specified string

◆ ToString()

String System::TypeInfo::ToString ( ) const

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