/
RefObject.cpp
41 lines (37 loc) · 1.22 KB
/
RefObject.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// RefObject.cpp
//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
#include "Core/PrecompiledHeader.h"
#include "RefObject.h"
#include "Core/Reflection/ReflectionInfo.h"
// Reflection
//------------------------------------------------------------------------------
// RefObject_ReflectionInfo
//------------------------------------------------------------------------------
class RefObject_ReflectionInfo : public ReflectionInfo
{
public:
explicit RefObject_ReflectionInfo() { SetTypeName( "RefObject" ); m_IsAbstract = true; }
virtual ~RefObject_ReflectionInfo() {}
};
RefObject_ReflectionInfo g_RefObject_ReflectionInfo;
void RefObject_ReflectionInfo_Bind()
{
ReflectionInfo::BindReflection( g_RefObject_ReflectionInfo );
}
// DynamicCastHelper
//------------------------------------------------------------------------------
/*static*/ bool RefObject::CanDynamicCast( const ReflectionInfo * dst, const ReflectionInfo * src )
{
while ( src )
{
if ( src == dst )
{
return true;
}
src = src->GetSuperClass();
}
return false;
}
//------------------------------------------------------------------------------