Base::Type extension to get Type by key
This commit is contained in:
@@ -184,6 +184,14 @@ Type Type::fromName(const char *name)
|
||||
return Type::badType();
|
||||
}
|
||||
|
||||
Type Type::fromKey(unsigned int key)
|
||||
{
|
||||
if(key < typedata.size())
|
||||
return typedata[key]->type;
|
||||
else
|
||||
return Type::badType();
|
||||
}
|
||||
|
||||
const char *Type::getName(void) const
|
||||
{
|
||||
return typedata[index]->name.c_str();
|
||||
|
||||
@@ -92,6 +92,7 @@ public:
|
||||
typedef void * (*instantiationMethod)(void);
|
||||
|
||||
static Type fromName(const char *name);
|
||||
static Type fromKey(unsigned int key);
|
||||
const char *getName(void) const;
|
||||
const Type getParent(void) const;
|
||||
bool isDerivedFrom(const Type type) const;
|
||||
|
||||
Reference in New Issue
Block a user