Property *RClass::property(const char *name) const { Property *prop; SEXP rprop = findVarInFrame(properties(), install(name)); if (rprop != R_UnboundValue) { SEXP rtype = VECTOR_ELT(rprop, R_PROP_TYPE); SmokeType type; if (rtype == R_NilValue) type = SmokeType(smokeBase()->smoke(), (Smoke::Index)0); else type = SmokeType(smokeBase()->smoke(), CHAR(asChar(rtype))); prop = new RProperty(name, type, VECTOR_ELT(rprop, R_PROP_READER), VECTOR_ELT(rprop, R_PROP_WRITER)); } else prop = parent()->property(name); return prop; }
QList<Method *> MocClass::methods(Method::Qualifiers qualifiers) const { int n = _meta->methodCount(); QList<Method *> methods = _delegate->methods(qualifiers); Smoke *smoke = smokeBase()->smoke(); for (int i = 0; i < n; i++) { if (_meta->method(i).access() != QMetaMethod::Private) if ((MocMethod(smoke, _meta, i).qualifiers() & qualifiers) == qualifiers) methods << new MocMethod(smoke, _meta, i); } return methods; }
bool MocClass::hasMethod(const char *name, Method::Qualifiers qualifiers) const { if (_methods.isEmpty()) { QList<Method *> meths = methods(); for (int i = 0; i < meths.size(); i++) { _methods.insert(meths[i]->name(), i + 1); delete meths[i]; } } bool found = _delegate->hasMethod(name, qualifiers); /* Simple optimization: do not check for method if the delegate is a smoke class, because we will not have any more methods. */ if (!found && _delegate != smokeBase()) { int index = _methods[name] - 1; if (index != -1) { MocMethod method(smokeBase()->smoke(), _meta, index); if((method.qualifiers() & qualifiers) == qualifiers) found = true; } } return found; }
QHash<const char *, int> RClass::enumValues() const { return smokeBase()->enumValues(); }