bool isBaseOf(naGhostType* ghost_type) const
{
+ if( ghost_type == _ghost_type_ptr )
+ return true;
+
for( DerivedList::const_iterator derived = _derived_classes.begin();
derived != _derived_classes.end();
++derived )
typedef std::vector<const GhostMetadata*> DerivedList;
const std::string _name;
+ const naGhostType *_ghost_type_ptr;
DerivedList _derived_classes;
std::vector<naRef> _parents;
- explicit GhostMetadata(const std::string& name):
- _name(name)
+ GhostMetadata( const std::string& name,
+ const naGhostType* ghost_type ):
+ _name(name),
+ _ghost_type_ptr(ghost_type)
{
}
{
if( !ghost_type )
return false;
- if( ghost_type == &_ghost_type )
- return true;
return getSingletonPtr()->GhostMetadata::isBaseOf(ghost_type);
}
MemberMap _members;
explicit Ghost(const std::string& name):
- GhostMetadata( name )
+ GhostMetadata(name, &_ghost_type)
{
_ghost_type.destroy = &destroyGhost;
_ghost_type.name = _name.c_str();