Merge branch 'fix/BAD_wrap_checkpoint' into fix/BAD_wrap
commit
8e8cbd2407
|
|
@ -156,36 +156,37 @@ void ArgumentList::emit_prototype(FileWriter& file, const string& name) const {
|
|||
file.oss << ")";
|
||||
}
|
||||
/* ************************************************************************* */
|
||||
void ArgumentList::emit_call(FileWriter& file, const ReturnValue& returnVal,
|
||||
const string& wrapperName, int id, bool staticMethod) const {
|
||||
returnVal.emit_matlab(file);
|
||||
file.oss << wrapperName << "(" << id;
|
||||
void ArgumentList::emit_call(FileWriter& proxyFile,
|
||||
const ReturnValue& returnVal, const string& wrapperName, int id,
|
||||
bool staticMethod) const {
|
||||
returnVal.emit_matlab(proxyFile);
|
||||
proxyFile.oss << wrapperName << "(" << id;
|
||||
if (!staticMethod)
|
||||
file.oss << ", this";
|
||||
file.oss << ", varargin{:});\n";
|
||||
proxyFile.oss << ", this";
|
||||
proxyFile.oss << ", varargin{:});\n";
|
||||
}
|
||||
/* ************************************************************************* */
|
||||
void ArgumentList::emit_conditional_call(FileWriter& file,
|
||||
void ArgumentList::emit_conditional_call(FileWriter& proxyFile,
|
||||
const ReturnValue& returnVal, const string& wrapperName, int id,
|
||||
bool staticMethod) const {
|
||||
// Check nr of arguments
|
||||
file.oss << "if length(varargin) == " << size();
|
||||
proxyFile.oss << "if length(varargin) == " << size();
|
||||
if (size() > 0)
|
||||
file.oss << " && ";
|
||||
proxyFile.oss << " && ";
|
||||
// ...and their type.names
|
||||
bool first = true;
|
||||
for (size_t i = 0; i < size(); i++) {
|
||||
if (!first)
|
||||
file.oss << " && ";
|
||||
file.oss << "isa(varargin{" << i + 1 << "},'" << (*this)[i].matlabClass(".")
|
||||
<< "')";
|
||||
proxyFile.oss << " && ";
|
||||
proxyFile.oss << "isa(varargin{" << i + 1 << "},'"
|
||||
<< (*this)[i].matlabClass(".") << "')";
|
||||
first = false;
|
||||
}
|
||||
file.oss << "\n";
|
||||
proxyFile.oss << "\n";
|
||||
|
||||
// output call to C++ wrapper
|
||||
file.oss << " ";
|
||||
emit_call(file, returnVal, wrapperName, id, staticMethod);
|
||||
proxyFile.oss << " ";
|
||||
emit_call(proxyFile, returnVal, wrapperName, id, staticMethod);
|
||||
}
|
||||
/* ************************************************************************* */
|
||||
|
||||
|
|
|
|||
|
|
@ -77,23 +77,23 @@ struct ArgumentList: public std::vector<Argument> {
|
|||
void emit_prototype(FileWriter& file, const std::string& name) const;
|
||||
|
||||
/**
|
||||
* emit emit MATLAB call to wrapper
|
||||
* @param file output stream
|
||||
* emit emit MATLAB call to proxy
|
||||
* @param proxyFile output stream
|
||||
* @param returnVal the return value
|
||||
* @param wrapperName of method or function
|
||||
* @param staticMethod flag to emit "this" in call
|
||||
*/
|
||||
void emit_call(FileWriter& file, const ReturnValue& returnVal,
|
||||
void emit_call(FileWriter& proxyFile, const ReturnValue& returnVal,
|
||||
const std::string& wrapperName, int id, bool staticMethod = false) const;
|
||||
|
||||
/**
|
||||
* emit conditional MATLAB call to wrapper (checking arguments first)
|
||||
* @param file output stream
|
||||
* emit conditional MATLAB call to proxy (checking arguments first)
|
||||
* @param proxyFile output stream
|
||||
* @param returnVal the return value
|
||||
* @param wrapperName of method or function
|
||||
* @param staticMethod flag to emit "this" in call
|
||||
*/
|
||||
void emit_conditional_call(FileWriter& file, const ReturnValue& returnVal,
|
||||
void emit_conditional_call(FileWriter& proxyFile, const ReturnValue& returnVal,
|
||||
const std::string& wrapperName, int id, bool staticMethod = false) const;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -276,14 +276,14 @@ map<string, METHOD> expandMethodTemplate(const map<string, METHOD>& 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> Class::expandTemplate(const string& templateArg,
|
||||
const vector<Qualified >& instantiations) const {
|
||||
const vector<Qualified>& instantiations) const {
|
||||
vector<Class> 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,51 +39,51 @@ void Method::addOverload(bool verbose, bool is_const, const std::string& name,
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
void Method::proxy_wrapper_fragments(FileWriter& file, FileWriter& wrapperFile,
|
||||
const string& cppClassName, const std::string& matlabQualName,
|
||||
const std::string& matlabUniqueName, const string& wrapperName,
|
||||
const TypeAttributesTable& typeAttributes,
|
||||
void Method::proxy_wrapper_fragments(FileWriter& proxyFile,
|
||||
FileWriter& wrapperFile, const string& cppClassName,
|
||||
const std::string& matlabQualName, const std::string& matlabUniqueName,
|
||||
const string& wrapperName, const TypeAttributesTable& typeAttributes,
|
||||
vector<string>& functionNames) const {
|
||||
|
||||
// Create function header
|
||||
file.oss << " function varargout = " << name << "(this, varargin)\n";
|
||||
proxyFile.oss << " function varargout = " << name << "(this, varargin)\n";
|
||||
|
||||
// Emit comments for documentation
|
||||
string up_name = boost::to_upper_copy(name);
|
||||
file.oss << " % " << up_name << " usage: ";
|
||||
proxyFile.oss << " % " << up_name << " usage: ";
|
||||
unsigned int argLCount = 0;
|
||||
BOOST_FOREACH(ArgumentList argList, argLists) {
|
||||
argList.emit_prototype(file, name);
|
||||
argList.emit_prototype(proxyFile, name);
|
||||
if (argLCount != argLists.size() - 1)
|
||||
file.oss << ", ";
|
||||
proxyFile.oss << ", ";
|
||||
else
|
||||
file.oss << " : returns "
|
||||
<< returnVals[0].return_type(false) << endl;
|
||||
proxyFile.oss << " : returns " << returnVals[0].return_type(false)
|
||||
<< endl;
|
||||
argLCount++;
|
||||
}
|
||||
|
||||
// Emit URL to Doxygen page
|
||||
file.oss << " % "
|
||||
proxyFile.oss << " % "
|
||||
<< "Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html"
|
||||
<< endl;
|
||||
|
||||
// Document all overloads, if any
|
||||
if (argLists.size() > 1) {
|
||||
file.oss << " % " << "" << endl;
|
||||
file.oss << " % " << "Method Overloads" << endl;
|
||||
proxyFile.oss << " % " << "" << endl;
|
||||
proxyFile.oss << " % " << "Method Overloads" << endl;
|
||||
BOOST_FOREACH(ArgumentList argList, argLists) {
|
||||
file.oss << " % ";
|
||||
argList.emit_prototype(file, name);
|
||||
file.oss << endl;
|
||||
proxyFile.oss << " % ";
|
||||
argList.emit_prototype(proxyFile, name);
|
||||
proxyFile.oss << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle special case of single overload with all numeric arguments
|
||||
if (argLists.size() == 1 && argLists[0].allScalar()) {
|
||||
// Output proxy matlab code
|
||||
file.oss << " ";
|
||||
proxyFile.oss << " ";
|
||||
const int id = (int) functionNames.size();
|
||||
argLists[0].emit_call(file, returnVals[0], wrapperName, id);
|
||||
argLists[0].emit_call(proxyFile, returnVals[0], wrapperName, id);
|
||||
|
||||
// Output C++ wrapper code
|
||||
const string wrapFunctionName = wrapper_fragment(wrapperFile, cppClassName,
|
||||
|
|
@ -96,9 +96,9 @@ void Method::proxy_wrapper_fragments(FileWriter& file, FileWriter& wrapperFile,
|
|||
for (size_t overload = 0; overload < argLists.size(); ++overload) {
|
||||
|
||||
// Output proxy matlab code
|
||||
file.oss << " " << (overload == 0 ? "" : "else");
|
||||
proxyFile.oss << " " << (overload == 0 ? "" : "else");
|
||||
const int id = (int) functionNames.size();
|
||||
argLists[overload].emit_conditional_call(file, returnVals[overload],
|
||||
argLists[overload].emit_conditional_call(proxyFile, returnVals[overload],
|
||||
wrapperName, id);
|
||||
|
||||
// Output C++ wrapper code
|
||||
|
|
@ -108,20 +108,20 @@ void Method::proxy_wrapper_fragments(FileWriter& file, FileWriter& wrapperFile,
|
|||
// Add to function list
|
||||
functionNames.push_back(wrapFunctionName);
|
||||
}
|
||||
file.oss << " else\n";
|
||||
file.oss
|
||||
proxyFile.oss << " else\n";
|
||||
proxyFile.oss
|
||||
<< " error('Arguments do not match any overload of function "
|
||||
<< matlabQualName << "." << name << "');" << endl;
|
||||
file.oss << " end\n";
|
||||
proxyFile.oss << " end\n";
|
||||
}
|
||||
|
||||
file.oss << " end\n";
|
||||
proxyFile.oss << " end\n";
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
string Method::wrapper_fragment(FileWriter& file, const string& cppClassName,
|
||||
const string& matlabUniqueName, int overload, int id,
|
||||
const TypeAttributesTable& typeAttributes) const {
|
||||
string Method::wrapper_fragment(FileWriter& wrapperFile,
|
||||
const string& cppClassName, const string& matlabUniqueName, int overload,
|
||||
int id, const TypeAttributesTable& typeAttributes) const {
|
||||
|
||||
// generate code
|
||||
|
||||
|
|
@ -132,39 +132,39 @@ string Method::wrapper_fragment(FileWriter& file, const string& cppClassName,
|
|||
const ReturnValue& returnVal = returnVals[overload];
|
||||
|
||||
// call
|
||||
file.oss << "void " << wrapFunctionName
|
||||
wrapperFile.oss << "void " << wrapFunctionName
|
||||
<< "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
||||
// start
|
||||
file.oss << "{\n";
|
||||
wrapperFile.oss << "{\n";
|
||||
|
||||
returnVal.wrapTypeUnwrap(file);
|
||||
returnVal.wrapTypeUnwrap(wrapperFile);
|
||||
|
||||
file.oss << " typedef boost::shared_ptr<" << cppClassName << "> Shared;"
|
||||
<< endl;
|
||||
wrapperFile.oss << " typedef boost::shared_ptr<" << cppClassName
|
||||
<< "> Shared;" << endl;
|
||||
|
||||
// check arguments
|
||||
// extra argument obj -> nargin-1 is passed !
|
||||
// example: checkArguments("equals",nargout,nargin-1,2);
|
||||
file.oss << " checkArguments(\"" << name << "\",nargout,nargin-1,"
|
||||
wrapperFile.oss << " checkArguments(\"" << name << "\",nargout,nargin-1,"
|
||||
<< args.size() << ");\n";
|
||||
|
||||
// get class pointer
|
||||
// example: shared_ptr<Test> = unwrap_shared_ptr< Test >(in[0], "Test");
|
||||
file.oss << " Shared obj = unwrap_shared_ptr<" << cppClassName
|
||||
wrapperFile.oss << " Shared obj = unwrap_shared_ptr<" << cppClassName
|
||||
<< ">(in[0], \"ptr_" << matlabUniqueName << "\");" << endl;
|
||||
// unwrap arguments, see Argument.cpp
|
||||
args.matlab_unwrap(file, 1);
|
||||
args.matlab_unwrap(wrapperFile, 1);
|
||||
|
||||
// call method and wrap result
|
||||
// example: out[0]=wrap<bool>(self->return_field(t));
|
||||
if (returnVal.type1.name != "void")
|
||||
returnVal.wrap_result("obj->" + name + "(" + args.names() + ")", file,
|
||||
typeAttributes);
|
||||
returnVal.wrap_result("obj->" + name + "(" + args.names() + ")",
|
||||
wrapperFile, typeAttributes);
|
||||
else
|
||||
file.oss << " obj->" + name + "(" + args.names() + ");\n";
|
||||
wrapperFile.oss << " obj->" + name + "(" + args.names() + ");\n";
|
||||
|
||||
// finish
|
||||
file.oss << "}\n";
|
||||
wrapperFile.oss << "}\n";
|
||||
|
||||
return wrapFunctionName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ struct Method {
|
|||
|
||||
/// Constructor creates empty object
|
||||
Method(bool verbose = true) :
|
||||
verbose_(verbose), is_const_(false) {}
|
||||
verbose_(verbose), is_const_(false) {
|
||||
}
|
||||
|
||||
// Then the instance variables are set directly by the Module constructor
|
||||
bool verbose_;
|
||||
|
|
@ -45,22 +46,20 @@ struct Method {
|
|||
// with those in rhs, but in subsequent calls it adds additional argument
|
||||
// lists as function overloads.
|
||||
void addOverload(bool verbose, bool is_const, const std::string& name,
|
||||
const ArgumentList& args, const ReturnValue& retVal);
|
||||
const ArgumentList& args, const ReturnValue& retVal);
|
||||
|
||||
// MATLAB code generation
|
||||
// classPath is class directory, e.g., ../matlab/@Point2
|
||||
void proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wrapperFile,
|
||||
const std::string& cppClassName, const std::string& matlabQualName, const std::string& matlabUniqueName,
|
||||
const std::string& wrapperName, const TypeAttributesTable& typeAttributes,
|
||||
std::vector<std::string>& functionNames) const;
|
||||
const std::string& cppClassName, const std::string& matlabQualName,
|
||||
const std::string& matlabUniqueName, const std::string& wrapperName,
|
||||
const TypeAttributesTable& typeAttributes,
|
||||
std::vector<std::string>& functionNames) const;
|
||||
|
||||
private:
|
||||
std::string wrapper_fragment(FileWriter& file,
|
||||
const std::string& cppClassName,
|
||||
const std::string& matlabUniqueName,
|
||||
int overload,
|
||||
int id,
|
||||
const TypeAttributesTable& typeAttributes) const; ///< cpp wrapper
|
||||
std::string wrapper_fragment(FileWriter& wrapperFile,
|
||||
const std::string& cppClassName, const std::string& matlabUniqueName,
|
||||
int overload, int id, const TypeAttributesTable& typeAttributes) const; ///< cpp wrapper
|
||||
};
|
||||
|
||||
} // \namespace wrap
|
||||
|
|
|
|||
|
|
@ -65,12 +65,15 @@ typedef rule<BOOST_SPIRIT_CLASSIC_NS::phrase_scanner_t> Rule;
|
|||
// If a number of template arguments were given, generate a number of expanded
|
||||
// class names, e.g., PriorFactor -> PriorFactorPose2, and add those classes
|
||||
static void handle_possible_template(vector<Class>& classes, const Class& cls,
|
||||
const string& templateArgName, const vector<Qualified>& instantiations) {
|
||||
if (instantiations.empty()) {
|
||||
const vector<Qualified>& instantiations) {
|
||||
if (cls.templateArgs.empty() || instantiations.empty()) {
|
||||
classes.push_back(cls);
|
||||
} else {
|
||||
if (cls.templateArgs.size() != 1)
|
||||
throw std::runtime_error(
|
||||
"In-line template instantiations only handle a single template argument");
|
||||
vector<Class> classInstantiations = //
|
||||
cls.expandTemplate(templateArgName, instantiations);
|
||||
cls.expandTemplate(cls.templateArgs.front(), instantiations);
|
||||
BOOST_FOREACH(const Class& c, classInstantiations)
|
||||
classes.push_back(c);
|
||||
}
|
||||
|
|
@ -298,7 +301,7 @@ void Module::parseMarkup(const std::string& data) {
|
|||
[assign_a(cls.namespaces, namespaces)]
|
||||
[assign_a(cls.deconstructor.name,cls.name)]
|
||||
[bl::bind(&handle_possible_template, bl::var(classes), bl::var(cls),
|
||||
bl::var(templateArgName), bl::var(templateInstantiations))]
|
||||
bl::var(templateInstantiations))]
|
||||
[clear_a(templateInstantiations)]
|
||||
[assign_a(constructor, constructor0)]
|
||||
[assign_a(cls,cls0)];
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
* @author Richard Roberts
|
||||
*/
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#include "ReturnValue.h"
|
||||
#include "utilities.h"
|
||||
#include <boost/foreach.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace wrap;
|
||||
|
|
@ -52,9 +52,9 @@ void ReturnType::wrap_result(const string& out, const string& result,
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
void ReturnType::wrapTypeUnwrap(FileWriter& file) const {
|
||||
void ReturnType::wrapTypeUnwrap(FileWriter& wrapperFile) const {
|
||||
if (category == CLASS)
|
||||
file.oss << " typedef boost::shared_ptr<" << qualifiedName("::")
|
||||
wrapperFile.oss << " typedef boost::shared_ptr<" << qualifiedName("::")
|
||||
<< "> Shared" << name << ";" << endl;
|
||||
}
|
||||
|
||||
|
|
@ -72,33 +72,33 @@ string ReturnValue::matlab_returnType() const {
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
void ReturnValue::wrap_result(const string& result, FileWriter& file,
|
||||
void ReturnValue::wrap_result(const string& result, FileWriter& wrapperFile,
|
||||
const TypeAttributesTable& typeAttributes) const {
|
||||
if (isPair) {
|
||||
// For a pair, store the returned pair so we do not evaluate the function twice
|
||||
file.oss << " " << return_type(true) << " pairResult = " << result
|
||||
wrapperFile.oss << " " << return_type(true) << " pairResult = " << result
|
||||
<< ";\n";
|
||||
type1.wrap_result(" out[0]", "pairResult.first", file, typeAttributes);
|
||||
type2.wrap_result(" out[1]", "pairResult.second", file, typeAttributes);
|
||||
type1.wrap_result(" out[0]", "pairResult.first", wrapperFile, typeAttributes);
|
||||
type2.wrap_result(" out[1]", "pairResult.second", wrapperFile, typeAttributes);
|
||||
} else { // Not a pair
|
||||
type1.wrap_result(" out[0]", result, file, typeAttributes);
|
||||
type1.wrap_result(" out[0]", result, wrapperFile, typeAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
void ReturnValue::wrapTypeUnwrap(FileWriter& file) const {
|
||||
type1.wrapTypeUnwrap(file);
|
||||
void ReturnValue::wrapTypeUnwrap(FileWriter& wrapperFile) const {
|
||||
type1.wrapTypeUnwrap(wrapperFile);
|
||||
if (isPair)
|
||||
type2.wrapTypeUnwrap(file);
|
||||
type2.wrapTypeUnwrap(wrapperFile);
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
void ReturnValue::emit_matlab(FileWriter& file) const {
|
||||
void ReturnValue::emit_matlab(FileWriter& proxyFile) const {
|
||||
string output;
|
||||
if (isPair)
|
||||
file.oss << "[ varargout{1} varargout{2} ] = ";
|
||||
proxyFile.oss << "[ varargout{1} varargout{2} ] = ";
|
||||
else if (type1.category != ReturnType::VOID)
|
||||
file.oss << "varargout{1} = ";
|
||||
proxyFile.oss << "varargout{1} = ";
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ classdef MyFactorPosePoint2 < handle
|
|||
function obj = MyFactorPosePoint2(varargin)
|
||||
if nargin == 2 && isa(varargin{1}, 'uint64') && varargin{1} == uint64(5139824614673773682)
|
||||
my_ptr = varargin{2};
|
||||
geometry_wrapper(53, my_ptr);
|
||||
geometry_wrapper(67, my_ptr);
|
||||
elseif nargin == 4 && isa(varargin{1},'numeric') && isa(varargin{2},'numeric') && isa(varargin{3},'double') && isa(varargin{4},'gtsam.noiseModel.Base')
|
||||
my_ptr = geometry_wrapper(54, varargin{1}, varargin{2}, varargin{3}, varargin{4});
|
||||
my_ptr = geometry_wrapper(68, varargin{1}, varargin{2}, varargin{3}, varargin{4});
|
||||
else
|
||||
error('Arguments do not match any overload of MyFactorPosePoint2 constructor');
|
||||
end
|
||||
|
|
@ -22,7 +22,7 @@ classdef MyFactorPosePoint2 < handle
|
|||
end
|
||||
|
||||
function delete(obj)
|
||||
geometry_wrapper(55, obj.ptr_MyFactorPosePoint2);
|
||||
geometry_wrapper(69, obj.ptr_MyFactorPosePoint2);
|
||||
end
|
||||
|
||||
function display(obj), obj.print(''); end
|
||||
|
|
|
|||
|
|
@ -5,6 +5,13 @@
|
|||
%MyTemplatePoint2()
|
||||
%
|
||||
%-------Methods-------
|
||||
%accept_T(Point2 value) : returns void
|
||||
%accept_Tptr(Point2 value) : returns void
|
||||
%create_MixedPtrs() : returns pair< Point2, Point2 >
|
||||
%create_ptrs() : returns pair< Point2, Point2 >
|
||||
%return_T(Point2 value) : returns Point2
|
||||
%return_Tptr(Point2 value) : returns Point2
|
||||
%return_ptrs(Point2 p1, Point2 p2) : returns pair< Point2, Point2 >
|
||||
%templatedMethod(Test t) : returns void
|
||||
%
|
||||
classdef MyTemplatePoint2 < MyBase
|
||||
|
|
@ -37,11 +44,73 @@ classdef MyTemplatePoint2 < MyBase
|
|||
%DISPLAY Calls print on the object
|
||||
function disp(obj), obj.display; end
|
||||
%DISP Calls print on the object
|
||||
function varargout = accept_T(this, varargin)
|
||||
% ACCEPT_T usage: accept_T(Point2 value) : returns void
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 1 && isa(varargin{1},'Point2')
|
||||
geometry_wrapper(47, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint2.accept_T');
|
||||
end
|
||||
end
|
||||
|
||||
function varargout = accept_Tptr(this, varargin)
|
||||
% ACCEPT_TPTR usage: accept_Tptr(Point2 value) : returns void
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 1 && isa(varargin{1},'Point2')
|
||||
geometry_wrapper(48, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint2.accept_Tptr');
|
||||
end
|
||||
end
|
||||
|
||||
function varargout = create_MixedPtrs(this, varargin)
|
||||
% CREATE_MIXEDPTRS usage: create_MixedPtrs() : returns pair< Point2, Point2 >
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
[ varargout{1} varargout{2} ] = geometry_wrapper(49, this, varargin{:});
|
||||
end
|
||||
|
||||
function varargout = create_ptrs(this, varargin)
|
||||
% CREATE_PTRS usage: create_ptrs() : returns pair< Point2, Point2 >
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
[ varargout{1} varargout{2} ] = geometry_wrapper(50, this, varargin{:});
|
||||
end
|
||||
|
||||
function varargout = return_T(this, varargin)
|
||||
% RETURN_T usage: return_T(Point2 value) : returns Point2
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 1 && isa(varargin{1},'Point2')
|
||||
varargout{1} = geometry_wrapper(51, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint2.return_T');
|
||||
end
|
||||
end
|
||||
|
||||
function varargout = return_Tptr(this, varargin)
|
||||
% RETURN_TPTR usage: return_Tptr(Point2 value) : returns Point2
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 1 && isa(varargin{1},'Point2')
|
||||
varargout{1} = geometry_wrapper(52, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint2.return_Tptr');
|
||||
end
|
||||
end
|
||||
|
||||
function varargout = return_ptrs(this, varargin)
|
||||
% RETURN_PTRS usage: return_ptrs(Point2 p1, Point2 p2) : returns pair< Point2, Point2 >
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 2 && isa(varargin{1},'Point2') && isa(varargin{2},'Point2')
|
||||
[ varargout{1} varargout{2} ] = geometry_wrapper(53, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint2.return_ptrs');
|
||||
end
|
||||
end
|
||||
|
||||
function varargout = templatedMethod(this, varargin)
|
||||
% TEMPLATEDMETHOD usage: templatedMethod(Test t) : returns void
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 1 && isa(varargin{1},'Test')
|
||||
geometry_wrapper(47, this, varargin{:});
|
||||
geometry_wrapper(54, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint2.templatedMethod');
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,6 +5,13 @@
|
|||
%MyTemplatePoint3()
|
||||
%
|
||||
%-------Methods-------
|
||||
%accept_T(Point3 value) : returns void
|
||||
%accept_Tptr(Point3 value) : returns void
|
||||
%create_MixedPtrs() : returns pair< Point3, Point3 >
|
||||
%create_ptrs() : returns pair< Point3, Point3 >
|
||||
%return_T(Point3 value) : returns Point3
|
||||
%return_Tptr(Point3 value) : returns Point3
|
||||
%return_ptrs(Point3 p1, Point3 p2) : returns pair< Point3, Point3 >
|
||||
%templatedMethod(Test t) : returns void
|
||||
%
|
||||
classdef MyTemplatePoint3 < MyBase
|
||||
|
|
@ -17,11 +24,11 @@ classdef MyTemplatePoint3 < MyBase
|
|||
if nargin == 2
|
||||
my_ptr = varargin{2};
|
||||
else
|
||||
my_ptr = geometry_wrapper(49, varargin{2});
|
||||
my_ptr = geometry_wrapper(56, varargin{2});
|
||||
end
|
||||
base_ptr = geometry_wrapper(48, my_ptr);
|
||||
base_ptr = geometry_wrapper(55, my_ptr);
|
||||
elseif nargin == 0
|
||||
[ my_ptr, base_ptr ] = geometry_wrapper(50);
|
||||
[ my_ptr, base_ptr ] = geometry_wrapper(57);
|
||||
else
|
||||
error('Arguments do not match any overload of MyTemplatePoint3 constructor');
|
||||
end
|
||||
|
|
@ -30,18 +37,80 @@ classdef MyTemplatePoint3 < MyBase
|
|||
end
|
||||
|
||||
function delete(obj)
|
||||
geometry_wrapper(51, obj.ptr_MyTemplatePoint3);
|
||||
geometry_wrapper(58, obj.ptr_MyTemplatePoint3);
|
||||
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 = accept_T(this, varargin)
|
||||
% ACCEPT_T usage: accept_T(Point3 value) : returns void
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 1 && isa(varargin{1},'Point3')
|
||||
geometry_wrapper(59, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint3.accept_T');
|
||||
end
|
||||
end
|
||||
|
||||
function varargout = accept_Tptr(this, varargin)
|
||||
% ACCEPT_TPTR usage: accept_Tptr(Point3 value) : returns void
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 1 && isa(varargin{1},'Point3')
|
||||
geometry_wrapper(60, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint3.accept_Tptr');
|
||||
end
|
||||
end
|
||||
|
||||
function varargout = create_MixedPtrs(this, varargin)
|
||||
% CREATE_MIXEDPTRS usage: create_MixedPtrs() : returns pair< Point3, Point3 >
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
[ varargout{1} varargout{2} ] = geometry_wrapper(61, this, varargin{:});
|
||||
end
|
||||
|
||||
function varargout = create_ptrs(this, varargin)
|
||||
% CREATE_PTRS usage: create_ptrs() : returns pair< Point3, Point3 >
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
[ varargout{1} varargout{2} ] = geometry_wrapper(62, this, varargin{:});
|
||||
end
|
||||
|
||||
function varargout = return_T(this, varargin)
|
||||
% RETURN_T usage: return_T(Point3 value) : returns Point3
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 1 && isa(varargin{1},'Point3')
|
||||
varargout{1} = geometry_wrapper(63, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint3.return_T');
|
||||
end
|
||||
end
|
||||
|
||||
function varargout = return_Tptr(this, varargin)
|
||||
% RETURN_TPTR usage: return_Tptr(Point3 value) : returns Point3
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 1 && isa(varargin{1},'Point3')
|
||||
varargout{1} = geometry_wrapper(64, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint3.return_Tptr');
|
||||
end
|
||||
end
|
||||
|
||||
function varargout = return_ptrs(this, varargin)
|
||||
% RETURN_PTRS usage: return_ptrs(Point3 p1, Point3 p2) : returns pair< Point3, Point3 >
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 2 && isa(varargin{1},'Point3') && isa(varargin{2},'Point3')
|
||||
[ varargout{1} varargout{2} ] = geometry_wrapper(65, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint3.return_ptrs');
|
||||
end
|
||||
end
|
||||
|
||||
function varargout = templatedMethod(this, varargin)
|
||||
% TEMPLATEDMETHOD usage: templatedMethod(Test t) : returns void
|
||||
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||
if length(varargin) == 1 && isa(varargin{1},'Test')
|
||||
geometry_wrapper(52, this, varargin{:});
|
||||
geometry_wrapper(66, this, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function MyTemplatePoint3.templatedMethod');
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
function varargout = aGlobalFunction(varargin)
|
||||
if length(varargin) == 0
|
||||
varargout{1} = geometry_wrapper(56, varargin{:});
|
||||
varargout{1} = geometry_wrapper(70, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function aGlobalFunction');
|
||||
end
|
||||
|
|
|
|||
|
|
@ -588,7 +588,83 @@ void MyTemplatePoint2_deconstructor_46(int nargout, mxArray *out[], int nargin,
|
|||
}
|
||||
}
|
||||
|
||||
void MyTemplatePoint2_templatedMethod_47(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void MyTemplatePoint2_accept_T_47(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<MyTemplatePoint2> Shared;
|
||||
checkArguments("accept_T",nargout,nargin-1,1);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint2>(in[0], "ptr_MyTemplatePoint2");
|
||||
Point2& value = *unwrap_shared_ptr< Point2 >(in[1], "ptr_Point2");
|
||||
obj->accept_T(value);
|
||||
}
|
||||
|
||||
void MyTemplatePoint2_accept_Tptr_48(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<MyTemplatePoint2> Shared;
|
||||
checkArguments("accept_Tptr",nargout,nargin-1,1);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint2>(in[0], "ptr_MyTemplatePoint2");
|
||||
boost::shared_ptr<Point2> value = unwrap_shared_ptr< Point2 >(in[1], "ptr_Point2");
|
||||
obj->accept_Tptr(value);
|
||||
}
|
||||
|
||||
void MyTemplatePoint2_create_MixedPtrs_49(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<Point2> SharedPoint2;
|
||||
typedef boost::shared_ptr<Point2> SharedPoint2;
|
||||
typedef boost::shared_ptr<MyTemplatePoint2> Shared;
|
||||
checkArguments("create_MixedPtrs",nargout,nargin-1,0);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint2>(in[0], "ptr_MyTemplatePoint2");
|
||||
pair< Point2, SharedPoint2 > pairResult = obj->create_MixedPtrs();
|
||||
out[0] = wrap_shared_ptr(SharedPoint2(new Point2(pairResult.first)),"Point2", false);
|
||||
out[1] = wrap_shared_ptr(pairResult.second,"Point2", false);
|
||||
}
|
||||
|
||||
void MyTemplatePoint2_create_ptrs_50(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<Point2> SharedPoint2;
|
||||
typedef boost::shared_ptr<Point2> SharedPoint2;
|
||||
typedef boost::shared_ptr<MyTemplatePoint2> Shared;
|
||||
checkArguments("create_ptrs",nargout,nargin-1,0);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint2>(in[0], "ptr_MyTemplatePoint2");
|
||||
pair< SharedPoint2, SharedPoint2 > pairResult = obj->create_ptrs();
|
||||
out[0] = wrap_shared_ptr(pairResult.first,"Point2", false);
|
||||
out[1] = wrap_shared_ptr(pairResult.second,"Point2", false);
|
||||
}
|
||||
|
||||
void MyTemplatePoint2_return_T_51(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<Point2> SharedPoint2;
|
||||
typedef boost::shared_ptr<MyTemplatePoint2> Shared;
|
||||
checkArguments("return_T",nargout,nargin-1,1);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint2>(in[0], "ptr_MyTemplatePoint2");
|
||||
boost::shared_ptr<Point2> value = unwrap_shared_ptr< Point2 >(in[1], "ptr_Point2");
|
||||
out[0] = wrap_shared_ptr(SharedPoint2(new Point2(obj->return_T(value))),"Point2", false);
|
||||
}
|
||||
|
||||
void MyTemplatePoint2_return_Tptr_52(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<Point2> SharedPoint2;
|
||||
typedef boost::shared_ptr<MyTemplatePoint2> Shared;
|
||||
checkArguments("return_Tptr",nargout,nargin-1,1);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint2>(in[0], "ptr_MyTemplatePoint2");
|
||||
boost::shared_ptr<Point2> value = unwrap_shared_ptr< Point2 >(in[1], "ptr_Point2");
|
||||
out[0] = wrap_shared_ptr(obj->return_Tptr(value),"Point2", false);
|
||||
}
|
||||
|
||||
void MyTemplatePoint2_return_ptrs_53(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<Point2> SharedPoint2;
|
||||
typedef boost::shared_ptr<Point2> SharedPoint2;
|
||||
typedef boost::shared_ptr<MyTemplatePoint2> Shared;
|
||||
checkArguments("return_ptrs",nargout,nargin-1,2);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint2>(in[0], "ptr_MyTemplatePoint2");
|
||||
boost::shared_ptr<Point2> p1 = unwrap_shared_ptr< Point2 >(in[1], "ptr_Point2");
|
||||
boost::shared_ptr<Point2> p2 = unwrap_shared_ptr< Point2 >(in[2], "ptr_Point2");
|
||||
pair< SharedPoint2, SharedPoint2 > pairResult = obj->return_ptrs(p1,p2);
|
||||
out[0] = wrap_shared_ptr(pairResult.first,"Point2", false);
|
||||
out[1] = wrap_shared_ptr(pairResult.second,"Point2", false);
|
||||
}
|
||||
|
||||
void MyTemplatePoint2_templatedMethod_54(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<MyTemplatePoint2> Shared;
|
||||
checkArguments("templatedMethod",nargout,nargin-1,1);
|
||||
|
|
@ -597,7 +673,7 @@ void MyTemplatePoint2_templatedMethod_47(int nargout, mxArray *out[], int nargin
|
|||
obj->templatedMethod(t);
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_collectorInsertAndMakeBase_48(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void MyTemplatePoint3_collectorInsertAndMakeBase_55(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
mexAtExit(&_deleteAllObjects);
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
|
|
@ -610,7 +686,7 @@ void MyTemplatePoint3_collectorInsertAndMakeBase_48(int nargout, mxArray *out[],
|
|||
*reinterpret_cast<SharedBase**>(mxGetData(out[0])) = new SharedBase(*self);
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_upcastFromVoid_49(int nargout, mxArray *out[], int nargin, const mxArray *in[]) {
|
||||
void MyTemplatePoint3_upcastFromVoid_56(int nargout, mxArray *out[], int nargin, const mxArray *in[]) {
|
||||
mexAtExit(&_deleteAllObjects);
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
boost::shared_ptr<void> *asVoid = *reinterpret_cast<boost::shared_ptr<void>**> (mxGetData(in[0]));
|
||||
|
|
@ -619,7 +695,7 @@ void MyTemplatePoint3_upcastFromVoid_49(int nargout, mxArray *out[], int nargin,
|
|||
*reinterpret_cast<Shared**>(mxGetData(out[0])) = self;
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_constructor_50(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void MyTemplatePoint3_constructor_57(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
mexAtExit(&_deleteAllObjects);
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
|
|
@ -634,7 +710,7 @@ void MyTemplatePoint3_constructor_50(int nargout, mxArray *out[], int nargin, co
|
|||
*reinterpret_cast<SharedBase**>(mxGetData(out[1])) = new SharedBase(*self);
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_deconstructor_51(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void MyTemplatePoint3_deconstructor_58(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
checkArguments("delete_MyTemplatePoint3",nargout,nargin,1);
|
||||
|
|
@ -647,7 +723,83 @@ void MyTemplatePoint3_deconstructor_51(int nargout, mxArray *out[], int nargin,
|
|||
}
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_templatedMethod_52(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void MyTemplatePoint3_accept_T_59(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
checkArguments("accept_T",nargout,nargin-1,1);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint3>(in[0], "ptr_MyTemplatePoint3");
|
||||
Point3& value = *unwrap_shared_ptr< Point3 >(in[1], "ptr_Point3");
|
||||
obj->accept_T(value);
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_accept_Tptr_60(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
checkArguments("accept_Tptr",nargout,nargin-1,1);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint3>(in[0], "ptr_MyTemplatePoint3");
|
||||
boost::shared_ptr<Point3> value = unwrap_shared_ptr< Point3 >(in[1], "ptr_Point3");
|
||||
obj->accept_Tptr(value);
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_create_MixedPtrs_61(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<Point3> SharedPoint3;
|
||||
typedef boost::shared_ptr<Point3> SharedPoint3;
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
checkArguments("create_MixedPtrs",nargout,nargin-1,0);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint3>(in[0], "ptr_MyTemplatePoint3");
|
||||
pair< Point3, SharedPoint3 > pairResult = obj->create_MixedPtrs();
|
||||
out[0] = wrap_shared_ptr(SharedPoint3(new Point3(pairResult.first)),"Point3", false);
|
||||
out[1] = wrap_shared_ptr(pairResult.second,"Point3", false);
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_create_ptrs_62(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<Point3> SharedPoint3;
|
||||
typedef boost::shared_ptr<Point3> SharedPoint3;
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
checkArguments("create_ptrs",nargout,nargin-1,0);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint3>(in[0], "ptr_MyTemplatePoint3");
|
||||
pair< SharedPoint3, SharedPoint3 > pairResult = obj->create_ptrs();
|
||||
out[0] = wrap_shared_ptr(pairResult.first,"Point3", false);
|
||||
out[1] = wrap_shared_ptr(pairResult.second,"Point3", false);
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_return_T_63(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<Point3> SharedPoint3;
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
checkArguments("return_T",nargout,nargin-1,1);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint3>(in[0], "ptr_MyTemplatePoint3");
|
||||
boost::shared_ptr<Point3> value = unwrap_shared_ptr< Point3 >(in[1], "ptr_Point3");
|
||||
out[0] = wrap_shared_ptr(SharedPoint3(new Point3(obj->return_T(value))),"Point3", false);
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_return_Tptr_64(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<Point3> SharedPoint3;
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
checkArguments("return_Tptr",nargout,nargin-1,1);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint3>(in[0], "ptr_MyTemplatePoint3");
|
||||
boost::shared_ptr<Point3> value = unwrap_shared_ptr< Point3 >(in[1], "ptr_Point3");
|
||||
out[0] = wrap_shared_ptr(obj->return_Tptr(value),"Point3", false);
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_return_ptrs_65(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<Point3> SharedPoint3;
|
||||
typedef boost::shared_ptr<Point3> SharedPoint3;
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
checkArguments("return_ptrs",nargout,nargin-1,2);
|
||||
Shared obj = unwrap_shared_ptr<MyTemplatePoint3>(in[0], "ptr_MyTemplatePoint3");
|
||||
boost::shared_ptr<Point3> p1 = unwrap_shared_ptr< Point3 >(in[1], "ptr_Point3");
|
||||
boost::shared_ptr<Point3> p2 = unwrap_shared_ptr< Point3 >(in[2], "ptr_Point3");
|
||||
pair< SharedPoint3, SharedPoint3 > pairResult = obj->return_ptrs(p1,p2);
|
||||
out[0] = wrap_shared_ptr(pairResult.first,"Point3", false);
|
||||
out[1] = wrap_shared_ptr(pairResult.second,"Point3", false);
|
||||
}
|
||||
|
||||
void MyTemplatePoint3_templatedMethod_66(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<MyTemplatePoint3> Shared;
|
||||
checkArguments("templatedMethod",nargout,nargin-1,1);
|
||||
|
|
@ -656,7 +808,7 @@ void MyTemplatePoint3_templatedMethod_52(int nargout, mxArray *out[], int nargin
|
|||
obj->templatedMethod(t);
|
||||
}
|
||||
|
||||
void MyFactorPosePoint2_collectorInsertAndMakeBase_53(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void MyFactorPosePoint2_collectorInsertAndMakeBase_67(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
mexAtExit(&_deleteAllObjects);
|
||||
typedef boost::shared_ptr<MyFactorPosePoint2> Shared;
|
||||
|
|
@ -665,7 +817,7 @@ void MyFactorPosePoint2_collectorInsertAndMakeBase_53(int nargout, mxArray *out[
|
|||
collector_MyFactorPosePoint2.insert(self);
|
||||
}
|
||||
|
||||
void MyFactorPosePoint2_constructor_54(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void MyFactorPosePoint2_constructor_68(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
mexAtExit(&_deleteAllObjects);
|
||||
typedef boost::shared_ptr<MyFactorPosePoint2> Shared;
|
||||
|
|
@ -680,7 +832,7 @@ void MyFactorPosePoint2_constructor_54(int nargout, mxArray *out[], int nargin,
|
|||
*reinterpret_cast<Shared**> (mxGetData(out[0])) = self;
|
||||
}
|
||||
|
||||
void MyFactorPosePoint2_deconstructor_55(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void MyFactorPosePoint2_deconstructor_69(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
typedef boost::shared_ptr<MyFactorPosePoint2> Shared;
|
||||
checkArguments("delete_MyFactorPosePoint2",nargout,nargin,1);
|
||||
|
|
@ -693,18 +845,18 @@ void MyFactorPosePoint2_deconstructor_55(int nargout, mxArray *out[], int nargin
|
|||
}
|
||||
}
|
||||
|
||||
void aGlobalFunction_56(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void aGlobalFunction_70(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
checkArguments("aGlobalFunction",nargout,nargin,0);
|
||||
out[0] = wrap< Vector >(aGlobalFunction());
|
||||
}
|
||||
void overloadedGlobalFunction_57(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void overloadedGlobalFunction_71(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
checkArguments("overloadedGlobalFunction",nargout,nargin,1);
|
||||
int a = unwrap< int >(in[0]);
|
||||
out[0] = wrap< Vector >(overloadedGlobalFunction(a));
|
||||
}
|
||||
void overloadedGlobalFunction_58(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
void overloadedGlobalFunction_72(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||
{
|
||||
checkArguments("overloadedGlobalFunction",nargout,nargin,2);
|
||||
int a = unwrap< int >(in[0]);
|
||||
|
|
@ -865,40 +1017,82 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
|||
MyTemplatePoint2_deconstructor_46(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 47:
|
||||
MyTemplatePoint2_templatedMethod_47(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint2_accept_T_47(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 48:
|
||||
MyTemplatePoint3_collectorInsertAndMakeBase_48(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint2_accept_Tptr_48(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 49:
|
||||
MyTemplatePoint3_upcastFromVoid_49(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint2_create_MixedPtrs_49(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 50:
|
||||
MyTemplatePoint3_constructor_50(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint2_create_ptrs_50(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 51:
|
||||
MyTemplatePoint3_deconstructor_51(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint2_return_T_51(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 52:
|
||||
MyTemplatePoint3_templatedMethod_52(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint2_return_Tptr_52(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 53:
|
||||
MyFactorPosePoint2_collectorInsertAndMakeBase_53(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint2_return_ptrs_53(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 54:
|
||||
MyFactorPosePoint2_constructor_54(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint2_templatedMethod_54(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 55:
|
||||
MyFactorPosePoint2_deconstructor_55(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint3_collectorInsertAndMakeBase_55(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 56:
|
||||
aGlobalFunction_56(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint3_upcastFromVoid_56(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 57:
|
||||
overloadedGlobalFunction_57(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint3_constructor_57(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 58:
|
||||
overloadedGlobalFunction_58(nargout, out, nargin-1, in+1);
|
||||
MyTemplatePoint3_deconstructor_58(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 59:
|
||||
MyTemplatePoint3_accept_T_59(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 60:
|
||||
MyTemplatePoint3_accept_Tptr_60(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 61:
|
||||
MyTemplatePoint3_create_MixedPtrs_61(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 62:
|
||||
MyTemplatePoint3_create_ptrs_62(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 63:
|
||||
MyTemplatePoint3_return_T_63(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 64:
|
||||
MyTemplatePoint3_return_Tptr_64(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 65:
|
||||
MyTemplatePoint3_return_ptrs_65(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 66:
|
||||
MyTemplatePoint3_templatedMethod_66(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 67:
|
||||
MyFactorPosePoint2_collectorInsertAndMakeBase_67(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 68:
|
||||
MyFactorPosePoint2_constructor_68(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 69:
|
||||
MyFactorPosePoint2_deconstructor_69(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 70:
|
||||
aGlobalFunction_70(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 71:
|
||||
overloadedGlobalFunction_71(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
case 72:
|
||||
overloadedGlobalFunction_72(nargout, out, nargin-1, in+1);
|
||||
break;
|
||||
}
|
||||
} catch(const std::exception& e) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
function varargout = overloadedGlobalFunction(varargin)
|
||||
if length(varargin) == 1 && isa(varargin{1},'numeric')
|
||||
varargout{1} = geometry_wrapper(57, varargin{:});
|
||||
varargout{1} = geometry_wrapper(71, varargin{:});
|
||||
elseif length(varargin) == 2 && isa(varargin{1},'numeric') && isa(varargin{2},'double')
|
||||
varargout{1} = geometry_wrapper(58, varargin{:});
|
||||
varargout{1} = geometry_wrapper(72, varargin{:});
|
||||
else
|
||||
error('Arguments do not match any overload of function overloadedGlobalFunction');
|
||||
end
|
||||
|
|
|
|||
|
|
@ -103,6 +103,15 @@ virtual class MyTemplate : MyBase {
|
|||
|
||||
template<ARG = {Point2, Point3}>
|
||||
void templatedMethod(const Test& t);
|
||||
|
||||
// Stress test templates and pointer combinations
|
||||
void accept_T(const T& value) const;
|
||||
void accept_Tptr(T* value) const;
|
||||
T* return_Tptr(T* value) const;
|
||||
T return_T(T* value) const;
|
||||
pair<T*,T*> create_ptrs () const;
|
||||
pair<T ,T*> create_MixedPtrs () const;
|
||||
pair<T*,T*> return_ptrs (T* p1, T* p2) const;
|
||||
};
|
||||
|
||||
// A doubly templated class
|
||||
|
|
|
|||
Loading…
Reference in New Issue