Even more comment improvements for wrap

release/4.3a0
Andrew Melim 2012-08-27 15:19:55 +00:00
parent 7d02043855
commit 6da48bc580
5 changed files with 683 additions and 627 deletions

View File

@ -327,7 +327,7 @@ std::string Class::getTypedef() const {
void Class::comment_fragment(FileWriter& proxyFile) const
{
proxyFile.oss << "%%" << " -------Constructors-------" << endl;
proxyFile.oss << "%" << "-------Constructors-------" << endl;
BOOST_FOREACH(ArgumentList argList, constructor.args_list)
{
proxyFile.oss << "%" << name << "(";
@ -361,5 +361,24 @@ void Class::comment_fragment(FileWriter& proxyFile) const
proxyFile.oss << ")" << endl;
}
}
proxyFile.oss << "%" << "-------Static Methods-------" << endl;
BOOST_FOREACH(const StaticMethods::value_type& name_m, static_methods) {
const StaticMethod& m = name_m.second;
BOOST_FOREACH(ArgumentList argList, m.argLists)
{
proxyFile.oss << "%" << m.name << "(";
int i = 0;
BOOST_FOREACH(const Argument& arg, argList)
{
if(i != argList.size()-1)
proxyFile.oss << arg.type << " " << arg.name << ", ";
else
proxyFile.oss << arg.type << " " << arg.name;
i++;
}
proxyFile.oss << ")" << endl;
}
}
}
/* ************************************************************************* */

View File

@ -46,6 +46,24 @@ void Method::proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wrapperF
vector<string>& functionNames) const {
proxyFile.oss << " function varargout = " << name << "(this, varargin)\n";
//Comments for documentation
proxyFile.oss << " % " << name << " See GTSAM Doc for detailed info." << endl;
proxyFile.oss << " % " << "" << endl;
proxyFile.oss << " % " << "Method Overloads" << endl;
BOOST_FOREACH(ArgumentList argList, argLists)
{
proxyFile.oss << " % " << name << "(";
int i = 0;
BOOST_FOREACH(const Argument& arg, argList)
{
if(i != argList.size()-1)
proxyFile.oss << arg.type << " " << arg.name << ", ";
else
proxyFile.oss << arg.type << " " << arg.name;
i++;
}
proxyFile.oss << ")" << endl;
}
for(size_t overload = 0; overload < argLists.size(); ++overload) {
const ArgumentList& args = argLists[overload];

View File

@ -24,6 +24,7 @@
#include "Argument.h"
#include "ReturnValue.h"
#include "TypeAttributesTable.h"
#include <boost/algorithm/string.hpp>
namespace wrap {

File diff suppressed because it is too large Load Diff

View File

@ -50,6 +50,24 @@ void StaticMethod::proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wr
string upperName = name; upperName[0] = std::toupper(upperName[0], std::locale());
proxyFile.oss << " function varargout = " << upperName << "(varargin)\n";
proxyFile.oss << " % " << name << " See GTSAM Doc for detailed info." << endl;
proxyFile.oss << " % " << "" << endl;
proxyFile.oss << " % " << "Method Overloads" << endl;
BOOST_FOREACH(ArgumentList argList, argLists)
{
proxyFile.oss << " % " << name << "(";
int i = 0;
BOOST_FOREACH(const Argument& arg, argList)
{
if(i != argList.size()-1)
proxyFile.oss << arg.type << " " << arg.name << ", ";
else
proxyFile.oss << arg.type << " " << arg.name;
i++;
}
proxyFile.oss << ")" << endl;
}
for(size_t overload = 0; overload < argLists.size(); ++overload) {
const ArgumentList& args = argLists[overload];