bool ClassInfo::derivesFromImpl(const char *name, bool considerInterface) const { if (strcasecmp(name, getParentClass()) == 0) { return true; } // We don't support redeclared parents anyway. const ClassInfo *parent = FindClass(getParentClass()); if (parent && parent->derivesFromImpl(name, considerInterface)) { return true; } if (considerInterface) { const InterfaceMap &interfaces = getInterfaces(); for (InterfaceMap::const_iterator iter = interfaces.begin(); iter != interfaces.end(); ++iter) { if (strcasecmp(name, *iter) == 0) { return true; } const ClassInfo *parent = FindInterface(*iter); if (parent && parent->derivesFromImpl(name, considerInterface)) { return true; } } } return false; }
void ClassInfo::getAllProperties(PropertyVec &props) const { const PropertyVec &properties = getPropertiesVec(); props.insert(props.end(), properties.begin(), properties.end()); const char *parentClass = getParentClass(); if (parentClass && *parentClass) { GetClassProperties(props, parentClass); } }
wxDataViewItem DifficultySettings::findOrInsertClassname(const std::string& className) { // Try to look up the classname in the tree TreeIterMap::iterator found = _iterMap.find(className); if (found != _iterMap.end()) { // Name exists, return this return found->second; } // This iter will hold the parent element, if such is found wxDataViewItem parentIter; // Classname is not yet registered, walk up the inheritance tree std::string parentClassName = getParentClass(className); while (!parentClassName.empty()) { // Try to look up the classname in the tree TreeIterMap::iterator found = _iterMap.find(parentClassName); if (found != _iterMap.end()) { parentIter = found->second; break; } parentClassName = getParentClass(parentClassName); } // Insert the map, using the found iter (or NULL, if nothing was found) wxDataViewItem inserted = insertClassName(className, parentIter); // Remember the iter _iterMap.insert(TreeIterMap::value_type(className, inserted)); return inserted; }
bool ClassInfo::hasMethod(const char *name) const { ASSERT(name); const MethodMap &methods = getMethods(); MethodMap::const_iterator it = methods.find(name); if (it != methods.end()) { MethodInfo *m = it->second; if (m->invokeFn) { return *(m->invokeFn) != m->invokeFailedFn; } return true; } const ClassInfo *parent = FindClass(getParentClass()); return parent && parent->hasMethod(name); }