88 virtual const std::vector<const CYIRuntimeTypeInfo*> &
GetBasesTypeInfos()
const = 0;
125 virtual const void *CastVoidToVoid(
const CYIRuntimeTypeInfo &baseType,
const void *pObject)
const = 0;
146 template<
typename CLASS,
typename BASE1 =
void,
typename BASE2 =
void,
typename BASE3 =
void>
196 template<
typename T,
typename TBASE1,
typename TBASE2,
typename TBASE3>
206 virtual const void *CastVoidToVoid(
const CYIRuntimeTypeInfo &baseType,
const void *pObject)
const override;
207 inline const void *CastVoidToVoidNonVirtual(
const CYIRuntimeTypeInfo &baseType,
const void *pObject)
const;
209 virtual const std::vector<const CYIRuntimeTypeInfo*> &
GetBasesTypeInfos()
const override;
259 void UnregisterType(
const CYIString &name);
271 std::map<CYIString, const CYIRuntimeTypeInfo*> GetRegisteredTypes()
const;
278 std::vector<const CYIRuntimeTypeInfo *> GetSuperclassesTypeInfos(
const CYIRuntimeTypeInfo &type,
bool bDirectSuperclassesOnly =
false)
const;
285 std::vector<const CYIRuntimeTypeInfo *> GetSubclassesTypeInfos(
const CYIRuntimeTypeInfo &type,
bool bDirectSubclassesOnly =
false)
const;
292 std::vector<const CYIRuntimeTypeInfo *> GetRootTypeInfos()
const;
317 struct StringComparator
324 std::map<CYIString, const CYIRuntimeTypeInfo*, StringComparator> m_types;
350 #define YI_TYPE_BASES(...) YI_MAKE_VARIADIC_MACRO(YI_TYPE_BASES_, ##__VA_ARGS__) 372 #define YI_TYPE_DEF(...) YI_MAKE_VARIADIC_MACRO(YI_TYPE_DEF_, ##__VA_ARGS__) 394 #define YI_TYPE_DEF_INST(...) YI_MAKE_VARIADIC_MACRO(YI_TYPE_DEF_INST_, ##__VA_ARGS__) 412 #define YI_TYPE_DEF_WITH_NAME(...) YI_MAKE_VARIADIC_MACRO(YI_TYPE_DEF_WITH_NAME_, ##__VA_ARGS__) 430 #define YI_TYPE_DEF_INST_WITH_NAME(...) YI_MAKE_VARIADIC_MACRO(YI_TYPE_DEF_INST_WITH_NAME_, ##__VA_ARGS__) 461 template<
typename TARGET,
typename SOURCE>
482 template<
typename TARGET,
typename SOURCE>
488 template<
typename TARGET,
typename SOURCE>
489 inline std::shared_ptr<TARGET>
YiDynamicCast(
const std::shared_ptr<SOURCE> &pObject);
565 #include "utility/YiRtti.inl" bool operator!=(const CYIRuntimeTypeInfo &other) const
bool operator==(const CYIRuntimeTypeInfo &other) const
#define YI_DISALLOW_COPY_AND_ASSIGN(TypeName)
Delete the copy constructor and assignment operator (and consequently the move constructor as well) ...
Definition: YiPredef.h:114
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:35
const CYIRuntimeTypeInfo * YiGetTypeInfo(const char *pTypeName)
void RegisterWithLinker() const
virtual ~CYIRuntimeTypeInfo()
TARGET * YiDynamicCast(SOURCE *pObject)
Casts the pointer pObject to type T*.
BASE1 BaseType1
Definition: YiRtti.h:158
CLASS ClassType
Definition: YiRtti.h:153
std::shared_ptr< TARGET > YiDynamicPointerCast(const std::shared_ptr< SOURCE > &pObject)
Casts the shared pointer pObject to shared pointer type T*.
const CYIString & GetName() const
BASE2 BaseType2
Definition: YiRtti.h:163
virtual const std::vector< const CYIRuntimeTypeInfo * > & GetBasesTypeInfos() const =0
This is a sample class to document the RTTI functions inserted into classes by the YI_TYPE_BASES(...
Definition: YiRtti.h:531
const T * CastVoidPointer(const void *pObject) const
The abstract runtime representation of a C++ type.
Definition: YiRtti.h:48
virtual bool IsInstantiable() const =0
bool operator<(const CYIRuntimeTypeInfo &other) const
A registry of all known RTTI types.
Definition: YiRtti.h:224
virtual void * CreateVoidInstance() const =0
BASE3 BaseType3
Definition: YiRtti.h:168
std::unique_ptr< T > YiRTTINew(const CYIString &name)
Creates a new instance of the type identifed by name.
std::unique_ptr< T > CreateInstance() const
CYIRuntimeTypeInfo(const CYIString &name)
The runtime representation of a C++ type.
Definition: YiRtti.h:147