Implement Type::GetBaseType().

Refs #4996
This commit is contained in:
Gunnar Beutner 2013-11-05 08:48:45 +01:00 committed by Gunnar Beutner
parent b1ddc71925
commit b5b56e5438
2 changed files with 15 additions and 0 deletions

View File

@ -46,6 +46,7 @@ struct Field
class I2_BASE_API Type
{
public:
virtual Type *GetBaseType(void) const = 0;
virtual int GetFieldId(const String& name) const = 0;
virtual Field GetFieldInfo(int id) const = 0;
virtual int GetFieldCount(void) const = 0;

View File

@ -92,6 +92,20 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo& locp)
<< "{" << std::endl
<< "public:" << std::endl;
/* GetBaseType */
std::cout << "\t" << "virtual Type *GetBaseType(void) const" << std::endl
<< "\t" << "{" << std::endl;
std::cout << "\t\t" << "return ";
if (!klass.Parent.empty())
std::cout << "Singleton<TypeImpl<" << klass.Parent << "> >::GetInstance()";
else
std::cout << "NULL";
std::cout << ";" << std::endl
<< "\t" << "}" << std::endl << std::endl;
/* GetFieldId */
std::cout << "\t" << "virtual int GetFieldId(const String& name) const" << std::endl
<< "\t" << "{" << std::endl