From 84a806bf393ae2668043aec61c24ed3413b5d847 Mon Sep 17 00:00:00 2001 From: Andrew Melim Date: Wed, 29 Aug 2012 20:27:10 +0000 Subject: [PATCH] Final fixes made for wrap comments --- wrap/Class.cpp | 27 ++------ wrap/Method.cpp | 15 +---- wrap/StaticMethod.cpp | 15 +---- wrap/tests/expected/Point2.m | 25 +++----- wrap/tests/expected/Point3.m | 13 ++-- wrap/tests/expected/Test.m | 61 +++++++------------ wrap/tests/expected_namespaces/+ns1/ClassA.m | 4 +- wrap/tests/expected_namespaces/+ns1/ClassB.m | 4 +- .../expected_namespaces/+ns2/+ns3/ClassB.m | 4 +- wrap/tests/expected_namespaces/+ns2/ClassA.m | 16 ++--- wrap/tests/expected_namespaces/+ns2/ClassC.m | 4 +- wrap/tests/expected_namespaces/ClassD.m | 4 +- 12 files changed, 60 insertions(+), 132 deletions(-) diff --git a/wrap/Class.cpp b/wrap/Class.cpp index 2d76dad8e..c5c306ce6 100644 --- a/wrap/Class.cpp +++ b/wrap/Class.cpp @@ -101,8 +101,8 @@ void Class::matlab_proxy(const string& toolboxPath, const string& wrapperName, wrapperFile.oss << "\n"; functionNames.push_back(functionName); } - proxyFile.oss << " function display(obj), obj.print(''); end\n\n"; - proxyFile.oss << " function disp(obj), obj.display; end\n\n"; + proxyFile.oss << " function display(obj), obj.print(''); end\n %DISPLAY Calls print on the object\n"; + proxyFile.oss << " function disp(obj), obj.display; end\n %DISP Calls print on the object\n"; // Methods BOOST_FOREACH(const Methods::value_type& name_m, methods) { @@ -362,16 +362,7 @@ void Class::comment_fragment(FileWriter& proxyFile) const proxyFile.oss << arg.type << " " << arg.name; i++; } - proxyFile.oss << ") : returns "; - } - unsigned int retCount = 0; - BOOST_FOREACH(ReturnValue rt, m.returnVals) - { - if(retCount != m.returnVals.size() - 1) - proxyFile.oss << rt.return_type(false, rt.pair) << ", "; - else - proxyFile.oss << rt.return_type(false, rt.pair) << "" << endl; - + proxyFile.oss << ") : returns " << m.returnVals[0].return_type(false, m.returnVals[0].pair) << endl; } } @@ -392,16 +383,8 @@ void Class::comment_fragment(FileWriter& proxyFile) const proxyFile.oss << arg.type << " " << arg.name; i++; } - proxyFile.oss << ") : returns "; - } - unsigned int retCount = 0; - BOOST_FOREACH(ReturnValue rt, m.returnVals) - { - if(retCount != m.returnVals.size() - 1) - proxyFile.oss << rt.return_type(false, rt.pair) << ", "; - else - proxyFile.oss << rt.return_type(false, rt.pair) << "" << endl; - + + proxyFile.oss << ") : returns " << m.returnVals[0].return_type(false, m.returnVals[0].pair) << endl; } } diff --git a/wrap/Method.cpp b/wrap/Method.cpp index 3a03e92a9..e4def9bc0 100644 --- a/wrap/Method.cpp +++ b/wrap/Method.cpp @@ -52,7 +52,7 @@ void Method::proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wrapperF unsigned int argLCount = 0; BOOST_FOREACH(ArgumentList argList, argLists) { - proxyFile.oss << " " << up_name << "("; + proxyFile.oss << " " << name << "("; unsigned int i = 0; BOOST_FOREACH(const Argument& arg, argList) { @@ -65,21 +65,10 @@ void Method::proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wrapperF if(argLCount != argLists.size()-1) proxyFile.oss << "), "; else - proxyFile.oss << ") : returns "; + proxyFile.oss << ") : returns " << returnVals[0].return_type(false, returnVals[0].pair) << endl; argLCount++; } - unsigned int retCount = 0; - BOOST_FOREACH(ReturnValue rt, returnVals) - { - if(retCount != returnVals.size() - 1) - proxyFile.oss << rt.return_type(false, rt.pair) << ", "; - else - proxyFile.oss << rt.return_type(false, rt.pair) << "" << endl; - - } - - proxyFile.oss << endl; proxyFile.oss << " % " << "Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html" << endl; proxyFile.oss << " % " << "" << endl; proxyFile.oss << " % " << "Method Overloads" << endl; diff --git a/wrap/StaticMethod.cpp b/wrap/StaticMethod.cpp index 484f156df..d46fde81a 100644 --- a/wrap/StaticMethod.cpp +++ b/wrap/StaticMethod.cpp @@ -56,7 +56,7 @@ void StaticMethod::proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wr unsigned int argLCount = 0; BOOST_FOREACH(ArgumentList argList, argLists) { - proxyFile.oss << " " << up_name << "("; + proxyFile.oss << " " << name << "("; unsigned int i = 0; BOOST_FOREACH(const Argument& arg, argList) { @@ -69,21 +69,10 @@ void StaticMethod::proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wr if(argLCount != argLists.size()-1) proxyFile.oss << "), "; else - proxyFile.oss << ") : returns "; + proxyFile.oss << ") : returns " << returnVals[0].return_type(false, returnVals[0].pair) << endl; argLCount++; } - unsigned int retCount = 0; - BOOST_FOREACH(ReturnValue rt, returnVals) - { - if(retCount != returnVals.size() - 1) - proxyFile.oss << rt.return_type(false, rt.pair) << ", "; - else - proxyFile.oss << rt.return_type(false, rt.pair) << "" << endl; - - } - - proxyFile.oss << endl; proxyFile.oss << " % " << "Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html" << endl; proxyFile.oss << " % " << "" << endl; proxyFile.oss << " % " << "Usage" << endl; diff --git a/wrap/tests/expected/Point2.m b/wrap/tests/expected/Point2.m index 85fb369dc..913a869b5 100644 --- a/wrap/tests/expected/Point2.m +++ b/wrap/tests/expected/Point2.m @@ -38,12 +38,11 @@ classdef Point2 < handle end function display(obj), obj.print(''); end - + %DISPLAY Calls print on the object function disp(obj), obj.display; end - + %DISP Calls print on the object function varargout = argChar(this, varargin) - % ARGCHAR usage: ARGCHAR(char a) : returns void - + % ARGCHAR usage: argChar(char a) : returns void % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -56,8 +55,7 @@ classdef Point2 < handle end function varargout = argUChar(this, varargin) - % ARGUCHAR usage: ARGUCHAR(unsigned char a) : returns void - + % ARGUCHAR usage: argUChar(unsigned char a) : returns void % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -70,8 +68,7 @@ classdef Point2 < handle end function varargout = dim(this, varargin) - % DIM usage: DIM() : returns int - + % DIM usage: dim() : returns int % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -84,8 +81,7 @@ classdef Point2 < handle end function varargout = returnChar(this, varargin) - % RETURNCHAR usage: RETURNCHAR() : returns char - + % RETURNCHAR usage: returnChar() : returns char % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -98,8 +94,7 @@ classdef Point2 < handle end function varargout = vectorConfusion(this, varargin) - % VECTORCONFUSION usage: VECTORCONFUSION() : returns VectorNotEigen - + % VECTORCONFUSION usage: vectorConfusion() : returns VectorNotEigen % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -112,8 +107,7 @@ classdef Point2 < handle end function varargout = x(this, varargin) - % X usage: X() : returns double - + % X usage: x() : returns double % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -126,8 +120,7 @@ classdef Point2 < handle end function varargout = y(this, varargin) - % Y usage: Y() : returns double - + % Y usage: y() : returns double % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads diff --git a/wrap/tests/expected/Point3.m b/wrap/tests/expected/Point3.m index 88dd174e1..965815dc6 100644 --- a/wrap/tests/expected/Point3.m +++ b/wrap/tests/expected/Point3.m @@ -31,12 +31,11 @@ classdef Point3 < handle end function display(obj), obj.print(''); end - + %DISPLAY Calls print on the object function disp(obj), obj.display; end - + %DISP Calls print on the object function varargout = norm(this, varargin) - % NORM usage: NORM() : returns double - + % NORM usage: norm() : returns double % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -52,8 +51,7 @@ classdef Point3 < handle methods(Static = true) function varargout = StaticFunctionRet(varargin) - % STATICFUNCTIONRET usage: STATICFUNCTIONRET(double z) : returns Point3 - + % STATICFUNCTIONRET usage: StaticFunctionRet(double z) : returns Point3 % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Usage @@ -66,8 +64,7 @@ classdef Point3 < handle end function varargout = StaticFunction(varargin) - % STATICFUNCTION usage: STATICFUNCTION() : returns double - + % STATICFUNCTION usage: staticFunction() : returns double % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Usage diff --git a/wrap/tests/expected/Test.m b/wrap/tests/expected/Test.m index b9cc86403..d39025971 100644 --- a/wrap/tests/expected/Test.m +++ b/wrap/tests/expected/Test.m @@ -50,12 +50,11 @@ classdef Test < handle end function display(obj), obj.print(''); end - + %DISPLAY Calls print on the object function disp(obj), obj.display; end - + %DISP Calls print on the object function varargout = arg_EigenConstRef(this, varargin) - % ARG_EIGENCONSTREF usage: ARG_EIGENCONSTREF(Matrix value) : returns void - + % ARG_EIGENCONSTREF usage: arg_EigenConstRef(Matrix value) : returns void % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -68,8 +67,7 @@ classdef Test < handle end function varargout = create_MixedPtrs(this, varargin) - % CREATE_MIXEDPTRS usage: CREATE_MIXEDPTRS() : returns pair< Test, SharedTest > - + % CREATE_MIXEDPTRS usage: create_MixedPtrs() : returns pair< Test, SharedTest > % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -82,8 +80,7 @@ classdef Test < handle end function varargout = create_ptrs(this, varargin) - % CREATE_PTRS usage: CREATE_PTRS() : returns pair< SharedTest, SharedTest > - + % CREATE_PTRS usage: create_ptrs() : returns pair< SharedTest, SharedTest > % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -96,8 +93,7 @@ classdef Test < handle end function varargout = print(this, varargin) - % PRINT usage: PRINT() : returns void - + % PRINT usage: print() : returns void % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -110,8 +106,7 @@ classdef Test < handle end function varargout = return_Point2Ptr(this, varargin) - % RETURN_POINT2PTR usage: RETURN_POINT2PTR(bool value) : returns Point2 - + % RETURN_POINT2PTR usage: return_Point2Ptr(bool value) : returns Point2 % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -124,8 +119,7 @@ classdef Test < handle end function varargout = return_Test(this, varargin) - % RETURN_TEST usage: RETURN_TEST(Test value) : returns Test - + % RETURN_TEST usage: return_Test(Test value) : returns Test % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -138,8 +132,7 @@ classdef Test < handle end function varargout = return_TestPtr(this, varargin) - % RETURN_TESTPTR usage: RETURN_TESTPTR(Test value) : returns Test - + % RETURN_TESTPTR usage: return_TestPtr(Test value) : returns Test % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -152,8 +145,7 @@ classdef Test < handle end function varargout = return_bool(this, varargin) - % RETURN_BOOL usage: RETURN_BOOL(bool value) : returns bool - + % RETURN_BOOL usage: return_bool(bool value) : returns bool % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -166,8 +158,7 @@ classdef Test < handle end function varargout = return_double(this, varargin) - % RETURN_DOUBLE usage: RETURN_DOUBLE(double value) : returns double - + % RETURN_DOUBLE usage: return_double(double value) : returns double % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -180,8 +171,7 @@ classdef Test < handle end function varargout = return_field(this, varargin) - % RETURN_FIELD usage: RETURN_FIELD(Test t) : returns bool - + % RETURN_FIELD usage: return_field(Test t) : returns bool % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -194,8 +184,7 @@ classdef Test < handle end function varargout = return_int(this, varargin) - % RETURN_INT usage: RETURN_INT(int value) : returns int - + % RETURN_INT usage: return_int(int value) : returns int % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -208,8 +197,7 @@ classdef Test < handle end function varargout = return_matrix1(this, varargin) - % RETURN_MATRIX1 usage: RETURN_MATRIX1(Matrix value) : returns Matrix - + % RETURN_MATRIX1 usage: return_matrix1(Matrix value) : returns Matrix % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -222,8 +210,7 @@ classdef Test < handle end function varargout = return_matrix2(this, varargin) - % RETURN_MATRIX2 usage: RETURN_MATRIX2(Matrix value) : returns Matrix - + % RETURN_MATRIX2 usage: return_matrix2(Matrix value) : returns Matrix % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -236,8 +223,7 @@ classdef Test < handle end function varargout = return_pair(this, varargin) - % RETURN_PAIR usage: RETURN_PAIR(Vector v, Matrix A) : returns pair< Vector, Matrix > - + % RETURN_PAIR usage: return_pair(Vector v, Matrix A) : returns pair< Vector, Matrix > % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -250,8 +236,7 @@ classdef Test < handle end function varargout = return_ptrs(this, varargin) - % RETURN_PTRS usage: RETURN_PTRS(Test p1, Test p2) : returns pair< SharedTest, SharedTest > - + % RETURN_PTRS usage: return_ptrs(Test p1, Test p2) : returns pair< SharedTest, SharedTest > % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -264,8 +249,7 @@ classdef Test < handle end function varargout = return_size_t(this, varargin) - % RETURN_SIZE_T usage: RETURN_SIZE_T(size_t value) : returns size_t - + % RETURN_SIZE_T usage: return_size_t(size_t value) : returns size_t % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -278,8 +262,7 @@ classdef Test < handle end function varargout = return_string(this, varargin) - % RETURN_STRING usage: RETURN_STRING(string value) : returns string - + % RETURN_STRING usage: return_string(string value) : returns string % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -292,8 +275,7 @@ classdef Test < handle end function varargout = return_vector1(this, varargin) - % RETURN_VECTOR1 usage: RETURN_VECTOR1(Vector value) : returns Vector - + % RETURN_VECTOR1 usage: return_vector1(Vector value) : returns Vector % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -306,8 +288,7 @@ classdef Test < handle end function varargout = return_vector2(this, varargin) - % RETURN_VECTOR2 usage: RETURN_VECTOR2(Vector value) : returns Vector - + % RETURN_VECTOR2 usage: return_vector2(Vector value) : returns Vector % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads diff --git a/wrap/tests/expected_namespaces/+ns1/ClassA.m b/wrap/tests/expected_namespaces/+ns1/ClassA.m index f557bc621..2ce280041 100644 --- a/wrap/tests/expected_namespaces/+ns1/ClassA.m +++ b/wrap/tests/expected_namespaces/+ns1/ClassA.m @@ -28,9 +28,9 @@ classdef ClassA < handle end function display(obj), obj.print(''); end - + %DISPLAY Calls print on the object function disp(obj), obj.display; end - + %DISP Calls print on the object end methods(Static = true) diff --git a/wrap/tests/expected_namespaces/+ns1/ClassB.m b/wrap/tests/expected_namespaces/+ns1/ClassB.m index 70be8a2ff..5c4d82882 100644 --- a/wrap/tests/expected_namespaces/+ns1/ClassB.m +++ b/wrap/tests/expected_namespaces/+ns1/ClassB.m @@ -28,9 +28,9 @@ classdef ClassB < handle end function display(obj), obj.print(''); end - + %DISPLAY Calls print on the object function disp(obj), obj.display; end - + %DISP Calls print on the object end methods(Static = true) diff --git a/wrap/tests/expected_namespaces/+ns2/+ns3/ClassB.m b/wrap/tests/expected_namespaces/+ns2/+ns3/ClassB.m index 07d496ddc..ff5ed9e3c 100644 --- a/wrap/tests/expected_namespaces/+ns2/+ns3/ClassB.m +++ b/wrap/tests/expected_namespaces/+ns2/+ns3/ClassB.m @@ -28,9 +28,9 @@ classdef ClassB < handle end function display(obj), obj.print(''); end - + %DISPLAY Calls print on the object function disp(obj), obj.display; end - + %DISP Calls print on the object end methods(Static = true) diff --git a/wrap/tests/expected_namespaces/+ns2/ClassA.m b/wrap/tests/expected_namespaces/+ns2/ClassA.m index 46e43bdc6..d8f1dbc88 100644 --- a/wrap/tests/expected_namespaces/+ns2/ClassA.m +++ b/wrap/tests/expected_namespaces/+ns2/ClassA.m @@ -32,12 +32,11 @@ classdef ClassA < handle end function display(obj), obj.print(''); end - + %DISPLAY Calls print on the object function disp(obj), obj.display; end - + %DISP Calls print on the object function varargout = memberFunction(this, varargin) - % MEMBERFUNCTION usage: MEMBERFUNCTION() : returns double - + % MEMBERFUNCTION usage: memberFunction() : returns double % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -50,8 +49,7 @@ classdef ClassA < handle end function varargout = nsArg(this, varargin) - % NSARG usage: NSARG(ClassB arg) : returns int - + % NSARG usage: nsArg(ClassB arg) : returns int % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -64,8 +62,7 @@ classdef ClassA < handle end function varargout = nsReturn(this, varargin) - % NSRETURN usage: NSRETURN(double q) : returns ns2::ns3::ClassB - + % NSRETURN usage: nsReturn(double q) : returns ns2::ns3::ClassB % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Method Overloads @@ -81,8 +78,7 @@ classdef ClassA < handle methods(Static = true) function varargout = Afunction(varargin) - % AFUNCTION usage: AFUNCTION() : returns double - + % AFUNCTION usage: afunction() : returns double % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html % % Usage diff --git a/wrap/tests/expected_namespaces/+ns2/ClassC.m b/wrap/tests/expected_namespaces/+ns2/ClassC.m index a5485afcc..86cf9819f 100644 --- a/wrap/tests/expected_namespaces/+ns2/ClassC.m +++ b/wrap/tests/expected_namespaces/+ns2/ClassC.m @@ -28,9 +28,9 @@ classdef ClassC < handle end function display(obj), obj.print(''); end - + %DISPLAY Calls print on the object function disp(obj), obj.display; end - + %DISP Calls print on the object end methods(Static = true) diff --git a/wrap/tests/expected_namespaces/ClassD.m b/wrap/tests/expected_namespaces/ClassD.m index 1e672466c..13bac35d6 100644 --- a/wrap/tests/expected_namespaces/ClassD.m +++ b/wrap/tests/expected_namespaces/ClassD.m @@ -28,9 +28,9 @@ classdef ClassD < handle end function display(obj), obj.print(''); end - + %DISPLAY Calls print on the object function disp(obj), obj.display; end - + %DISP Calls print on the object end methods(Static = true)