SophiaFramework UNIVERSE 5.3 |
The SFXTypeInfo class provides the type information (SFXTypeInfo::TypeId) of classes and atomic types.
The SFXTypeInfo::GetTypeId function retrives the type infomation from a specified template parameter.
The type information value is unique by types, but the values would be different on the different execution environments even if the types are the same.
Memo | |
---|---|
SFXTypeInfo::TypeId and SFXTypeInfo::GetTypeId are used in the implement of SFXAny. |
Public Functions | |
---|---|
static TypeId |
GetTypeId(
T * param = null
) Get the type information of a specified type.
|
Types |
---|
TypeId A value which represents the type information.
|
[ public, static ] TypeId GetTypeId<T>( T * param = null // parameter for type (the value is not concerned) );
Get the type information (SFXTypeInfo::TypeId) of a specified type as a template parameter.
Caution | |
---|---|
In Visual C++ 6.0 or RVCT 1.2 for BREW, the argument should be a null pointer that is cast by T pointer type. In this case, no template parameter is need. |
Descrimination of types
SFXTypeInfo::TypeId x; x = SFXTypeInfo::GetTypeId((SInt32Ptr)(null)); if (x == SFXTypeInfo::GetTypeId((SInt32Ptr)(null))) { TRACE("x is SInt32"); } if (x != SFXTypeInfo::GetTypeId((UInt32Ptr)(null))) { TRACE("x is not UInt32"); } // This syntax can also be used in the following compilers. // Visual C++ .NET 2003 or over, RVCT for BREW 3.0 or over, GNUARM 4.1 and YAGARTO 4.4 #if !((defined TARGET_COMPILER_MSVCPP && TARGET_COMPILER_VERSION < 1300) || (defined TARGET_COMPILER_ARMCPP && TARGET_COMPILER_VERSION < 300000)) if (x == SFXTypeInfo::GetTypeId<SInt32>()) { TRACE("x is SInt32"); } if (x != SFXTypeInfo::GetTypeId<UInt32>()) { TRACE("x is not UInt32"); } #endif // [Results] // x is SInt32 // x is not UInt32 // x is SInt32 // x is not UInt32
typedef Void (*_sfxtypeinfo_type_id)(VoidPtr param); [public] SFMTYPEDEFALIAS(_sfxtypeinfo_type_id, TypeId)
This is a type information value which is retrived by the SFXTypeInfo::GetTypeId function.
The type information value is unique by types, but the values would be different on the different execution environments even if the types are the same.
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |