diff --git a/wrap/Class.cpp b/wrap/Class.cpp index 8f36ff77b..4574e050f 100644 --- a/wrap/Class.cpp +++ b/wrap/Class.cpp @@ -276,14 +276,14 @@ map expandMethodTemplate(const map& methods, BOOST_FOREACH(const ReturnValue& retVal, method.returnVals) { ReturnValue instRetVal = retVal; if (retVal.type1.name == templateArg) { - instRetVal.type1 = qualifiedType; + instRetVal.type1.rename(qualifiedType); } else if (retVal.type1.name == "This") { - instRetVal.type1 = expandedClass; + instRetVal.type1.rename(expandedClass); } if (retVal.type2.name == templateArg) { - instRetVal.type2 = qualifiedType; + instRetVal.type2.rename(qualifiedType); } else if (retVal.type2.name == "This") { - instRetVal.type2 = expandedClass; + instRetVal.type2.rename(expandedClass); } instMethod.returnVals.push_back(instRetVal); } @@ -309,10 +309,10 @@ Class Class::expandTemplate(const string& templateArg, /* ************************************************************************* */ vector Class::expandTemplate(const string& templateArg, - const vector& instantiations) const { + const vector& instantiations) const { vector result; BOOST_FOREACH(const Qualified& instName, instantiations) { - Qualified expandedClass = (Qualified)(*this); + Qualified expandedClass = (Qualified) (*this); expandedClass.name += instName.name; Class inst = expandTemplate(templateArg, instName, expandedClass); inst.name = expandedClass.name; @@ -359,8 +359,8 @@ void Class::comment_fragment(FileWriter& proxyFile) const { BOOST_FOREACH(ArgumentList argList, m.argLists) { proxyFile.oss << "%"; argList.emit_prototype(proxyFile, m.name); - proxyFile.oss << " : returns " - << m.returnVals[0].return_type(false) << endl; + proxyFile.oss << " : returns " << m.returnVals[0].return_type(false) + << endl; } } @@ -371,8 +371,8 @@ void Class::comment_fragment(FileWriter& proxyFile) const { BOOST_FOREACH(ArgumentList argList, m.argLists) { proxyFile.oss << "%"; argList.emit_prototype(proxyFile, m.name); - proxyFile.oss << " : returns " - << m.returnVals[0].return_type(false) << endl; + proxyFile.oss << " : returns " << m.returnVals[0].return_type(false) + << endl; } } diff --git a/wrap/ReturnValue.h b/wrap/ReturnValue.h index 5b9be18d5..fa88dcb48 100644 --- a/wrap/ReturnValue.h +++ b/wrap/ReturnValue.h @@ -34,8 +34,9 @@ struct ReturnType: Qualified { isPtr(false), category(CLASS) { } - ReturnType(const Qualified& q) : - Qualified(q), isPtr(false), category(CLASS) { + void rename(const Qualified& q) { + name = q.name; + namespaces = q.namespaces; } /// Check if this type is in a set of valid types @@ -78,12 +79,12 @@ struct ReturnValue { std::string matlab_returnType() const; - void wrap_result(const std::string& result, FileWriter& file, + void wrap_result(const std::string& result, FileWriter& wrapperFile, const TypeAttributesTable& typeAttributes) const; void wrapTypeUnwrap(FileWriter& wrapperFile) const; - void emit_matlab(FileWriter& file) const; + void emit_matlab(FileWriter& proxyFile) const; }; } // \namespace wrap