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

Classes

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

ASPOSECPP_SHARED_API System::TypeInfo::TypeInfo ( )

Default constructor (no type is set).

◆ TypeInfo() [2/4]

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

Null object constructor (no type is set).

◆ TypeInfo() [3/4]

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

Constructor.

Parameters
nameType name.

◆ TypeInfo() [4/4]

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

Constructor.

Parameters
nameType name.
hashType name hash.

Member Function Documentation

◆ AddAttribute()

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

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

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.

◆ get_AssemblyQualifiedName()

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.

◆ get_BaseType()

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

Returns base type descritor.

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

◆ get_DeclaredMember()

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

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.

◆ get_Name()

ASPOSECPP_SHARED_API String System::TypeInfo::get_Name ( ) const

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

◆ GetCustomAttribute()

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.

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]

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

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

◆ GetCustomAttributes() [2/2]

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.

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

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

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

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

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

◆ IsAssignableFrom()

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

Parameters
typethe type to compare with the current type

◆ IsInstanceOfType()

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

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.

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

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

ASPOSECPP_SHARED_API String System::TypeInfo::ToString ( ) const

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