Finish fasterWrap: really a lot of code cleanup (yes, you!) and one change that eliminates argument and overload checking for non-overloaded methods with zero or all scalar arguments
commit
d8235d0c2a
422
.cproject
422
.cproject
|
@ -1,17 +1,19 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
<?fileVersion 4.0.0?>
|
||||||
|
|
||||||
|
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544">
|
<cconfiguration id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544">
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544" moduleId="org.eclipse.cdt.core.settings" name="MacOSX GCC">
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544" moduleId="org.eclipse.cdt.core.settings" name="MacOSX GCC">
|
||||||
<externalSettings/>
|
<externalSettings/>
|
||||||
<extensions>
|
<extensions>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
</extensions>
|
</extensions>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
@ -60,13 +62,13 @@
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544.1441575890" moduleId="org.eclipse.cdt.core.settings" name="Timing">
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544.1441575890" moduleId="org.eclipse.cdt.core.settings" name="Timing">
|
||||||
<externalSettings/>
|
<externalSettings/>
|
||||||
<extensions>
|
<extensions>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
</extensions>
|
</extensions>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
@ -116,13 +118,13 @@
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544.127261216" moduleId="org.eclipse.cdt.core.settings" name="fast">
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544.127261216" moduleId="org.eclipse.cdt.core.settings" name="fast">
|
||||||
<externalSettings/>
|
<externalSettings/>
|
||||||
<extensions>
|
<extensions>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
</extensions>
|
</extensions>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
@ -540,14 +542,6 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="testGaussianFactor.run" path="linear/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testGaussianFactor.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="all" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="all" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j2</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
|
@ -574,6 +568,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="tests/testBayesTree.run" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="tests/testBayesTree.run" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>tests/testBayesTree.run</buildTarget>
|
<buildTarget>tests/testBayesTree.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -581,6 +576,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="testBinaryBayesNet.run" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testBinaryBayesNet.run" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>testBinaryBayesNet.run</buildTarget>
|
<buildTarget>testBinaryBayesNet.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -628,6 +624,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="testSymbolicBayesNet.run" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testSymbolicBayesNet.run" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>testSymbolicBayesNet.run</buildTarget>
|
<buildTarget>testSymbolicBayesNet.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -635,6 +632,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="tests/testSymbolicFactor.run" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="tests/testSymbolicFactor.run" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>tests/testSymbolicFactor.run</buildTarget>
|
<buildTarget>tests/testSymbolicFactor.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -642,6 +640,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="testSymbolicFactorGraph.run" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testSymbolicFactorGraph.run" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>testSymbolicFactorGraph.run</buildTarget>
|
<buildTarget>testSymbolicFactorGraph.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -657,11 +656,20 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="tests/testBayesTree" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="tests/testBayesTree" path="inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>tests/testBayesTree</buildTarget>
|
<buildTarget>tests/testBayesTree</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
|
<target name="testGaussianFactor.run" path="linear/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>testGaussianFactor.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
<target name="testPoseRTV.run" path="build/gtsam_unstable/dynamics" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testPoseRTV.run" path="build/gtsam_unstable/dynamics" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j5</buildArguments>
|
||||||
|
@ -886,22 +894,6 @@
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="all" path="CppUnitLite" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>all</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="clean" path="CppUnitLite" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>clean</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="tests/testPose2.run" path="build_retract/gtsam/geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="tests/testPose2.run" path="build_retract/gtsam/geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j2</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
|
@ -918,6 +910,22 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
|
<target name="all" path="CppUnitLite" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>all</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="clean" path="CppUnitLite" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>clean</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
<target name="all" path="spqr_mini" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="all" path="spqr_mini" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j2</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
|
@ -942,6 +950,30 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
|
<target name="all" path="build_wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>all</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="check" path="build_wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>check</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="clean" path="build_wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>clean</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
<target name="testGeneralSFMFactor.run" path="build/gtsam/slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testGeneralSFMFactor.run" path="build/gtsam/slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j5</buildArguments>
|
||||||
|
@ -1006,30 +1038,6 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="all" path="build_wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>all</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="check" path="build_wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>check</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="clean" path="build_wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>clean</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testValues.run" path="build/gtsam/nonlinear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testValues.run" path="build/gtsam/nonlinear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j5</buildArguments>
|
||||||
|
@ -1118,10 +1126,10 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="testSmartProjectionPoseFactor.run" path="build/gtsam_unstable/slam/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testWrap.run" path="build/wrap/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j5</buildArguments>
|
||||||
<buildTarget>testSmartProjectionPoseFactor.run</buildTarget>
|
<buildTarget>testWrap.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
@ -1254,14 +1262,6 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="testAttitudeFactor.run" path="build/gtsam/navigation/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j5</buildArguments>
|
|
||||||
<buildTarget>testAttitudeFactor.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testInvDepthFactor3.run" path="build/gtsam_unstable/slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testInvDepthFactor3.run" path="build/gtsam_unstable/slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j5</buildArguments>
|
||||||
|
@ -1318,6 +1318,14 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
|
<target name="testSmartProjectionFactor.run" path="build/gtsam_unstable/slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j5</buildArguments>
|
||||||
|
<buildTarget>testSmartProjectionFactor.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
<target name="testTSAMFactors.run" path="build/gtsam_unstable/slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testTSAMFactors.run" path="build/gtsam_unstable/slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j5</buildArguments>
|
||||||
|
@ -1536,6 +1544,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="testGraph.run" path="build/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testGraph.run" path="build/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>testGraph.run</buildTarget>
|
<buildTarget>testGraph.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -1543,6 +1552,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="testJunctionTree.run" path="build/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testJunctionTree.run" path="build/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>testJunctionTree.run</buildTarget>
|
<buildTarget>testJunctionTree.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -1550,6 +1560,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="testSymbolicBayesNetB.run" path="build/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testSymbolicBayesNetB.run" path="build/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>testSymbolicBayesNetB.run</buildTarget>
|
<buildTarget>testSymbolicBayesNetB.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -1717,6 +1728,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="testErrors.run" path="linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testErrors.run" path="linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>testErrors.run</buildTarget>
|
<buildTarget>testErrors.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -1762,22 +1774,6 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="testGaussianFactor.run" path="build/linear/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testGaussianFactor.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testParticleFactor.run" path="build/gtsam_unstable/nonlinear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j5</buildArguments>
|
|
||||||
<buildTarget>testParticleFactor.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="check" path="base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="check" path="base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j2</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
|
@ -1858,6 +1854,22 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
|
<target name="testParticleFactor.run" path="build/gtsam_unstable/nonlinear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j5</buildArguments>
|
||||||
|
<buildTarget>testParticleFactor.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="testGaussianFactor.run" path="build/linear/tests" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>testGaussianFactor.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
<target name="check" path="build/inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="check" path="build/inference" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j2</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
|
@ -2010,22 +2022,6 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="testImuFactor.run" path="build/gtsam/navigation" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j5</buildArguments>
|
|
||||||
<buildTarget>testImuFactor.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testCombinedImuFactor.run" path="build/gtsam/navigation" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j5</buildArguments>
|
|
||||||
<buildTarget>testCombinedImuFactor.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="all" path="slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="all" path="slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j2</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
|
@ -2108,7 +2104,6 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="testSimulated2DOriented.run" path="slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testSimulated2DOriented.run" path="slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments/>
|
|
||||||
<buildTarget>testSimulated2DOriented.run</buildTarget>
|
<buildTarget>testSimulated2DOriented.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -2148,7 +2143,6 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="testSimulated2D.run" path="slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testSimulated2D.run" path="slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments/>
|
|
||||||
<buildTarget>testSimulated2D.run</buildTarget>
|
<buildTarget>testSimulated2D.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -2156,7 +2150,6 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="testSimulated3D.run" path="slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testSimulated3D.run" path="slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments/>
|
|
||||||
<buildTarget>testSimulated3D.run</buildTarget>
|
<buildTarget>testSimulated3D.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -2170,6 +2163,22 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
|
<target name="testImuFactor.run" path="build/gtsam/navigation" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j5</buildArguments>
|
||||||
|
<buildTarget>testImuFactor.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="testCombinedImuFactor.run" path="build/gtsam/navigation" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j5</buildArguments>
|
||||||
|
<buildTarget>testCombinedImuFactor.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
<target name="testVector.run" path="build/gtsam/base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testVector.run" path="build/gtsam/base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j5</buildArguments>
|
||||||
|
@ -2396,7 +2405,6 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="tests/testGaussianISAM2" path="build/slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="tests/testGaussianISAM2" path="build/slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments/>
|
|
||||||
<buildTarget>tests/testGaussianISAM2</buildTarget>
|
<buildTarget>tests/testGaussianISAM2</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -2418,102 +2426,6 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="testRot3.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testRot3.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testRot2.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testRot2.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testPose3.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testPose3.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="timeRot3.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>timeRot3.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testPose2.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testPose2.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testCal3_S2.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testCal3_S2.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testSimpleCamera.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testSimpleCamera.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testHomography2.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testHomography2.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testCalibratedCamera.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testCalibratedCamera.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="check" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>check</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="clean" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>clean</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="testPoint2.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments>-j2</buildArguments>
|
|
||||||
<buildTarget>testPoint2.run</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="install" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="install" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j3</buildArguments>
|
<buildArguments>-j3</buildArguments>
|
||||||
|
@ -2715,6 +2627,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="Generate DEB Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="Generate DEB Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>cpack</buildCommand>
|
<buildCommand>cpack</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>-G DEB</buildTarget>
|
<buildTarget>-G DEB</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -2722,6 +2635,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="Generate RPM Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="Generate RPM Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>cpack</buildCommand>
|
<buildCommand>cpack</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>-G RPM</buildTarget>
|
<buildTarget>-G RPM</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -2729,6 +2643,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="Generate TGZ Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="Generate TGZ Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>cpack</buildCommand>
|
<buildCommand>cpack</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>-G TGZ</buildTarget>
|
<buildTarget>-G TGZ</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -2736,6 +2651,7 @@
|
||||||
</target>
|
</target>
|
||||||
<target name="Generate TGZ Source Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="Generate TGZ Source Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>cpack</buildCommand>
|
<buildCommand>cpack</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>--config CPackSourceConfig.cmake</buildTarget>
|
<buildTarget>--config CPackSourceConfig.cmake</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
|
@ -2909,34 +2825,98 @@
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="testSpirit.run" path="build/wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testRot3.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
<buildTarget>testSpirit.run</buildTarget>
|
<buildTarget>testRot3.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="testWrap.run" path="build/wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testRot2.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
<buildTarget>testWrap.run</buildTarget>
|
<buildTarget>testRot2.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="check.wrap" path="build/wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="testPose3.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
<buildTarget>check.wrap</buildTarget>
|
<buildTarget>testPose3.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
<target name="wrap" path="build/wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="timeRot3.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j5</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
<buildTarget>wrap</buildTarget>
|
<buildTarget>timeRot3.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="testPose2.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>testPose2.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="testCal3_S2.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>testCal3_S2.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="testSimpleCamera.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>testSimpleCamera.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="testHomography2.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>testHomography2.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="testCalibratedCamera.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>testCalibratedCamera.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="check" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>check</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="clean" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>clean</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="testPoint2.run" path="geometry" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>testPoint2.run</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
@ -2980,6 +2960,30 @@
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
|
<target name="testSpirit.run" path="build/wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j5</buildArguments>
|
||||||
|
<buildTarget>testSpirit.run</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="check.wrap" path="build/wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j5</buildArguments>
|
||||||
|
<buildTarget>check.wrap</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="wrap" path="build/wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j5</buildArguments>
|
||||||
|
<buildTarget>wrap</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
</buildTargets>
|
</buildTargets>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
</cproject>
|
</cproject>
|
||||||
|
|
|
@ -16,13 +16,14 @@
|
||||||
* @author Richard Roberts
|
* @author Richard Roberts
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <iostream>
|
#include "Argument.h"
|
||||||
#include <fstream>
|
|
||||||
#include <sstream>
|
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/regex.hpp>
|
#include <boost/regex.hpp>
|
||||||
|
|
||||||
#include "Argument.h"
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace wrap;
|
using namespace wrap;
|
||||||
|
@ -32,17 +33,23 @@ string Argument::matlabClass(const string& delim) const {
|
||||||
string result;
|
string result;
|
||||||
BOOST_FOREACH(const string& ns, namespaces)
|
BOOST_FOREACH(const string& ns, namespaces)
|
||||||
result += ns + delim;
|
result += ns + delim;
|
||||||
if (type=="string" || type=="unsigned char" || type=="char")
|
if (type == "string" || type == "unsigned char" || type == "char")
|
||||||
return result + "char";
|
return result + "char";
|
||||||
if (type=="Vector" || type=="Matrix")
|
if (type == "Vector" || type == "Matrix")
|
||||||
return result + "double";
|
return result + "double";
|
||||||
if (type=="int" || type=="size_t")
|
if (type == "int" || type == "size_t")
|
||||||
return result + "numeric";
|
return result + "numeric";
|
||||||
if (type=="bool")
|
if (type == "bool")
|
||||||
return result + "logical";
|
return result + "logical";
|
||||||
return result + type;
|
return result + type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
bool Argument::isScalar() const {
|
||||||
|
return (type == "bool" || type == "char" || type == "unsigned char"
|
||||||
|
|| type == "int" || type == "size_t" || type == "double");
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Argument::matlab_unwrap(FileWriter& file, const string& matlabName) const {
|
void Argument::matlab_unwrap(FileWriter& file, const string& matlabName) const {
|
||||||
file.oss << " ";
|
file.oss << " ";
|
||||||
|
@ -52,7 +59,8 @@ void Argument::matlab_unwrap(FileWriter& file, const string& matlabName) const {
|
||||||
|
|
||||||
if (is_ptr)
|
if (is_ptr)
|
||||||
// A pointer: emit an "unwrap_shared_ptr" call which returns a pointer
|
// A pointer: emit an "unwrap_shared_ptr" call which returns a pointer
|
||||||
file.oss << "boost::shared_ptr<" << cppType << "> " << name << " = unwrap_shared_ptr< ";
|
file.oss << "boost::shared_ptr<" << cppType << "> " << name
|
||||||
|
<< " = unwrap_shared_ptr< ";
|
||||||
else if (is_ref)
|
else if (is_ref)
|
||||||
// A reference: emit an "unwrap_shared_ptr" call and de-reference the pointer
|
// A reference: emit an "unwrap_shared_ptr" call and de-reference the pointer
|
||||||
file.oss << cppType << "& " << name << " = *unwrap_shared_ptr< ";
|
file.oss << cppType << "& " << name << " = *unwrap_shared_ptr< ";
|
||||||
|
@ -65,23 +73,28 @@ void Argument::matlab_unwrap(FileWriter& file, const string& matlabName) const {
|
||||||
file.oss << cppType << " " << name << " = unwrap< ";
|
file.oss << cppType << " " << name << " = unwrap< ";
|
||||||
|
|
||||||
file.oss << cppType << " >(" << matlabName;
|
file.oss << cppType << " >(" << matlabName;
|
||||||
if (is_ptr || is_ref) file.oss << ", \"ptr_" << matlabUniqueType << "\"";
|
if (is_ptr || is_ref)
|
||||||
|
file.oss << ", \"ptr_" << matlabUniqueType << "\"";
|
||||||
file.oss << ");" << endl;
|
file.oss << ");" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
string Argument::qualifiedType(const string& delim) const {
|
string Argument::qualifiedType(const string& delim) const {
|
||||||
string result;
|
string result;
|
||||||
BOOST_FOREACH(const string& ns, namespaces) result += ns + delim;
|
BOOST_FOREACH(const string& ns, namespaces)
|
||||||
|
result += ns + delim;
|
||||||
return result + type;
|
return result + type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
string ArgumentList::types() const {
|
string ArgumentList::types() const {
|
||||||
string str;
|
string str;
|
||||||
bool first=true;
|
bool first = true;
|
||||||
BOOST_FOREACH(Argument arg, *this) {
|
BOOST_FOREACH(Argument arg, *this) {
|
||||||
if (!first) str += ","; str += arg.type; first=false;
|
if (!first)
|
||||||
|
str += ",";
|
||||||
|
str += arg.type;
|
||||||
|
first = false;
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
@ -89,16 +102,17 @@ string ArgumentList::types() const {
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
string ArgumentList::signature() const {
|
string ArgumentList::signature() const {
|
||||||
string sig;
|
string sig;
|
||||||
bool cap=false;
|
bool cap = false;
|
||||||
|
|
||||||
BOOST_FOREACH(Argument arg, *this) {
|
BOOST_FOREACH(Argument arg, *this) {
|
||||||
BOOST_FOREACH(char ch, arg.type)
|
BOOST_FOREACH(char ch, arg.type)
|
||||||
if(isupper(ch)) {
|
if (isupper(ch)) {
|
||||||
sig += ch;
|
sig += ch;
|
||||||
//If there is a capital letter, we don't want to read it below
|
//If there is a capital letter, we don't want to read it below
|
||||||
cap=true;
|
cap = true;
|
||||||
}
|
}
|
||||||
if(!cap) sig += arg.type[0];
|
if (!cap)
|
||||||
|
sig += arg.type[0];
|
||||||
//Reset to default
|
//Reset to default
|
||||||
cap = false;
|
cap = false;
|
||||||
}
|
}
|
||||||
|
@ -109,23 +123,77 @@ string ArgumentList::signature() const {
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
string ArgumentList::names() const {
|
string ArgumentList::names() const {
|
||||||
string str;
|
string str;
|
||||||
bool first=true;
|
bool first = true;
|
||||||
BOOST_FOREACH(Argument arg, *this) {
|
BOOST_FOREACH(Argument arg, *this) {
|
||||||
if (!first) str += ","; str += arg.name; first=false;
|
if (!first)
|
||||||
|
str += ",";
|
||||||
|
str += arg.name;
|
||||||
|
first = false;
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
bool ArgumentList::allScalar() const {
|
||||||
|
BOOST_FOREACH(Argument arg, *this)
|
||||||
|
if (!arg.isScalar()) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void ArgumentList::matlab_unwrap(FileWriter& file, int start) const {
|
void ArgumentList::matlab_unwrap(FileWriter& file, int start) const {
|
||||||
int index = start;
|
int index = start;
|
||||||
BOOST_FOREACH(Argument arg, *this) {
|
BOOST_FOREACH(Argument arg, *this) {
|
||||||
stringstream buf;
|
stringstream buf;
|
||||||
buf << "in[" << index << "]";
|
buf << "in[" << index << "]";
|
||||||
arg.matlab_unwrap(file,buf.str());
|
arg.matlab_unwrap(file, buf.str());
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
void ArgumentList::emit_prototype(FileWriter& file, const string& name) const {
|
||||||
|
file.oss << name << "(";
|
||||||
|
bool first = true;
|
||||||
|
BOOST_FOREACH(Argument arg, *this) {
|
||||||
|
if (!first)
|
||||||
|
file.oss << ", ";
|
||||||
|
file.oss << arg.type << " " << arg.name;
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
if (!staticMethod)
|
||||||
|
file.oss << ", this";
|
||||||
|
file.oss << ", varargin{:});\n";
|
||||||
|
}
|
||||||
|
/* ************************************************************************* */
|
||||||
|
void ArgumentList::emit_conditional_call(FileWriter& file,
|
||||||
|
const ReturnValue& returnVal, const string& wrapperName, int id,
|
||||||
|
bool staticMethod) const {
|
||||||
|
// Check nr of arguments
|
||||||
|
file.oss << "if length(varargin) == " << size();
|
||||||
|
if (size() > 0)
|
||||||
|
file.oss << " && ";
|
||||||
|
// ...and their types
|
||||||
|
bool first = true;
|
||||||
|
for (size_t i = 0; i < size(); i++) {
|
||||||
|
if (!first)
|
||||||
|
file.oss << " && ";
|
||||||
|
file.oss << "isa(varargin{" << i + 1 << "},'" << (*this)[i].matlabClass(".")
|
||||||
|
<< "')";
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
file.oss << "\n";
|
||||||
|
|
||||||
|
// output call to C++ wrapper
|
||||||
|
file.oss << " ";
|
||||||
|
emit_call(file, returnVal, wrapperName, id, staticMethod);
|
||||||
|
}
|
||||||
|
/* ************************************************************************* */
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,12 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "FileWriter.h"
|
||||||
|
#include "ReturnValue.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "FileWriter.h"
|
|
||||||
|
|
||||||
namespace wrap {
|
namespace wrap {
|
||||||
|
|
||||||
/// Argument class
|
/// Argument class
|
||||||
|
@ -40,6 +41,9 @@ struct Argument {
|
||||||
/// return MATLAB class for use in isa(x,class)
|
/// return MATLAB class for use in isa(x,class)
|
||||||
std::string matlabClass(const std::string& delim = "") const;
|
std::string matlabClass(const std::string& delim = "") const;
|
||||||
|
|
||||||
|
/// Check if will be unwrapped using scalar login in wrap/matlab.h
|
||||||
|
bool isScalar() const;
|
||||||
|
|
||||||
/// adds namespaces to type
|
/// adds namespaces to type
|
||||||
std::string qualifiedType(const std::string& delim = "") const;
|
std::string qualifiedType(const std::string& delim = "") const;
|
||||||
|
|
||||||
|
@ -59,6 +63,9 @@ struct ArgumentList: public std::vector<Argument> {
|
||||||
/// create a comma-separated string listing all argument names, used in m-files
|
/// create a comma-separated string listing all argument names, used in m-files
|
||||||
std::string names() const;
|
std::string names() const;
|
||||||
|
|
||||||
|
/// Check if all arguments scalar
|
||||||
|
bool allScalar() const;
|
||||||
|
|
||||||
// MATLAB code generation:
|
// MATLAB code generation:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,6 +75,32 @@ struct ArgumentList: public std::vector<Argument> {
|
||||||
*/
|
*/
|
||||||
void matlab_unwrap(FileWriter& file, int start = 0) const; // MATLAB to C++
|
void matlab_unwrap(FileWriter& file, int start = 0) const; // MATLAB to C++
|
||||||
|
|
||||||
|
/**
|
||||||
|
* emit MATLAB prototype
|
||||||
|
* @param file output stream
|
||||||
|
* @param name of method or function
|
||||||
|
*/
|
||||||
|
void emit_prototype(FileWriter& file, const std::string& name) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* emit emit MATLAB call to wrapper
|
||||||
|
* @param file 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,
|
||||||
|
const std::string& wrapperName, int id, bool staticMethod = false) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* emit conditional MATLAB call to wrapper (checking arguments first)
|
||||||
|
* @param file 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,
|
||||||
|
const std::string& wrapperName, int id, bool staticMethod = false) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // \namespace wrap
|
} // \namespace wrap
|
||||||
|
|
354
wrap/Class.cpp
354
wrap/Class.cpp
|
@ -16,40 +16,40 @@
|
||||||
* @author Richard Roberts
|
* @author Richard Roberts
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
#include "Class.h"
|
||||||
|
#include "utilities.h"
|
||||||
|
#include "Argument.h"
|
||||||
|
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
//#include <cstdint> // on Linux GCC: fails with error regarding needing C++0x std flags
|
//#include <cstdint> // on Linux GCC: fails with error regarding needing C++0x std flags
|
||||||
//#include <cinttypes> // same failure as above
|
//#include <cinttypes> // same failure as above
|
||||||
#include <stdint.h> // works on Linux GCC
|
#include <stdint.h> // works on Linux GCC
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <boost/lexical_cast.hpp>
|
|
||||||
|
|
||||||
#include "Class.h"
|
|
||||||
#include "utilities.h"
|
|
||||||
#include "Argument.h"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace wrap;
|
using namespace wrap;
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Class::matlab_proxy(const string& toolboxPath, const string& wrapperName,
|
void Class::matlab_proxy(const string& toolboxPath, const string& wrapperName,
|
||||||
const TypeAttributesTable& typeAttributes,
|
const TypeAttributesTable& typeAttributes, FileWriter& wrapperFile,
|
||||||
FileWriter& wrapperFile, vector<string>& functionNames) const {
|
vector<string>& functionNames) const {
|
||||||
|
|
||||||
// Create namespace folders
|
// Create namespace folders
|
||||||
createNamespaceStructure(namespaces, toolboxPath);
|
createNamespaceStructure(namespaces, toolboxPath);
|
||||||
|
|
||||||
// open destination classFile
|
// open destination classFile
|
||||||
string classFile = toolboxPath;
|
string classFile = toolboxPath;
|
||||||
if(!namespaces.empty())
|
if (!namespaces.empty())
|
||||||
classFile += "/+" + wrap::qualifiedName("/+", namespaces);
|
classFile += "/+" + wrap::qualifiedName("/+", namespaces);
|
||||||
classFile += "/" + name + ".m";
|
classFile += "/" + name + ".m";
|
||||||
FileWriter proxyFile(classFile, verbose_, "%");
|
FileWriter proxyFile(classFile, verbose_, "%");
|
||||||
|
|
||||||
// get the name of actual matlab object
|
// get the name of actual matlab object
|
||||||
const string matlabQualName = qualifiedName("."), matlabUniqueName = qualifiedName(), cppName = qualifiedName("::");
|
const string matlabQualName = qualifiedName("."), matlabUniqueName =
|
||||||
|
qualifiedName(), cppName = qualifiedName("::");
|
||||||
const string matlabBaseName = wrap::qualifiedName(".", qualifiedParent);
|
const string matlabBaseName = wrap::qualifiedName(".", qualifiedParent);
|
||||||
const string cppBaseName = wrap::qualifiedName("::", qualifiedParent);
|
const string cppBaseName = wrap::qualifiedName("::", qualifiedParent);
|
||||||
|
|
||||||
|
@ -72,42 +72,49 @@ void Class::matlab_proxy(const string& toolboxPath, const string& wrapperName,
|
||||||
// other wrap modules - to add these to their collectors the pointer is
|
// other wrap modules - to add these to their collectors the pointer is
|
||||||
// passed from one C++ module into matlab then back into the other C++
|
// passed from one C++ module into matlab then back into the other C++
|
||||||
// module.
|
// module.
|
||||||
pointer_constructor_fragments(proxyFile, wrapperFile, wrapperName, functionNames);
|
pointer_constructor_fragments(proxyFile, wrapperFile, wrapperName,
|
||||||
|
functionNames);
|
||||||
wrapperFile.oss << "\n";
|
wrapperFile.oss << "\n";
|
||||||
// Regular constructors
|
// Regular constructors
|
||||||
BOOST_FOREACH(ArgumentList a, constructor.args_list)
|
BOOST_FOREACH(ArgumentList a, constructor.args_list) {
|
||||||
{
|
const int id = (int) functionNames.size();
|
||||||
const int id = (int)functionNames.size();
|
constructor.proxy_fragment(proxyFile, wrapperName, !qualifiedParent.empty(),
|
||||||
constructor.proxy_fragment(proxyFile, wrapperName, !qualifiedParent.empty(), id, a);
|
id, a);
|
||||||
const string wrapFunctionName = constructor.wrapper_fragment(wrapperFile,
|
const string wrapFunctionName = constructor.wrapper_fragment(wrapperFile,
|
||||||
cppName, matlabUniqueName, cppBaseName, id, a);
|
cppName, matlabUniqueName, cppBaseName, id, a);
|
||||||
wrapperFile.oss << "\n";
|
wrapperFile.oss << "\n";
|
||||||
functionNames.push_back(wrapFunctionName);
|
functionNames.push_back(wrapFunctionName);
|
||||||
}
|
}
|
||||||
proxyFile.oss << " else\n";
|
proxyFile.oss << " else\n";
|
||||||
proxyFile.oss << " error('Arguments do not match any overload of " << matlabQualName << " constructor');\n";
|
proxyFile.oss << " error('Arguments do not match any overload of "
|
||||||
|
<< matlabQualName << " constructor');\n";
|
||||||
proxyFile.oss << " end\n";
|
proxyFile.oss << " end\n";
|
||||||
if(!qualifiedParent.empty())
|
if (!qualifiedParent.empty())
|
||||||
proxyFile.oss << " obj = obj@" << matlabBaseName << "(uint64(" << ptr_constructor_key << "), base_ptr);\n";
|
proxyFile.oss << " obj = obj@" << matlabBaseName << "(uint64("
|
||||||
|
<< ptr_constructor_key << "), base_ptr);\n";
|
||||||
proxyFile.oss << " obj.ptr_" << matlabUniqueName << " = my_ptr;\n";
|
proxyFile.oss << " obj.ptr_" << matlabUniqueName << " = my_ptr;\n";
|
||||||
proxyFile.oss << " end\n\n";
|
proxyFile.oss << " end\n\n";
|
||||||
|
|
||||||
// Deconstructor
|
// Deconstructor
|
||||||
{
|
{
|
||||||
const int id = (int)functionNames.size();
|
const int id = (int) functionNames.size();
|
||||||
deconstructor.proxy_fragment(proxyFile, wrapperName, matlabUniqueName, id);
|
deconstructor.proxy_fragment(proxyFile, wrapperName, matlabUniqueName, id);
|
||||||
proxyFile.oss << "\n";
|
proxyFile.oss << "\n";
|
||||||
const string functionName = deconstructor.wrapper_fragment(wrapperFile, cppName, matlabUniqueName, id);
|
const string functionName = deconstructor.wrapper_fragment(wrapperFile,
|
||||||
|
cppName, matlabUniqueName, id);
|
||||||
wrapperFile.oss << "\n";
|
wrapperFile.oss << "\n";
|
||||||
functionNames.push_back(functionName);
|
functionNames.push_back(functionName);
|
||||||
}
|
}
|
||||||
proxyFile.oss << " function display(obj), obj.print(''); end\n %DISPLAY Calls print on the object\n";
|
proxyFile.oss
|
||||||
proxyFile.oss << " function disp(obj), obj.display; end\n %DISP Calls print on the object\n";
|
<< " 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
|
// Methods
|
||||||
BOOST_FOREACH(const Methods::value_type& name_m, methods) {
|
BOOST_FOREACH(const Methods::value_type& name_m, methods) {
|
||||||
const Method& m = name_m.second;
|
const Method& m = name_m.second;
|
||||||
m.proxy_wrapper_fragments(proxyFile, wrapperFile, cppName, matlabQualName, matlabUniqueName, wrapperName, typeAttributes, functionNames);
|
m.proxy_wrapper_fragments(proxyFile, wrapperFile, cppName, matlabQualName,
|
||||||
|
matlabUniqueName, wrapperName, typeAttributes, functionNames);
|
||||||
proxyFile.oss << "\n";
|
proxyFile.oss << "\n";
|
||||||
wrapperFile.oss << "\n";
|
wrapperFile.oss << "\n";
|
||||||
}
|
}
|
||||||
|
@ -121,12 +128,14 @@ void Class::matlab_proxy(const string& toolboxPath, const string& wrapperName,
|
||||||
// Static methods
|
// Static methods
|
||||||
BOOST_FOREACH(const StaticMethods::value_type& name_m, static_methods) {
|
BOOST_FOREACH(const StaticMethods::value_type& name_m, static_methods) {
|
||||||
const StaticMethod& m = name_m.second;
|
const StaticMethod& m = name_m.second;
|
||||||
m.proxy_wrapper_fragments(proxyFile, wrapperFile, cppName, matlabQualName, matlabUniqueName, wrapperName, typeAttributes, functionNames);
|
m.proxy_wrapper_fragments(proxyFile, wrapperFile, cppName, matlabQualName,
|
||||||
|
matlabUniqueName, wrapperName, typeAttributes, functionNames);
|
||||||
proxyFile.oss << "\n";
|
proxyFile.oss << "\n";
|
||||||
wrapperFile.oss << "\n";
|
wrapperFile.oss << "\n";
|
||||||
}
|
}
|
||||||
if (hasSerialization)
|
if (hasSerialization)
|
||||||
deserialization_fragments(proxyFile, wrapperFile, wrapperName, functionNames);
|
deserialization_fragments(proxyFile, wrapperFile, wrapperName,
|
||||||
|
functionNames);
|
||||||
|
|
||||||
proxyFile.oss << " end\n";
|
proxyFile.oss << " end\n";
|
||||||
proxyFile.oss << "end\n";
|
proxyFile.oss << "end\n";
|
||||||
|
@ -141,41 +150,50 @@ string Class::qualifiedName(const string& delim) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Class::pointer_constructor_fragments(FileWriter& proxyFile, FileWriter& wrapperFile, const string& wrapperName, vector<string>& functionNames) const {
|
void Class::pointer_constructor_fragments(FileWriter& proxyFile,
|
||||||
|
FileWriter& wrapperFile, const string& wrapperName,
|
||||||
|
vector<string>& functionNames) const {
|
||||||
|
|
||||||
const string matlabUniqueName = qualifiedName(), cppName = qualifiedName("::");
|
const string matlabUniqueName = qualifiedName(), cppName = qualifiedName(
|
||||||
|
"::");
|
||||||
const string baseCppName = wrap::qualifiedName("::", qualifiedParent);
|
const string baseCppName = wrap::qualifiedName("::", qualifiedParent);
|
||||||
|
|
||||||
const int collectorInsertId = (int)functionNames.size();
|
const int collectorInsertId = (int) functionNames.size();
|
||||||
const string collectorInsertFunctionName = matlabUniqueName + "_collectorInsertAndMakeBase_" + boost::lexical_cast<string>(collectorInsertId);
|
const string collectorInsertFunctionName = matlabUniqueName
|
||||||
|
+ "_collectorInsertAndMakeBase_"
|
||||||
|
+ boost::lexical_cast<string>(collectorInsertId);
|
||||||
functionNames.push_back(collectorInsertFunctionName);
|
functionNames.push_back(collectorInsertFunctionName);
|
||||||
|
|
||||||
int upcastFromVoidId;
|
int upcastFromVoidId;
|
||||||
string upcastFromVoidFunctionName;
|
string upcastFromVoidFunctionName;
|
||||||
if(isVirtual) {
|
if (isVirtual) {
|
||||||
upcastFromVoidId = (int)functionNames.size();
|
upcastFromVoidId = (int) functionNames.size();
|
||||||
upcastFromVoidFunctionName = matlabUniqueName + "_upcastFromVoid_" + boost::lexical_cast<string>(upcastFromVoidId);
|
upcastFromVoidFunctionName = matlabUniqueName + "_upcastFromVoid_"
|
||||||
|
+ boost::lexical_cast<string>(upcastFromVoidId);
|
||||||
functionNames.push_back(upcastFromVoidFunctionName);
|
functionNames.push_back(upcastFromVoidFunctionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MATLAB constructor that assigns pointer to matlab object then calls c++
|
// MATLAB constructor that assigns pointer to matlab object then calls c++
|
||||||
// function to add the object to the collector.
|
// function to add the object to the collector.
|
||||||
if(isVirtual) {
|
if (isVirtual) {
|
||||||
proxyFile.oss << " if (nargin == 2 || (nargin == 3 && strcmp(varargin{3}, 'void')))";
|
proxyFile.oss
|
||||||
|
<< " if (nargin == 2 || (nargin == 3 && strcmp(varargin{3}, 'void')))";
|
||||||
} else {
|
} else {
|
||||||
proxyFile.oss << " if nargin == 2";
|
proxyFile.oss << " if nargin == 2";
|
||||||
}
|
}
|
||||||
proxyFile.oss << " && isa(varargin{1}, 'uint64') && varargin{1} == uint64(" << ptr_constructor_key << ")\n";
|
proxyFile.oss << " && isa(varargin{1}, 'uint64') && varargin{1} == uint64("
|
||||||
if(isVirtual) {
|
<< ptr_constructor_key << ")\n";
|
||||||
|
if (isVirtual) {
|
||||||
proxyFile.oss << " if nargin == 2\n";
|
proxyFile.oss << " if nargin == 2\n";
|
||||||
proxyFile.oss << " my_ptr = varargin{2};\n";
|
proxyFile.oss << " my_ptr = varargin{2};\n";
|
||||||
proxyFile.oss << " else\n";
|
proxyFile.oss << " else\n";
|
||||||
proxyFile.oss << " my_ptr = " << wrapperName << "(" << upcastFromVoidId << ", varargin{2});\n";
|
proxyFile.oss << " my_ptr = " << wrapperName << "("
|
||||||
|
<< upcastFromVoidId << ", varargin{2});\n";
|
||||||
proxyFile.oss << " end\n";
|
proxyFile.oss << " end\n";
|
||||||
} else {
|
} else {
|
||||||
proxyFile.oss << " my_ptr = varargin{2};\n";
|
proxyFile.oss << " my_ptr = varargin{2};\n";
|
||||||
}
|
}
|
||||||
if(qualifiedParent.empty()) // If this class has a base class, we'll get a base class pointer back
|
if (qualifiedParent.empty()) // If this class has a base class, we'll get a base class pointer back
|
||||||
proxyFile.oss << " ";
|
proxyFile.oss << " ";
|
||||||
else
|
else
|
||||||
proxyFile.oss << " base_ptr = ";
|
proxyFile.oss << " base_ptr = ";
|
||||||
|
@ -185,22 +203,27 @@ void Class::pointer_constructor_fragments(FileWriter& proxyFile, FileWriter& wra
|
||||||
// comes from a C++ return value; this mechanism allows the object to be added
|
// comes from a C++ return value; this mechanism allows the object to be added
|
||||||
// to a collector in a different wrap module. If this class has a base class,
|
// to a collector in a different wrap module. If this class has a base class,
|
||||||
// a new pointer to the base class is allocated and returned.
|
// a new pointer to the base class is allocated and returned.
|
||||||
wrapperFile.oss << "void " << collectorInsertFunctionName << "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
wrapperFile.oss << "void " << collectorInsertFunctionName
|
||||||
|
<< "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
||||||
wrapperFile.oss << "{\n";
|
wrapperFile.oss << "{\n";
|
||||||
wrapperFile.oss << " mexAtExit(&_deleteAllObjects);\n";
|
wrapperFile.oss << " mexAtExit(&_deleteAllObjects);\n";
|
||||||
// Typedef boost::shared_ptr
|
// Typedef boost::shared_ptr
|
||||||
wrapperFile.oss << " typedef boost::shared_ptr<" << cppName << "> Shared;\n";
|
wrapperFile.oss << " typedef boost::shared_ptr<" << cppName << "> Shared;\n";
|
||||||
wrapperFile.oss << "\n";
|
wrapperFile.oss << "\n";
|
||||||
// Get self pointer passed in
|
// Get self pointer passed in
|
||||||
wrapperFile.oss << " Shared *self = *reinterpret_cast<Shared**> (mxGetData(in[0]));\n";
|
wrapperFile.oss
|
||||||
|
<< " Shared *self = *reinterpret_cast<Shared**> (mxGetData(in[0]));\n";
|
||||||
// Add to collector
|
// Add to collector
|
||||||
wrapperFile.oss << " collector_" << matlabUniqueName << ".insert(self);\n";
|
wrapperFile.oss << " collector_" << matlabUniqueName << ".insert(self);\n";
|
||||||
// If we have a base class, return the base class pointer (MATLAB will call the base class collectorInsertAndMakeBase to add this to the collector and recurse the heirarchy)
|
// If we have a base class, return the base class pointer (MATLAB will call the base class collectorInsertAndMakeBase to add this to the collector and recurse the heirarchy)
|
||||||
if(!qualifiedParent.empty()) {
|
if (!qualifiedParent.empty()) {
|
||||||
wrapperFile.oss << "\n";
|
wrapperFile.oss << "\n";
|
||||||
wrapperFile.oss << " typedef boost::shared_ptr<" << baseCppName << "> SharedBase;\n";
|
wrapperFile.oss << " typedef boost::shared_ptr<" << baseCppName
|
||||||
wrapperFile.oss << " out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);\n";
|
<< "> SharedBase;\n";
|
||||||
wrapperFile.oss << " *reinterpret_cast<SharedBase**>(mxGetData(out[0])) = new SharedBase(*self);\n";
|
wrapperFile.oss
|
||||||
|
<< " out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);\n";
|
||||||
|
wrapperFile.oss
|
||||||
|
<< " *reinterpret_cast<SharedBase**>(mxGetData(out[0])) = new SharedBase(*self);\n";
|
||||||
}
|
}
|
||||||
wrapperFile.oss << "}\n";
|
wrapperFile.oss << "}\n";
|
||||||
|
|
||||||
|
@ -208,31 +231,38 @@ void Class::pointer_constructor_fragments(FileWriter& proxyFile, FileWriter& wra
|
||||||
// shared_ptr<void>. This mechanism allows automatic dynamic creation of the
|
// shared_ptr<void>. This mechanism allows automatic dynamic creation of the
|
||||||
// real underlying derived-most class when a C++ method returns a virtual
|
// real underlying derived-most class when a C++ method returns a virtual
|
||||||
// base class.
|
// base class.
|
||||||
if(isVirtual)
|
if (isVirtual)
|
||||||
wrapperFile.oss <<
|
wrapperFile.oss << "\n"
|
||||||
"\n"
|
"void " << upcastFromVoidFunctionName
|
||||||
"void " << upcastFromVoidFunctionName << "(int nargout, mxArray *out[], int nargin, const mxArray *in[]) {\n"
|
<< "(int nargout, mxArray *out[], int nargin, const mxArray *in[]) {\n"
|
||||||
" mexAtExit(&_deleteAllObjects);\n"
|
" mexAtExit(&_deleteAllObjects);\n"
|
||||||
" typedef boost::shared_ptr<" << cppName << "> Shared;\n"
|
" typedef boost::shared_ptr<" << cppName
|
||||||
|
<< "> Shared;\n"
|
||||||
" boost::shared_ptr<void> *asVoid = *reinterpret_cast<boost::shared_ptr<void>**> (mxGetData(in[0]));\n"
|
" boost::shared_ptr<void> *asVoid = *reinterpret_cast<boost::shared_ptr<void>**> (mxGetData(in[0]));\n"
|
||||||
" out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);\n"
|
" out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);\n"
|
||||||
" Shared *self = new Shared(boost::static_pointer_cast<" << cppName << ">(*asVoid));\n"
|
" Shared *self = new Shared(boost::static_pointer_cast<" << cppName
|
||||||
|
<< ">(*asVoid));\n"
|
||||||
" *reinterpret_cast<Shared**>(mxGetData(out[0])) = self;\n"
|
" *reinterpret_cast<Shared**>(mxGetData(out[0])) = self;\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
vector<ArgumentList> expandArgumentListsTemplate(const vector<ArgumentList>& argLists, const string& templateArg, const vector<string>& instName, const std::vector<string>& expandedClassNamespace, const string& expandedClassName) {
|
vector<ArgumentList> expandArgumentListsTemplate(
|
||||||
|
const vector<ArgumentList>& argLists, const string& templateArg,
|
||||||
|
const vector<string>& instName,
|
||||||
|
const std::vector<string>& expandedClassNamespace,
|
||||||
|
const string& expandedClassName) {
|
||||||
vector<ArgumentList> result;
|
vector<ArgumentList> result;
|
||||||
BOOST_FOREACH(const ArgumentList& argList, argLists) {
|
BOOST_FOREACH(const ArgumentList& argList, argLists) {
|
||||||
ArgumentList instArgList;
|
ArgumentList instArgList;
|
||||||
BOOST_FOREACH(const Argument& arg, argList) {
|
BOOST_FOREACH(const Argument& arg, argList) {
|
||||||
Argument instArg = arg;
|
Argument instArg = arg;
|
||||||
if(arg.type == templateArg) {
|
if (arg.type == templateArg) {
|
||||||
instArg.namespaces.assign(instName.begin(), instName.end()-1);
|
instArg.namespaces.assign(instName.begin(), instName.end() - 1);
|
||||||
instArg.type = instName.back();
|
instArg.type = instName.back();
|
||||||
} else if(arg.type == "This") {
|
} else if (arg.type == "This") {
|
||||||
instArg.namespaces.assign(expandedClassNamespace.begin(), expandedClassNamespace.end());
|
instArg.namespaces.assign(expandedClassNamespace.begin(),
|
||||||
|
expandedClassNamespace.end());
|
||||||
instArg.type = expandedClassName;
|
instArg.type = expandedClassName;
|
||||||
}
|
}
|
||||||
instArgList.push_back(instArg);
|
instArgList.push_back(instArg);
|
||||||
|
@ -244,28 +274,34 @@ vector<ArgumentList> expandArgumentListsTemplate(const vector<ArgumentList>& arg
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
template<class METHOD>
|
template<class METHOD>
|
||||||
map<string, METHOD> expandMethodTemplate(const map<string, METHOD>& methods, const string& templateArg, const vector<string>& instName, const std::vector<string>& expandedClassNamespace, const string& expandedClassName) {
|
map<string, METHOD> expandMethodTemplate(const map<string, METHOD>& methods,
|
||||||
|
const string& templateArg, const vector<string>& instName,
|
||||||
|
const std::vector<string>& expandedClassNamespace,
|
||||||
|
const string& expandedClassName) {
|
||||||
map<string, METHOD> result;
|
map<string, METHOD> result;
|
||||||
typedef pair<const string, METHOD> Name_Method;
|
typedef pair<const string, METHOD> Name_Method;
|
||||||
BOOST_FOREACH(const Name_Method& name_method, methods) {
|
BOOST_FOREACH(const Name_Method& name_method, methods) {
|
||||||
const METHOD& method = name_method.second;
|
const METHOD& method = name_method.second;
|
||||||
METHOD instMethod = method;
|
METHOD instMethod = method;
|
||||||
instMethod.argLists = expandArgumentListsTemplate(method.argLists, templateArg, instName, expandedClassNamespace, expandedClassName);
|
instMethod.argLists = expandArgumentListsTemplate(method.argLists,
|
||||||
|
templateArg, instName, expandedClassNamespace, expandedClassName);
|
||||||
instMethod.returnVals.clear();
|
instMethod.returnVals.clear();
|
||||||
BOOST_FOREACH(const ReturnValue& retVal, method.returnVals) {
|
BOOST_FOREACH(const ReturnValue& retVal, method.returnVals) {
|
||||||
ReturnValue instRetVal = retVal;
|
ReturnValue instRetVal = retVal;
|
||||||
if(retVal.type1 == templateArg) {
|
if (retVal.type1 == templateArg) {
|
||||||
instRetVal.namespaces1.assign(instName.begin(), instName.end()-1);
|
instRetVal.namespaces1.assign(instName.begin(), instName.end() - 1);
|
||||||
instRetVal.type1 = instName.back();
|
instRetVal.type1 = instName.back();
|
||||||
} else if(retVal.type1 == "This") {
|
} else if (retVal.type1 == "This") {
|
||||||
instRetVal.namespaces1.assign(expandedClassNamespace.begin(), expandedClassNamespace.end());
|
instRetVal.namespaces1.assign(expandedClassNamespace.begin(),
|
||||||
|
expandedClassNamespace.end());
|
||||||
instRetVal.type1 = expandedClassName;
|
instRetVal.type1 = expandedClassName;
|
||||||
}
|
}
|
||||||
if(retVal.type2 == templateArg) {
|
if (retVal.type2 == templateArg) {
|
||||||
instRetVal.namespaces2.assign(instName.begin(), instName.end()-1);
|
instRetVal.namespaces2.assign(instName.begin(), instName.end() - 1);
|
||||||
instRetVal.type2 = instName.back();
|
instRetVal.type2 = instName.back();
|
||||||
} else if(retVal.type1 == "This") {
|
} else if (retVal.type1 == "This") {
|
||||||
instRetVal.namespaces2.assign(expandedClassNamespace.begin(), expandedClassNamespace.end());
|
instRetVal.namespaces2.assign(expandedClassNamespace.begin(),
|
||||||
|
expandedClassNamespace.end());
|
||||||
instRetVal.type2 = expandedClassName;
|
instRetVal.type2 = expandedClassName;
|
||||||
}
|
}
|
||||||
instMethod.returnVals.push_back(instRetVal);
|
instMethod.returnVals.push_back(instRetVal);
|
||||||
|
@ -276,7 +312,10 @@ map<string, METHOD> expandMethodTemplate(const map<string, METHOD>& methods, con
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
Class expandClassTemplate(const Class& cls, const string& templateArg, const vector<string>& instName, const std::vector<string>& expandedClassNamespace, const string& expandedClassName) {
|
Class expandClassTemplate(const Class& cls, const string& templateArg,
|
||||||
|
const vector<string>& instName,
|
||||||
|
const std::vector<string>& expandedClassNamespace,
|
||||||
|
const string& expandedClassName) {
|
||||||
Class inst;
|
Class inst;
|
||||||
inst.name = cls.name;
|
inst.name = cls.name;
|
||||||
inst.templateArgs = cls.templateArgs;
|
inst.templateArgs = cls.templateArgs;
|
||||||
|
@ -284,11 +323,15 @@ Class expandClassTemplate(const Class& cls, const string& templateArg, const vec
|
||||||
inst.isVirtual = cls.isVirtual;
|
inst.isVirtual = cls.isVirtual;
|
||||||
inst.isSerializable = cls.isSerializable;
|
inst.isSerializable = cls.isSerializable;
|
||||||
inst.qualifiedParent = cls.qualifiedParent;
|
inst.qualifiedParent = cls.qualifiedParent;
|
||||||
inst.methods = expandMethodTemplate(cls.methods, templateArg, instName, expandedClassNamespace, expandedClassName);
|
inst.methods = expandMethodTemplate(cls.methods, templateArg, instName,
|
||||||
inst.static_methods = expandMethodTemplate(cls.static_methods, templateArg, instName, expandedClassNamespace, expandedClassName);
|
expandedClassNamespace, expandedClassName);
|
||||||
|
inst.static_methods = expandMethodTemplate(cls.static_methods, templateArg,
|
||||||
|
instName, expandedClassNamespace, expandedClassName);
|
||||||
inst.namespaces = cls.namespaces;
|
inst.namespaces = cls.namespaces;
|
||||||
inst.constructor = cls.constructor;
|
inst.constructor = cls.constructor;
|
||||||
inst.constructor.args_list = expandArgumentListsTemplate(cls.constructor.args_list, templateArg, instName, expandedClassNamespace, expandedClassName);
|
inst.constructor.args_list = expandArgumentListsTemplate(
|
||||||
|
cls.constructor.args_list, templateArg, instName, expandedClassNamespace,
|
||||||
|
expandedClassName);
|
||||||
inst.constructor.name = inst.name;
|
inst.constructor.name = inst.name;
|
||||||
inst.deconstructor = cls.deconstructor;
|
inst.deconstructor = cls.deconstructor;
|
||||||
inst.deconstructor.name = inst.name;
|
inst.deconstructor.name = inst.name;
|
||||||
|
@ -297,22 +340,29 @@ Class expandClassTemplate(const Class& cls, const string& templateArg, const vec
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
vector<Class> Class::expandTemplate(const string& templateArg, const vector<vector<string> >& instantiations) const {
|
vector<Class> Class::expandTemplate(const string& templateArg,
|
||||||
|
const vector<vector<string> >& instantiations) const {
|
||||||
vector<Class> result;
|
vector<Class> result;
|
||||||
BOOST_FOREACH(const vector<string>& instName, instantiations) {
|
BOOST_FOREACH(const vector<string>& instName, instantiations) {
|
||||||
const string expandedName = name + instName.back();
|
const string expandedName = name + instName.back();
|
||||||
Class inst = expandClassTemplate(*this, templateArg, instName, this->namespaces, expandedName);
|
Class inst = expandClassTemplate(*this, templateArg, instName,
|
||||||
|
this->namespaces, expandedName);
|
||||||
inst.name = expandedName;
|
inst.name = expandedName;
|
||||||
inst.templateArgs.clear();
|
inst.templateArgs.clear();
|
||||||
inst.typedefName = qualifiedName("::") + "<" + wrap::qualifiedName("::", instName) + ">";
|
inst.typedefName = qualifiedName("::") + "<"
|
||||||
|
+ wrap::qualifiedName("::", instName) + ">";
|
||||||
result.push_back(inst);
|
result.push_back(inst);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
Class Class::expandTemplate(const string& templateArg, const vector<string>& instantiation, const std::vector<string>& expandedClassNamespace, const string& expandedClassName) const {
|
Class Class::expandTemplate(const string& templateArg,
|
||||||
return expandClassTemplate(*this, templateArg, instantiation, expandedClassNamespace, expandedClassName);
|
const vector<string>& instantiation,
|
||||||
|
const std::vector<string>& expandedClassNamespace,
|
||||||
|
const string& expandedClassName) const {
|
||||||
|
return expandClassTemplate(*this, templateArg, instantiation,
|
||||||
|
expandedClassNamespace, expandedClassName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
@ -322,7 +372,7 @@ std::string Class::getTypedef() const {
|
||||||
result += ("namespace " + namesp + " { ");
|
result += ("namespace " + namesp + " { ");
|
||||||
}
|
}
|
||||||
result += ("typedef " + typedefName + " " + name + ";");
|
result += ("typedef " + typedefName + " " + name + ";");
|
||||||
for (size_t i = 0; i<namespaces.size(); ++i) {
|
for (size_t i = 0; i < namespaces.size(); ++i) {
|
||||||
result += " }";
|
result += " }";
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -331,25 +381,16 @@ std::string Class::getTypedef() const {
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
||||||
void Class::comment_fragment(FileWriter& proxyFile) const {
|
void Class::comment_fragment(FileWriter& proxyFile) const {
|
||||||
proxyFile.oss << "%class " << name
|
proxyFile.oss << "%class " << name << ", see Doxygen page for details\n";
|
||||||
<< ", see Doxygen page for details\n";
|
|
||||||
proxyFile.oss
|
proxyFile.oss
|
||||||
<< "%at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html\n";
|
<< "%at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html\n";
|
||||||
|
|
||||||
if (!constructor.args_list.empty())
|
if (!constructor.args_list.empty())
|
||||||
proxyFile.oss << "%\n%-------Constructors-------\n";
|
proxyFile.oss << "%\n%-------Constructors-------\n";
|
||||||
BOOST_FOREACH(ArgumentList argList, constructor.args_list) {
|
BOOST_FOREACH(ArgumentList argList, constructor.args_list) {
|
||||||
string up_name = boost::to_upper_copy(name);
|
proxyFile.oss << "%";
|
||||||
proxyFile.oss << "%" << name << "(";
|
argList.emit_prototype(proxyFile, name);
|
||||||
unsigned int i = 0;
|
proxyFile.oss << "\n";
|
||||||
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 << ")\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!methods.empty())
|
if (!methods.empty())
|
||||||
|
@ -357,17 +398,9 @@ void Class::comment_fragment(FileWriter& proxyFile) const {
|
||||||
BOOST_FOREACH(const Methods::value_type& name_m, methods) {
|
BOOST_FOREACH(const Methods::value_type& name_m, methods) {
|
||||||
const Method& m = name_m.second;
|
const Method& m = name_m.second;
|
||||||
BOOST_FOREACH(ArgumentList argList, m.argLists) {
|
BOOST_FOREACH(ArgumentList argList, m.argLists) {
|
||||||
string up_name = boost::to_upper_copy(m.name);
|
proxyFile.oss << "%";
|
||||||
proxyFile.oss << "%" << m.name << "(";
|
argList.emit_prototype(proxyFile, m.name);
|
||||||
unsigned int i = 0;
|
proxyFile.oss << " : returns "
|
||||||
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 << ") : returns "
|
|
||||||
<< m.returnVals[0].return_type(false, m.returnVals[0].pair) << endl;
|
<< m.returnVals[0].return_type(false, m.returnVals[0].pair) << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -377,18 +410,9 @@ void Class::comment_fragment(FileWriter& proxyFile) const {
|
||||||
BOOST_FOREACH(const StaticMethods::value_type& name_m, static_methods) {
|
BOOST_FOREACH(const StaticMethods::value_type& name_m, static_methods) {
|
||||||
const StaticMethod& m = name_m.second;
|
const StaticMethod& m = name_m.second;
|
||||||
BOOST_FOREACH(ArgumentList argList, m.argLists) {
|
BOOST_FOREACH(ArgumentList argList, m.argLists) {
|
||||||
string up_name = boost::to_upper_copy(m.name);
|
proxyFile.oss << "%";
|
||||||
proxyFile.oss << "%" << m.name << "(";
|
argList.emit_prototype(proxyFile, m.name);
|
||||||
unsigned int i = 0;
|
proxyFile.oss << " : returns "
|
||||||
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 << ") : returns "
|
|
||||||
<< m.returnVals[0].return_type(false, m.returnVals[0].pair) << endl;
|
<< m.returnVals[0].return_type(false, m.returnVals[0].pair) << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -396,15 +420,17 @@ void Class::comment_fragment(FileWriter& proxyFile) const {
|
||||||
if (hasSerialization) {
|
if (hasSerialization) {
|
||||||
proxyFile.oss << "%\n%-------Serialization Interface-------\n";
|
proxyFile.oss << "%\n%-------Serialization Interface-------\n";
|
||||||
proxyFile.oss << "%string_serialize() : returns string\n";
|
proxyFile.oss << "%string_serialize() : returns string\n";
|
||||||
proxyFile.oss << "%string_deserialize(string serialized) : returns " << this->name << "\n";
|
proxyFile.oss << "%string_deserialize(string serialized) : returns "
|
||||||
|
<< this->name << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyFile.oss << "%\n";
|
proxyFile.oss << "%\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Class::serialization_fragments(FileWriter& proxyFile, FileWriter& wrapperFile,
|
void Class::serialization_fragments(FileWriter& proxyFile,
|
||||||
const std::string& wrapperName, std::vector<std::string>& functionNames) const {
|
FileWriter& wrapperFile, const std::string& wrapperName,
|
||||||
|
std::vector<std::string>& functionNames) const {
|
||||||
|
|
||||||
//void Point3_string_serialize_17(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
//void Point3_string_serialize_17(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
//{
|
//{
|
||||||
|
@ -418,30 +444,34 @@ void Class::serialization_fragments(FileWriter& proxyFile, FileWriter& wrapperFi
|
||||||
//}
|
//}
|
||||||
|
|
||||||
int serialize_id = functionNames.size();
|
int serialize_id = functionNames.size();
|
||||||
const string
|
const string matlabQualName = qualifiedName("."), matlabUniqueName =
|
||||||
matlabQualName = qualifiedName("."),
|
qualifiedName(), cppClassName = qualifiedName("::");
|
||||||
matlabUniqueName = qualifiedName(),
|
const string wrapFunctionNameSerialize = matlabUniqueName
|
||||||
cppClassName = qualifiedName("::");
|
+ "_string_serialize_" + boost::lexical_cast<string>(serialize_id);
|
||||||
const string wrapFunctionNameSerialize = matlabUniqueName + "_string_serialize_" + boost::lexical_cast<string>(serialize_id);
|
|
||||||
functionNames.push_back(wrapFunctionNameSerialize);
|
functionNames.push_back(wrapFunctionNameSerialize);
|
||||||
|
|
||||||
// call
|
// call
|
||||||
//void Point3_string_serialize_17(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
//void Point3_string_serialize_17(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
wrapperFile.oss << "void " << wrapFunctionNameSerialize << "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
wrapperFile.oss << "void " << wrapFunctionNameSerialize
|
||||||
|
<< "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
||||||
wrapperFile.oss << "{\n";
|
wrapperFile.oss << "{\n";
|
||||||
wrapperFile.oss << " typedef boost::shared_ptr<" << cppClassName << "> Shared;" << endl;
|
wrapperFile.oss << " typedef boost::shared_ptr<" << cppClassName
|
||||||
|
<< "> Shared;" << endl;
|
||||||
|
|
||||||
// check arguments - for serialize, no arguments
|
// check arguments - for serialize, no arguments
|
||||||
// example: checkArguments("string_serialize",nargout,nargin-1,0);
|
// example: checkArguments("string_serialize",nargout,nargin-1,0);
|
||||||
wrapperFile.oss << " checkArguments(\"string_serialize\",nargout,nargin-1,0);\n";
|
wrapperFile.oss
|
||||||
|
<< " checkArguments(\"string_serialize\",nargout,nargin-1,0);\n";
|
||||||
|
|
||||||
// get class pointer
|
// get class pointer
|
||||||
// example: Shared obj = unwrap_shared_ptr<Point3>(in[0], "ptr_Point3");
|
// example: Shared obj = unwrap_shared_ptr<Point3>(in[0], "ptr_Point3");
|
||||||
wrapperFile.oss << " Shared obj = unwrap_shared_ptr<" << cppClassName << ">(in[0], \"ptr_" << matlabUniqueName << "\");" << endl;
|
wrapperFile.oss << " Shared obj = unwrap_shared_ptr<" << cppClassName
|
||||||
|
<< ">(in[0], \"ptr_" << matlabUniqueName << "\");" << endl;
|
||||||
|
|
||||||
// Serialization boilerplate
|
// Serialization boilerplate
|
||||||
wrapperFile.oss << " std::ostringstream out_archive_stream;\n";
|
wrapperFile.oss << " std::ostringstream out_archive_stream;\n";
|
||||||
wrapperFile.oss << " boost::archive::text_oarchive out_archive(out_archive_stream);\n";
|
wrapperFile.oss
|
||||||
|
<< " boost::archive::text_oarchive out_archive(out_archive_stream);\n";
|
||||||
wrapperFile.oss << " out_archive << *obj;\n";
|
wrapperFile.oss << " out_archive << *obj;\n";
|
||||||
wrapperFile.oss << " out[0] = wrap< string >(out_archive_stream.str());\n";
|
wrapperFile.oss << " out[0] = wrap< string >(out_archive_stream.str());\n";
|
||||||
|
|
||||||
|
@ -459,13 +489,19 @@ void Class::serialization_fragments(FileWriter& proxyFile, FileWriter& wrapperFi
|
||||||
// end
|
// end
|
||||||
// end
|
// end
|
||||||
|
|
||||||
proxyFile.oss << " function varargout = string_serialize(this, varargin)\n";
|
proxyFile.oss
|
||||||
proxyFile.oss << " % STRING_SERIALIZE usage: string_serialize() : returns string\n";
|
<< " function varargout = string_serialize(this, varargin)\n";
|
||||||
proxyFile.oss << " % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html\n";
|
proxyFile.oss
|
||||||
|
<< " % STRING_SERIALIZE usage: string_serialize() : returns string\n";
|
||||||
|
proxyFile.oss
|
||||||
|
<< " % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html\n";
|
||||||
proxyFile.oss << " if length(varargin) == 0\n";
|
proxyFile.oss << " if length(varargin) == 0\n";
|
||||||
proxyFile.oss << " varargout{1} = " << wrapperName << "(" << boost::lexical_cast<string>(serialize_id) << ", this, varargin{:});\n";
|
proxyFile.oss << " varargout{1} = " << wrapperName << "("
|
||||||
|
<< boost::lexical_cast<string>(serialize_id) << ", this, varargin{:});\n";
|
||||||
proxyFile.oss << " else\n";
|
proxyFile.oss << " else\n";
|
||||||
proxyFile.oss << " error('Arguments do not match any overload of function " << matlabQualName << ".string_serialize');\n";
|
proxyFile.oss
|
||||||
|
<< " error('Arguments do not match any overload of function "
|
||||||
|
<< matlabQualName << ".string_serialize');\n";
|
||||||
proxyFile.oss << " end\n";
|
proxyFile.oss << " end\n";
|
||||||
proxyFile.oss << " end\n\n";
|
proxyFile.oss << " end\n\n";
|
||||||
|
|
||||||
|
@ -476,14 +512,16 @@ void Class::serialization_fragments(FileWriter& proxyFile, FileWriter& wrapperFi
|
||||||
// end
|
// end
|
||||||
|
|
||||||
proxyFile.oss << " function sobj = saveobj(obj)\n";
|
proxyFile.oss << " function sobj = saveobj(obj)\n";
|
||||||
proxyFile.oss << " % SAVEOBJ Saves the object to a matlab-readable format\n";
|
proxyFile.oss
|
||||||
|
<< " % SAVEOBJ Saves the object to a matlab-readable format\n";
|
||||||
proxyFile.oss << " sobj = obj.string_serialize();\n";
|
proxyFile.oss << " sobj = obj.string_serialize();\n";
|
||||||
proxyFile.oss << " end\n";
|
proxyFile.oss << " end\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Class::deserialization_fragments(FileWriter& proxyFile, FileWriter& wrapperFile,
|
void Class::deserialization_fragments(FileWriter& proxyFile,
|
||||||
const std::string& wrapperName, std::vector<std::string>& functionNames) const {
|
FileWriter& wrapperFile, const std::string& wrapperName,
|
||||||
|
std::vector<std::string>& functionNames) const {
|
||||||
//void Point3_string_deserialize_18(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
//void Point3_string_deserialize_18(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
//{
|
//{
|
||||||
// typedef boost::shared_ptr<Point3> Shared;
|
// typedef boost::shared_ptr<Point3> Shared;
|
||||||
|
@ -496,28 +534,32 @@ void Class::deserialization_fragments(FileWriter& proxyFile, FileWriter& wrapper
|
||||||
// out[0] = wrap_shared_ptr(output,"Point3", false);
|
// out[0] = wrap_shared_ptr(output,"Point3", false);
|
||||||
//}
|
//}
|
||||||
int deserialize_id = functionNames.size();
|
int deserialize_id = functionNames.size();
|
||||||
const string
|
const string matlabQualName = qualifiedName("."), matlabUniqueName =
|
||||||
matlabQualName = qualifiedName("."),
|
qualifiedName(), cppClassName = qualifiedName("::");
|
||||||
matlabUniqueName = qualifiedName(),
|
const string wrapFunctionNameDeserialize = matlabUniqueName
|
||||||
cppClassName = qualifiedName("::");
|
+ "_string_deserialize_" + boost::lexical_cast<string>(deserialize_id);
|
||||||
const string wrapFunctionNameDeserialize = matlabUniqueName + "_string_deserialize_" + boost::lexical_cast<string>(deserialize_id);
|
|
||||||
functionNames.push_back(wrapFunctionNameDeserialize);
|
functionNames.push_back(wrapFunctionNameDeserialize);
|
||||||
|
|
||||||
// call
|
// call
|
||||||
wrapperFile.oss << "void " << wrapFunctionNameDeserialize << "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
wrapperFile.oss << "void " << wrapFunctionNameDeserialize
|
||||||
|
<< "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
||||||
wrapperFile.oss << "{\n";
|
wrapperFile.oss << "{\n";
|
||||||
wrapperFile.oss << " typedef boost::shared_ptr<" << cppClassName << "> Shared;" << endl;
|
wrapperFile.oss << " typedef boost::shared_ptr<" << cppClassName
|
||||||
|
<< "> Shared;" << endl;
|
||||||
|
|
||||||
// check arguments - for deserialize, 1 string argument
|
// check arguments - for deserialize, 1 string argument
|
||||||
wrapperFile.oss << " checkArguments(\"" << matlabUniqueName << ".string_deserialize\",nargout,nargin,1);\n";
|
wrapperFile.oss << " checkArguments(\"" << matlabUniqueName
|
||||||
|
<< ".string_deserialize\",nargout,nargin,1);\n";
|
||||||
|
|
||||||
// string argument with deserialization boilerplate
|
// string argument with deserialization boilerplate
|
||||||
wrapperFile.oss << " string serialized = unwrap< string >(in[0]);\n";
|
wrapperFile.oss << " string serialized = unwrap< string >(in[0]);\n";
|
||||||
wrapperFile.oss << " std::istringstream in_archive_stream(serialized);\n";
|
wrapperFile.oss << " std::istringstream in_archive_stream(serialized);\n";
|
||||||
wrapperFile.oss << " boost::archive::text_iarchive in_archive(in_archive_stream);\n";
|
wrapperFile.oss
|
||||||
|
<< " boost::archive::text_iarchive in_archive(in_archive_stream);\n";
|
||||||
wrapperFile.oss << " Shared output(new " << cppClassName << "());\n";
|
wrapperFile.oss << " Shared output(new " << cppClassName << "());\n";
|
||||||
wrapperFile.oss << " in_archive >> *output;\n";
|
wrapperFile.oss << " in_archive >> *output;\n";
|
||||||
wrapperFile.oss << " out[0] = wrap_shared_ptr(output,\"" << matlabQualName << "\", false);\n";
|
wrapperFile.oss << " out[0] = wrap_shared_ptr(output,\"" << matlabQualName
|
||||||
|
<< "\", false);\n";
|
||||||
wrapperFile.oss << "}\n";
|
wrapperFile.oss << "}\n";
|
||||||
|
|
||||||
// Generate matlab function
|
// Generate matlab function
|
||||||
|
@ -532,16 +574,21 @@ void Class::deserialization_fragments(FileWriter& proxyFile, FileWriter& wrapper
|
||||||
// end
|
// end
|
||||||
|
|
||||||
proxyFile.oss << " function varargout = string_deserialize(varargin)\n";
|
proxyFile.oss << " function varargout = string_deserialize(varargin)\n";
|
||||||
proxyFile.oss << " % STRING_DESERIALIZE usage: string_deserialize() : returns " << matlabQualName << "\n";
|
proxyFile.oss
|
||||||
proxyFile.oss << " % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html\n";
|
<< " % STRING_DESERIALIZE usage: string_deserialize() : returns "
|
||||||
|
<< matlabQualName << "\n";
|
||||||
|
proxyFile.oss
|
||||||
|
<< " % Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html\n";
|
||||||
proxyFile.oss << " if length(varargin) == 1\n";
|
proxyFile.oss << " if length(varargin) == 1\n";
|
||||||
proxyFile.oss << " varargout{1} = " << wrapperName << "(" << boost::lexical_cast<string>(deserialize_id) << ", varargin{:});\n";
|
proxyFile.oss << " varargout{1} = " << wrapperName << "("
|
||||||
|
<< boost::lexical_cast<string>(deserialize_id) << ", varargin{:});\n";
|
||||||
proxyFile.oss << " else\n";
|
proxyFile.oss << " else\n";
|
||||||
proxyFile.oss << " error('Arguments do not match any overload of function " << matlabQualName << ".string_deserialize');\n";
|
proxyFile.oss
|
||||||
|
<< " error('Arguments do not match any overload of function "
|
||||||
|
<< matlabQualName << ".string_deserialize');\n";
|
||||||
proxyFile.oss << " end\n";
|
proxyFile.oss << " end\n";
|
||||||
proxyFile.oss << " end\n\n";
|
proxyFile.oss << " end\n\n";
|
||||||
|
|
||||||
|
|
||||||
// Generate matlab load function
|
// Generate matlab load function
|
||||||
// function obj = loadobj(sobj)
|
// function obj = loadobj(sobj)
|
||||||
// % LOADOBJ Saves the object to a matlab-readable format
|
// % LOADOBJ Saves the object to a matlab-readable format
|
||||||
|
@ -549,14 +596,17 @@ void Class::deserialization_fragments(FileWriter& proxyFile, FileWriter& wrapper
|
||||||
// end
|
// end
|
||||||
|
|
||||||
proxyFile.oss << " function obj = loadobj(sobj)\n";
|
proxyFile.oss << " function obj = loadobj(sobj)\n";
|
||||||
proxyFile.oss << " % LOADOBJ Saves the object to a matlab-readable format\n";
|
proxyFile.oss
|
||||||
proxyFile.oss << " obj = " << matlabQualName << ".string_deserialize(sobj);\n";
|
<< " % LOADOBJ Saves the object to a matlab-readable format\n";
|
||||||
|
proxyFile.oss << " obj = " << matlabQualName
|
||||||
|
<< ".string_deserialize(sobj);\n";
|
||||||
proxyFile.oss << " end" << endl;
|
proxyFile.oss << " end" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
std::string Class::getSerializationExport() const {
|
std::string Class::getSerializationExport() const {
|
||||||
//BOOST_CLASS_EXPORT_GUID(gtsam::SharedDiagonal, "gtsamSharedDiagonal");
|
//BOOST_CLASS_EXPORT_GUID(gtsam::SharedDiagonal, "gtsamSharedDiagonal");
|
||||||
return "BOOST_CLASS_EXPORT_GUID(" + qualifiedName("::") + ", \"" + qualifiedName() + "\");";
|
return "BOOST_CLASS_EXPORT_GUID(" + qualifiedName("::") + ", \""
|
||||||
|
+ qualifiedName() + "\");";
|
||||||
}
|
}
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include "Method.h"
|
#include "Method.h"
|
||||||
#include "StaticMethod.h"
|
#include "StaticMethod.h"
|
||||||
#include "TypeAttributesTable.h"
|
#include "TypeAttributesTable.h"
|
||||||
#include <boost/algorithm/string.hpp>
|
|
||||||
|
|
||||||
namespace wrap {
|
namespace wrap {
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,11 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Argument.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Argument.h"
|
|
||||||
|
|
||||||
namespace wrap {
|
namespace wrap {
|
||||||
|
|
||||||
// Constructor class
|
// Constructor class
|
||||||
|
@ -54,10 +54,8 @@ struct Constructor {
|
||||||
|
|
||||||
/// cpp wrapper
|
/// cpp wrapper
|
||||||
std::string wrapper_fragment(FileWriter& file,
|
std::string wrapper_fragment(FileWriter& file,
|
||||||
const std::string& cppClassName,
|
const std::string& cppClassName, const std::string& matlabUniqueName,
|
||||||
const std::string& matlabUniqueName,
|
const std::string& cppBaseClassName, int id,
|
||||||
const std::string& cppBaseClassName,
|
|
||||||
int id,
|
|
||||||
const ArgumentList& al) const;
|
const ArgumentList& al) const;
|
||||||
|
|
||||||
/// constructor function
|
/// constructor function
|
||||||
|
@ -66,5 +64,4 @@ struct Constructor {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // \namespace wrap
|
} // \namespace wrap
|
||||||
|
|
|
@ -103,14 +103,9 @@ void GlobalFunction::generateSingleFunction(const std::string& toolboxPath, cons
|
||||||
mfunctionFile.oss << "\n";
|
mfunctionFile.oss << "\n";
|
||||||
|
|
||||||
// output call to C++ wrapper
|
// output call to C++ wrapper
|
||||||
string output;
|
mfunctionFile.oss << " ";
|
||||||
if(returnVal.isPair)
|
returnVal.emit_matlab(mfunctionFile);
|
||||||
output = "[ varargout{1} varargout{2} ] = ";
|
mfunctionFile.oss << wrapperName << "(" << id << ", varargin{:});\n";
|
||||||
else if(returnVal.category1 == ReturnValue::VOID)
|
|
||||||
output = "";
|
|
||||||
else
|
|
||||||
output = "varargout{1} = ";
|
|
||||||
mfunctionFile.oss << " " << output << wrapperName << "(" << id << ", varargin{:});\n";
|
|
||||||
|
|
||||||
// Output C++ wrapper code
|
// Output C++ wrapper code
|
||||||
|
|
||||||
|
|
194
wrap/Method.cpp
194
wrap/Method.cpp
|
@ -15,14 +15,15 @@
|
||||||
* @author Richard Roberts
|
* @author Richard Roberts
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <iostream>
|
#include "Method.h"
|
||||||
#include <fstream>
|
#include "utilities.h"
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
#include "Method.h"
|
#include <iostream>
|
||||||
#include "utilities.h"
|
#include <fstream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace wrap;
|
using namespace wrap;
|
||||||
|
@ -38,155 +39,140 @@ void Method::addOverload(bool verbose, bool is_const, const std::string& name,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Method::proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wrapperFile,
|
void Method::proxy_wrapper_fragments(FileWriter& file, FileWriter& wrapperFile,
|
||||||
const string& cppClassName,
|
const string& cppClassName, const std::string& matlabQualName,
|
||||||
const std::string& matlabQualName,
|
const std::string& matlabUniqueName, const string& wrapperName,
|
||||||
const std::string& matlabUniqueName,
|
|
||||||
const string& wrapperName,
|
|
||||||
const TypeAttributesTable& typeAttributes,
|
const TypeAttributesTable& typeAttributes,
|
||||||
vector<string>& functionNames) const {
|
vector<string>& functionNames) const {
|
||||||
|
|
||||||
proxyFile.oss << " function varargout = " << name << "(this, varargin)\n";
|
// Create function header
|
||||||
//Comments for documentation
|
file.oss << " function varargout = " << name << "(this, varargin)\n";
|
||||||
|
|
||||||
|
// Emit comments for documentation
|
||||||
string up_name = boost::to_upper_copy(name);
|
string up_name = boost::to_upper_copy(name);
|
||||||
proxyFile.oss << " % " << up_name << " usage:";
|
file.oss << " % " << up_name << " usage: ";
|
||||||
unsigned int argLCount = 0;
|
unsigned int argLCount = 0;
|
||||||
BOOST_FOREACH(ArgumentList argList, argLists)
|
BOOST_FOREACH(ArgumentList argList, argLists) {
|
||||||
{
|
argList.emit_prototype(file, name);
|
||||||
proxyFile.oss << " " << name << "(";
|
if (argLCount != argLists.size() - 1)
|
||||||
unsigned int i = 0;
|
file.oss << ", ";
|
||||||
BOOST_FOREACH(const Argument& arg, argList)
|
|
||||||
{
|
|
||||||
if(i != argList.size()-1)
|
|
||||||
proxyFile.oss << arg.type << " " << arg.name << ", ";
|
|
||||||
else
|
else
|
||||||
proxyFile.oss << arg.type << " " << arg.name;
|
file.oss << " : returns "
|
||||||
i++;
|
<< returnVals[0].return_type(false, returnVals[0].pair) << endl;
|
||||||
}
|
|
||||||
if(argLCount != argLists.size()-1)
|
|
||||||
proxyFile.oss << "), ";
|
|
||||||
else
|
|
||||||
proxyFile.oss << ") : returns " << returnVals[0].return_type(false, returnVals[0].pair) << endl;
|
|
||||||
argLCount++;
|
argLCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyFile.oss << " % " << "Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html" << endl;
|
// Emit URL to Doxygen page
|
||||||
proxyFile.oss << " % " << "" << endl;
|
file.oss << " % "
|
||||||
proxyFile.oss << " % " << "Method Overloads" << endl;
|
<< "Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html"
|
||||||
BOOST_FOREACH(ArgumentList argList, argLists)
|
<< endl;
|
||||||
{
|
|
||||||
proxyFile.oss << " % " << name << "(";
|
// Document all overloads, if any
|
||||||
unsigned int i = 0;
|
if (argLists.size() > 1) {
|
||||||
BOOST_FOREACH(const Argument& arg, argList)
|
file.oss << " % " << "" << endl;
|
||||||
{
|
file.oss << " % " << "Method Overloads" << endl;
|
||||||
if(i != argList.size()-1)
|
BOOST_FOREACH(ArgumentList argList, argLists) {
|
||||||
proxyFile.oss << arg.type << " " << arg.name << ", ";
|
file.oss << " % ";
|
||||||
else
|
argList.emit_prototype(file, name);
|
||||||
proxyFile.oss << arg.type << " " << arg.name;
|
file.oss << endl;
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
proxyFile.oss << ")" << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(size_t overload = 0; overload < argLists.size(); ++overload) {
|
// Handle special case of single overload with all numeric arguments
|
||||||
const ArgumentList& args = argLists[overload];
|
if (argLists.size() == 1 && argLists[0].allScalar()) {
|
||||||
const ReturnValue& returnVal = returnVals[overload];
|
|
||||||
size_t nrArgs = args.size();
|
|
||||||
|
|
||||||
const int id = functionNames.size();
|
|
||||||
|
|
||||||
// Output proxy matlab code
|
// Output proxy matlab code
|
||||||
|
file.oss << " ";
|
||||||
// check for number of arguments...
|
const int id = (int) functionNames.size();
|
||||||
proxyFile.oss << " " << (overload==0?"":"else") << "if length(varargin) == " << nrArgs;
|
argLists[0].emit_call(file, returnVals[0], wrapperName, id);
|
||||||
if (nrArgs>0) proxyFile.oss << " && ";
|
|
||||||
// ...and their types
|
|
||||||
bool first = true;
|
|
||||||
for(size_t i=0;i<nrArgs;i++) {
|
|
||||||
if (!first) proxyFile.oss << " && ";
|
|
||||||
proxyFile.oss << "isa(varargin{" << i+1 << "},'" << args[i].matlabClass(".") << "')";
|
|
||||||
first=false;
|
|
||||||
}
|
|
||||||
proxyFile.oss << "\n";
|
|
||||||
|
|
||||||
// output call to C++ wrapper
|
|
||||||
string output;
|
|
||||||
if(returnVal.isPair)
|
|
||||||
output = "[ varargout{1} varargout{2} ] = ";
|
|
||||||
else if(returnVal.category1 == ReturnValue::VOID)
|
|
||||||
output = "";
|
|
||||||
else
|
|
||||||
output = "varargout{1} = ";
|
|
||||||
proxyFile.oss << " " << output << wrapperName << "(" << id << ", this, varargin{:});\n";
|
|
||||||
|
|
||||||
// Output C++ wrapper code
|
// Output C++ wrapper code
|
||||||
|
const string wrapFunctionName = wrapper_fragment(wrapperFile, cppClassName,
|
||||||
const string wrapFunctionName = wrapper_fragment(
|
matlabUniqueName, 0, id, typeAttributes);
|
||||||
wrapperFile, cppClassName, matlabUniqueName, overload, id, typeAttributes);
|
|
||||||
|
|
||||||
// Add to function list
|
// Add to function list
|
||||||
functionNames.push_back(wrapFunctionName);
|
functionNames.push_back(wrapFunctionName);
|
||||||
|
} else {
|
||||||
|
// Check arguments for all overloads
|
||||||
|
for (size_t overload = 0; overload < argLists.size(); ++overload) {
|
||||||
|
|
||||||
|
// Output proxy matlab code
|
||||||
|
file.oss << " " << (overload == 0 ? "" : "else");
|
||||||
|
const int id = (int) functionNames.size();
|
||||||
|
argLists[overload].emit_conditional_call(file, returnVals[overload],
|
||||||
|
wrapperName, id);
|
||||||
|
|
||||||
|
// Output C++ wrapper code
|
||||||
|
const string wrapFunctionName = wrapper_fragment(wrapperFile,
|
||||||
|
cppClassName, matlabUniqueName, overload, id, typeAttributes);
|
||||||
|
|
||||||
|
// Add to function list
|
||||||
|
functionNames.push_back(wrapFunctionName);
|
||||||
|
}
|
||||||
|
file.oss << " else\n";
|
||||||
|
file.oss
|
||||||
|
<< " error('Arguments do not match any overload of function "
|
||||||
|
<< matlabQualName << "." << name << "');" << endl;
|
||||||
|
file.oss << " end\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyFile.oss << " else\n";
|
file.oss << " end\n";
|
||||||
proxyFile.oss << " error('Arguments do not match any overload of function " <<
|
|
||||||
matlabQualName << "." << name << "');" << endl;
|
|
||||||
|
|
||||||
proxyFile.oss << " end\n";
|
|
||||||
proxyFile.oss << " end\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
string Method::wrapper_fragment(FileWriter& file,
|
string Method::wrapper_fragment(FileWriter& file, const string& cppClassName,
|
||||||
const string& cppClassName,
|
const string& matlabUniqueName, int overload, int id,
|
||||||
const string& matlabUniqueName,
|
|
||||||
int overload,
|
|
||||||
int id,
|
|
||||||
const TypeAttributesTable& typeAttributes) const {
|
const TypeAttributesTable& typeAttributes) const {
|
||||||
|
|
||||||
// generate code
|
// generate code
|
||||||
|
|
||||||
const string wrapFunctionName = matlabUniqueName + "_" + name + "_" + boost::lexical_cast<string>(id);
|
const string wrapFunctionName = matlabUniqueName + "_" + name + "_"
|
||||||
|
+ boost::lexical_cast<string>(id);
|
||||||
|
|
||||||
const ArgumentList& args = argLists[overload];
|
const ArgumentList& args = argLists[overload];
|
||||||
const ReturnValue& returnVal = returnVals[overload];
|
const ReturnValue& returnVal = returnVals[overload];
|
||||||
|
|
||||||
// call
|
// call
|
||||||
file.oss << "void " << wrapFunctionName << "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
file.oss << "void " << wrapFunctionName
|
||||||
|
<< "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
||||||
// start
|
// start
|
||||||
file.oss << "{\n";
|
file.oss << "{\n";
|
||||||
|
|
||||||
if(returnVal.isPair)
|
if (returnVal.isPair) {
|
||||||
{
|
if (returnVal.category1 == ReturnValue::CLASS)
|
||||||
if(returnVal.category1 == ReturnValue::CLASS)
|
file.oss << " typedef boost::shared_ptr<"
|
||||||
file.oss << " typedef boost::shared_ptr<" << returnVal.qualifiedType1("::") << "> Shared" << returnVal.type1 << ";"<< endl;
|
<< returnVal.qualifiedType1("::") << "> Shared" << returnVal.type1
|
||||||
if(returnVal.category2 == ReturnValue::CLASS)
|
<< ";" << endl;
|
||||||
file.oss << " typedef boost::shared_ptr<" << returnVal.qualifiedType2("::") << "> Shared" << returnVal.type2 << ";"<< endl;
|
if (returnVal.category2 == ReturnValue::CLASS)
|
||||||
}
|
file.oss << " typedef boost::shared_ptr<"
|
||||||
else
|
<< returnVal.qualifiedType2("::") << "> Shared" << returnVal.type2
|
||||||
if(returnVal.category1 == ReturnValue::CLASS)
|
<< ";" << endl;
|
||||||
file.oss << " typedef boost::shared_ptr<" << returnVal.qualifiedType1("::") << "> Shared" << returnVal.type1 << ";"<< endl;
|
} else if (returnVal.category1 == ReturnValue::CLASS)
|
||||||
|
file.oss << " typedef boost::shared_ptr<" << returnVal.qualifiedType1("::")
|
||||||
|
<< "> Shared" << returnVal.type1 << ";" << endl;
|
||||||
|
|
||||||
file.oss << " typedef boost::shared_ptr<" << cppClassName << "> Shared;" << endl;
|
file.oss << " typedef boost::shared_ptr<" << cppClassName << "> Shared;"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
// check arguments
|
// check arguments
|
||||||
// extra argument obj -> nargin-1 is passed !
|
// extra argument obj -> nargin-1 is passed !
|
||||||
// example: checkArguments("equals",nargout,nargin-1,2);
|
// example: checkArguments("equals",nargout,nargin-1,2);
|
||||||
file.oss << " checkArguments(\"" << name << "\",nargout,nargin-1," << args.size() << ");\n";
|
file.oss << " checkArguments(\"" << name << "\",nargout,nargin-1,"
|
||||||
|
<< args.size() << ");\n";
|
||||||
|
|
||||||
// get class pointer
|
// get class pointer
|
||||||
// example: shared_ptr<Test> = unwrap_shared_ptr< Test >(in[0], "Test");
|
// example: shared_ptr<Test> = unwrap_shared_ptr< Test >(in[0], "Test");
|
||||||
file.oss << " Shared obj = unwrap_shared_ptr<" << cppClassName << ">(in[0], \"ptr_" << matlabUniqueName << "\");" << endl;
|
file.oss << " Shared obj = unwrap_shared_ptr<" << cppClassName
|
||||||
|
<< ">(in[0], \"ptr_" << matlabUniqueName << "\");" << endl;
|
||||||
// unwrap arguments, see Argument.cpp
|
// unwrap arguments, see Argument.cpp
|
||||||
args.matlab_unwrap(file,1);
|
args.matlab_unwrap(file, 1);
|
||||||
|
|
||||||
// call method and wrap result
|
// call method and wrap result
|
||||||
// example: out[0]=wrap<bool>(self->return_field(t));
|
// example: out[0]=wrap<bool>(self->return_field(t));
|
||||||
if (returnVal.type1!="void")
|
if (returnVal.type1 != "void")
|
||||||
returnVal.wrap_result("obj->"+name+"("+args.names()+")", file, typeAttributes);
|
returnVal.wrap_result("obj->" + name + "(" + args.names() + ")", file,
|
||||||
|
typeAttributes);
|
||||||
else
|
else
|
||||||
file.oss << " obj->"+name+"("+args.names()+");\n";
|
file.oss << " obj->" + name + "(" + args.names() + ");\n";
|
||||||
|
|
||||||
// finish
|
// finish
|
||||||
file.oss << "}\n";
|
file.oss << "}\n";
|
||||||
|
|
|
@ -18,13 +18,12 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <list>
|
|
||||||
|
|
||||||
#include "Argument.h"
|
#include "Argument.h"
|
||||||
#include "ReturnValue.h"
|
#include "ReturnValue.h"
|
||||||
#include "TypeAttributesTable.h"
|
#include "TypeAttributesTable.h"
|
||||||
#include <boost/algorithm/string.hpp>
|
|
||||||
|
#include <string>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
namespace wrap {
|
namespace wrap {
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ void Module::parseMarkup(const std::string& data) {
|
||||||
// The one with postfix 0 are used to reset the variables after parse.
|
// The one with postfix 0 are used to reset the variables after parse.
|
||||||
string methodName, methodName0;
|
string methodName, methodName0;
|
||||||
bool isConst, isConst0 = false;
|
bool isConst, isConst0 = false;
|
||||||
ReturnValue retVal0(verbose), retVal(verbose);
|
ReturnValue retVal0, retVal;
|
||||||
Argument arg0, arg;
|
Argument arg0, arg;
|
||||||
ArgumentList args0, args;
|
ArgumentList args0, args;
|
||||||
vector<string> arg_dup; ///keep track of duplicates
|
vector<string> arg_dup; ///keep track of duplicates
|
||||||
|
|
|
@ -141,5 +141,13 @@ void ReturnValue::wrapTypeUnwrap(FileWriter& wrapperFile) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
void ReturnValue::emit_matlab(FileWriter& file) const {
|
||||||
|
string output;
|
||||||
|
if (isPair)
|
||||||
|
file.oss << "[ varargout{1} varargout{2} ] = ";
|
||||||
|
else if (category1 != ReturnValue::VOID)
|
||||||
|
file.oss << "varargout{1} = ";
|
||||||
|
}
|
||||||
|
/* ************************************************************************* */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,36 +8,36 @@
|
||||||
* @author Richard Roberts
|
* @author Richard Roberts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include "FileWriter.h"
|
#include "FileWriter.h"
|
||||||
#include "TypeAttributesTable.h"
|
#include "TypeAttributesTable.h"
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
namespace wrap {
|
namespace wrap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encapsulates return value of a method or function
|
||||||
|
*/
|
||||||
struct ReturnValue {
|
struct ReturnValue {
|
||||||
|
|
||||||
|
/// the different supported return value categories
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CLASS = 1,
|
CLASS = 1, EIGEN = 2, BASIS = 3, VOID = 4
|
||||||
EIGEN = 2,
|
|
||||||
BASIS = 3,
|
|
||||||
VOID = 4
|
|
||||||
} return_category;
|
} return_category;
|
||||||
|
|
||||||
ReturnValue(bool enable_verbosity = true)
|
|
||||||
: verbose(enable_verbosity), isPtr1(false), isPtr2(false),
|
|
||||||
isPair(false), category1(CLASS), category2(CLASS)
|
|
||||||
{}
|
|
||||||
|
|
||||||
bool verbose;
|
|
||||||
bool isPtr1, isPtr2, isPair;
|
bool isPtr1, isPtr2, isPair;
|
||||||
return_category category1, category2;
|
return_category category1, category2;
|
||||||
std::string type1, type2;
|
std::string type1, type2;
|
||||||
std::vector<std::string> namespaces1, namespaces2;
|
std::vector<std::string> namespaces1, namespaces2;
|
||||||
|
|
||||||
|
/// Constructor
|
||||||
|
ReturnValue() :
|
||||||
|
isPtr1(false), isPtr2(false), isPair(false), category1(CLASS), category2(
|
||||||
|
CLASS) {
|
||||||
|
}
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
arg1, arg2, pair
|
arg1, arg2, pair
|
||||||
} pairing;
|
} pairing;
|
||||||
|
@ -49,10 +49,12 @@ struct ReturnValue {
|
||||||
|
|
||||||
std::string matlab_returnType() const;
|
std::string matlab_returnType() const;
|
||||||
|
|
||||||
void wrap_result(const std::string& result, FileWriter& file, const TypeAttributesTable& typeAttributes) const;
|
void wrap_result(const std::string& result, FileWriter& file,
|
||||||
|
const TypeAttributesTable& typeAttributes) const;
|
||||||
|
|
||||||
void wrapTypeUnwrap(FileWriter& wrapperFile) const;
|
void wrapTypeUnwrap(FileWriter& wrapperFile) const;
|
||||||
|
|
||||||
|
void emit_matlab(FileWriter& file) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // \namespace wrap
|
} // \namespace wrap
|
||||||
|
|
|
@ -16,19 +16,19 @@
|
||||||
* @author Richard Roberts
|
* @author Richard Roberts
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <boost/lexical_cast.hpp>
|
|
||||||
|
|
||||||
#include "StaticMethod.h"
|
#include "StaticMethod.h"
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
#include <boost/lexical_cast.hpp>
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace wrap;
|
using namespace wrap;
|
||||||
|
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void StaticMethod::addOverload(bool verbose, const std::string& name,
|
void StaticMethod::addOverload(bool verbose, const std::string& name,
|
||||||
const ArgumentList& args, const ReturnValue& retVal) {
|
const ArgumentList& args, const ReturnValue& retVal) {
|
||||||
|
@ -39,144 +39,103 @@ void StaticMethod::addOverload(bool verbose, const std::string& name,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void StaticMethod::proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wrapperFile,
|
void StaticMethod::proxy_wrapper_fragments(FileWriter& file,
|
||||||
const string& cppClassName,
|
FileWriter& wrapperFile, const string& cppClassName,
|
||||||
const std::string& matlabQualName,
|
const std::string& matlabQualName, const std::string& matlabUniqueName,
|
||||||
const std::string& matlabUniqueName,
|
const string& wrapperName, const TypeAttributesTable& typeAttributes,
|
||||||
const string& wrapperName,
|
|
||||||
const TypeAttributesTable& typeAttributes,
|
|
||||||
vector<string>& functionNames) const {
|
vector<string>& functionNames) const {
|
||||||
|
|
||||||
string upperName = name; upperName[0] = std::toupper(upperName[0], std::locale());
|
string upperName = name;
|
||||||
|
upperName[0] = std::toupper(upperName[0], std::locale());
|
||||||
|
|
||||||
proxyFile.oss << " function varargout = " << upperName << "(varargin)\n";
|
file.oss << " function varargout = " << upperName << "(varargin)\n";
|
||||||
//Comments for documentation
|
//Comments for documentation
|
||||||
string up_name = boost::to_upper_copy(name);
|
string up_name = boost::to_upper_copy(name);
|
||||||
proxyFile.oss << " % " << up_name << " usage:";
|
file.oss << " % " << up_name << " usage: ";
|
||||||
unsigned int argLCount = 0;
|
unsigned int argLCount = 0;
|
||||||
BOOST_FOREACH(ArgumentList argList, argLists)
|
BOOST_FOREACH(ArgumentList argList, argLists) {
|
||||||
{
|
argList.emit_prototype(file, name);
|
||||||
proxyFile.oss << " " << name << "(";
|
if (argLCount != argLists.size() - 1)
|
||||||
unsigned int i = 0;
|
file.oss << ", ";
|
||||||
BOOST_FOREACH(const Argument& arg, argList)
|
|
||||||
{
|
|
||||||
if(i != argList.size()-1)
|
|
||||||
proxyFile.oss << arg.type << " " << arg.name << ", ";
|
|
||||||
else
|
else
|
||||||
proxyFile.oss << arg.type << " " << arg.name;
|
file.oss << " : returns "
|
||||||
i++;
|
<< returnVals[0].return_type(false, returnVals[0].pair) << endl;
|
||||||
}
|
|
||||||
if(argLCount != argLists.size()-1)
|
|
||||||
proxyFile.oss << "), ";
|
|
||||||
else
|
|
||||||
proxyFile.oss << ") : returns " << returnVals[0].return_type(false, returnVals[0].pair) << endl;
|
|
||||||
argLCount++;
|
argLCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyFile.oss << " % " << "Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html" << endl;
|
file.oss << " % "
|
||||||
proxyFile.oss << " % " << "" << endl;
|
<< "Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html"
|
||||||
proxyFile.oss << " % " << "Usage" << endl;
|
<< endl;
|
||||||
BOOST_FOREACH(ArgumentList argList, argLists)
|
file.oss << " % " << "" << endl;
|
||||||
{
|
file.oss << " % " << "Usage" << endl;
|
||||||
proxyFile.oss << " % " << up_name << "(";
|
BOOST_FOREACH(ArgumentList argList, argLists) {
|
||||||
unsigned int i = 0;
|
file.oss << " % ";
|
||||||
BOOST_FOREACH(const Argument& arg, argList)
|
argList.emit_prototype(file, up_name);
|
||||||
{
|
file.oss << endl;
|
||||||
if(i != argList.size()-1)
|
|
||||||
proxyFile.oss << arg.type << " " << arg.name << ", ";
|
|
||||||
else
|
|
||||||
proxyFile.oss << arg.type << " " << arg.name;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
proxyFile.oss << ")" << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check arguments for all overloads
|
||||||
for(size_t overload = 0; overload < argLists.size(); ++overload) {
|
for (size_t overload = 0; overload < argLists.size(); ++overload) {
|
||||||
const ArgumentList& args = argLists[overload];
|
|
||||||
const ReturnValue& returnVal = returnVals[overload];
|
|
||||||
size_t nrArgs = args.size();
|
|
||||||
|
|
||||||
const int id = (int)functionNames.size();
|
|
||||||
|
|
||||||
// Output proxy matlab code
|
// Output proxy matlab code
|
||||||
|
file.oss << " " << (overload == 0 ? "" : "else");
|
||||||
// check for number of arguments...
|
const int id = (int) functionNames.size();
|
||||||
proxyFile.oss << " " << (overload==0?"":"else") << "if length(varargin) == " << nrArgs;
|
argLists[overload].emit_conditional_call(file, returnVals[overload],
|
||||||
if (nrArgs>0) proxyFile.oss << " && ";
|
wrapperName, id, true); // last bool is to indicate static !
|
||||||
// ...and their types
|
|
||||||
bool first = true;
|
|
||||||
for(size_t i=0;i<nrArgs;i++) {
|
|
||||||
if (!first) proxyFile.oss << " && ";
|
|
||||||
proxyFile.oss << "isa(varargin{" << i+1 << "},'" << args[i].matlabClass(".") << "')";
|
|
||||||
first=false;
|
|
||||||
}
|
|
||||||
proxyFile.oss << "\n";
|
|
||||||
|
|
||||||
// output call to C++ wrapper
|
|
||||||
string output;
|
|
||||||
if(returnVal.isPair)
|
|
||||||
output = "[ varargout{1} varargout{2} ] = ";
|
|
||||||
else if(returnVal.category1 == ReturnValue::VOID)
|
|
||||||
output = "";
|
|
||||||
else
|
|
||||||
output = "varargout{1} = ";
|
|
||||||
proxyFile.oss << " " << output << wrapperName << "(" << id << ", varargin{:});\n";
|
|
||||||
|
|
||||||
// Output C++ wrapper code
|
// Output C++ wrapper code
|
||||||
|
const string wrapFunctionName = wrapper_fragment(wrapperFile, cppClassName,
|
||||||
const string wrapFunctionName = wrapper_fragment(
|
matlabUniqueName, (int) overload, id, typeAttributes);
|
||||||
wrapperFile, cppClassName, matlabUniqueName, (int)overload, id, typeAttributes);
|
|
||||||
|
|
||||||
// Add to function list
|
// Add to function list
|
||||||
functionNames.push_back(wrapFunctionName);
|
functionNames.push_back(wrapFunctionName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
file.oss << " else\n";
|
||||||
|
file.oss << " error('Arguments do not match any overload of function "
|
||||||
|
<< matlabQualName << "." << upperName << "');" << endl;
|
||||||
|
file.oss << " end\n";
|
||||||
|
|
||||||
proxyFile.oss << " else\n";
|
file.oss << " end\n";
|
||||||
proxyFile.oss << " error('Arguments do not match any overload of function " <<
|
|
||||||
matlabQualName << "." << upperName << "');" << endl;
|
|
||||||
|
|
||||||
proxyFile.oss << " end\n";
|
|
||||||
proxyFile.oss << " end\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
string StaticMethod::wrapper_fragment(FileWriter& file,
|
string StaticMethod::wrapper_fragment(FileWriter& file,
|
||||||
const string& cppClassName,
|
const string& cppClassName, const string& matlabUniqueName, int overload,
|
||||||
const string& matlabUniqueName,
|
int id, const TypeAttributesTable& typeAttributes) const {
|
||||||
int overload,
|
|
||||||
int id,
|
|
||||||
const TypeAttributesTable& typeAttributes) const {
|
|
||||||
|
|
||||||
// generate code
|
// generate code
|
||||||
|
|
||||||
const string wrapFunctionName = matlabUniqueName + "_" + name + "_" + boost::lexical_cast<string>(id);
|
const string wrapFunctionName = matlabUniqueName + "_" + name + "_"
|
||||||
|
+ boost::lexical_cast<string>(id);
|
||||||
|
|
||||||
const ArgumentList& args = argLists[overload];
|
const ArgumentList& args = argLists[overload];
|
||||||
const ReturnValue& returnVal = returnVals[overload];
|
const ReturnValue& returnVal = returnVals[overload];
|
||||||
|
|
||||||
// call
|
// call
|
||||||
file.oss << "void " << wrapFunctionName << "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
file.oss << "void " << wrapFunctionName
|
||||||
|
<< "(int nargout, mxArray *out[], int nargin, const mxArray *in[])\n";
|
||||||
// start
|
// start
|
||||||
file.oss << "{\n";
|
file.oss << "{\n";
|
||||||
|
|
||||||
returnVal.wrapTypeUnwrap(file);
|
returnVal.wrapTypeUnwrap(file);
|
||||||
|
|
||||||
file.oss << " typedef boost::shared_ptr<" << cppClassName << "> Shared;" << endl;
|
file.oss << " typedef boost::shared_ptr<" << cppClassName << "> Shared;"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
// check arguments
|
// check arguments
|
||||||
// NOTE: for static functions, there is no object passed
|
// NOTE: for static functions, there is no object passed
|
||||||
file.oss << " checkArguments(\"" << matlabUniqueName << "." << name << "\",nargout,nargin," << args.size() << ");\n";
|
file.oss << " checkArguments(\"" << matlabUniqueName << "." << name
|
||||||
|
<< "\",nargout,nargin," << args.size() << ");\n";
|
||||||
|
|
||||||
// unwrap arguments, see Argument.cpp
|
// unwrap arguments, see Argument.cpp
|
||||||
args.matlab_unwrap(file,0); // We start at 0 because there is no self object
|
args.matlab_unwrap(file, 0); // We start at 0 because there is no self object
|
||||||
|
|
||||||
// call method with default type and wrap result
|
// call method with default type and wrap result
|
||||||
if (returnVal.type1!="void")
|
if (returnVal.type1 != "void")
|
||||||
returnVal.wrap_result(cppClassName+"::"+name+"("+args.names()+")", file, typeAttributes);
|
returnVal.wrap_result(cppClassName + "::" + name + "(" + args.names() + ")",
|
||||||
|
file, typeAttributes);
|
||||||
else
|
else
|
||||||
file.oss << cppClassName+"::"+name+"("+args.names()+");\n";
|
file.oss << cppClassName + "::" + name + "(" + args.names() + ");\n";
|
||||||
|
|
||||||
// finish
|
// finish
|
||||||
file.oss << "}\n";
|
file.oss << "}\n";
|
||||||
|
|
|
@ -19,13 +19,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <list>
|
|
||||||
|
|
||||||
#include "Argument.h"
|
#include "Argument.h"
|
||||||
#include "ReturnValue.h"
|
#include "ReturnValue.h"
|
||||||
#include "TypeAttributesTable.h"
|
#include "TypeAttributesTable.h"
|
||||||
#include <boost/algorithm/string.hpp>
|
|
||||||
|
|
||||||
namespace wrap {
|
namespace wrap {
|
||||||
|
|
||||||
|
@ -34,7 +30,8 @@ struct StaticMethod {
|
||||||
|
|
||||||
/// Constructor creates empty object
|
/// Constructor creates empty object
|
||||||
StaticMethod(bool verbosity = true) :
|
StaticMethod(bool verbosity = true) :
|
||||||
verbose(verbosity) {}
|
verbose(verbosity) {
|
||||||
|
}
|
||||||
|
|
||||||
// Then the instance variables are set directly by the Module constructor
|
// Then the instance variables are set directly by the Module constructor
|
||||||
bool verbose;
|
bool verbose;
|
||||||
|
@ -51,17 +48,15 @@ struct StaticMethod {
|
||||||
// MATLAB code generation
|
// MATLAB code generation
|
||||||
// classPath is class directory, e.g., ../matlab/@Point2
|
// classPath is class directory, e.g., ../matlab/@Point2
|
||||||
void proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wrapperFile,
|
void proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wrapperFile,
|
||||||
const std::string& cppClassName, const std::string& matlabQualName, const std::string& matlabUniqueName,
|
const std::string& cppClassName, const std::string& matlabQualName,
|
||||||
const std::string& wrapperName, const TypeAttributesTable& typeAttributes,
|
const std::string& matlabUniqueName, const std::string& wrapperName,
|
||||||
|
const TypeAttributesTable& typeAttributes,
|
||||||
std::vector<std::string>& functionNames) const;
|
std::vector<std::string>& functionNames) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string wrapper_fragment(FileWriter& file,
|
std::string wrapper_fragment(FileWriter& file,
|
||||||
const std::string& cppClassName,
|
const std::string& cppClassName, const std::string& matlabUniqueName,
|
||||||
const std::string& matlabUniqueName,
|
int overload, int id, const TypeAttributesTable& typeAttributes) const; ///< cpp wrapper
|
||||||
int overload,
|
|
||||||
int id,
|
|
||||||
const TypeAttributesTable& typeAttributes) const; ///< cpp wrapper
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // \namespace wrap
|
} // \namespace wrap
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
*.m~
|
|
@ -44,92 +44,43 @@ classdef Point2 < handle
|
||||||
function varargout = argChar(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% argChar(char a)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'char')
|
|
||||||
geometry_wrapper(4, this, varargin{:});
|
geometry_wrapper(4, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Point2.argChar');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = argUChar(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% argUChar(unsigned char a)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'char')
|
|
||||||
geometry_wrapper(5, this, varargin{:});
|
geometry_wrapper(5, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Point2.argUChar');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = dim(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% dim()
|
|
||||||
if length(varargin) == 0
|
|
||||||
varargout{1} = geometry_wrapper(6, this, varargin{:});
|
varargout{1} = geometry_wrapper(6, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Point2.dim');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = returnChar(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% returnChar()
|
|
||||||
if length(varargin) == 0
|
|
||||||
varargout{1} = geometry_wrapper(7, this, varargin{:});
|
varargout{1} = geometry_wrapper(7, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Point2.returnChar');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = vectorConfusion(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% vectorConfusion()
|
|
||||||
if length(varargin) == 0
|
|
||||||
varargout{1} = geometry_wrapper(8, this, varargin{:});
|
varargout{1} = geometry_wrapper(8, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Point2.vectorConfusion');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = x(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% x()
|
|
||||||
if length(varargin) == 0
|
|
||||||
varargout{1} = geometry_wrapper(9, this, varargin{:});
|
varargout{1} = geometry_wrapper(9, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Point2.x');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = y(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% y()
|
|
||||||
if length(varargin) == 0
|
|
||||||
varargout{1} = geometry_wrapper(10, this, varargin{:});
|
varargout{1} = geometry_wrapper(10, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Point2.y');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,14 +43,7 @@ classdef Point3 < handle
|
||||||
function varargout = norm(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% norm()
|
|
||||||
if length(varargin) == 0
|
|
||||||
varargout{1} = geometry_wrapper(14, this, varargin{:});
|
varargout{1} = geometry_wrapper(14, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Point3.norm');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = string_serialize(this, varargin)
|
function varargout = string_serialize(this, varargin)
|
||||||
|
|
|
@ -56,9 +56,6 @@ classdef Test < handle
|
||||||
function varargout = arg_EigenConstRef(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% arg_EigenConstRef(Matrix value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'double')
|
if length(varargin) == 1 && isa(varargin{1},'double')
|
||||||
geometry_wrapper(23, this, varargin{:});
|
geometry_wrapper(23, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -69,61 +66,30 @@ classdef Test < handle
|
||||||
function varargout = create_MixedPtrs(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% create_MixedPtrs()
|
|
||||||
if length(varargin) == 0
|
|
||||||
[ varargout{1} varargout{2} ] = geometry_wrapper(24, this, varargin{:});
|
[ varargout{1} varargout{2} ] = geometry_wrapper(24, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Test.create_MixedPtrs');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = create_ptrs(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% create_ptrs()
|
|
||||||
if length(varargin) == 0
|
|
||||||
[ varargout{1} varargout{2} ] = geometry_wrapper(25, this, varargin{:});
|
[ varargout{1} varargout{2} ] = geometry_wrapper(25, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Test.create_ptrs');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = print(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% print()
|
|
||||||
if length(varargin) == 0
|
|
||||||
geometry_wrapper(26, this, varargin{:});
|
geometry_wrapper(26, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Test.print');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = return_Point2Ptr(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_Point2Ptr(bool value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'logical')
|
|
||||||
varargout{1} = geometry_wrapper(27, this, varargin{:});
|
varargout{1} = geometry_wrapper(27, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Test.return_Point2Ptr');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = return_Test(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_Test(Test value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'Test')
|
if length(varargin) == 1 && isa(varargin{1},'Test')
|
||||||
varargout{1} = geometry_wrapper(28, this, varargin{:});
|
varargout{1} = geometry_wrapper(28, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -134,9 +100,6 @@ classdef Test < handle
|
||||||
function varargout = return_TestPtr(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_TestPtr(Test value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'Test')
|
if length(varargin) == 1 && isa(varargin{1},'Test')
|
||||||
varargout{1} = geometry_wrapper(29, this, varargin{:});
|
varargout{1} = geometry_wrapper(29, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -147,35 +110,18 @@ classdef Test < handle
|
||||||
function varargout = return_bool(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_bool(bool value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'logical')
|
|
||||||
varargout{1} = geometry_wrapper(30, this, varargin{:});
|
varargout{1} = geometry_wrapper(30, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Test.return_bool');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = return_double(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_double(double value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'double')
|
|
||||||
varargout{1} = geometry_wrapper(31, this, varargin{:});
|
varargout{1} = geometry_wrapper(31, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Test.return_double');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = return_field(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_field(Test t)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'Test')
|
if length(varargin) == 1 && isa(varargin{1},'Test')
|
||||||
varargout{1} = geometry_wrapper(32, this, varargin{:});
|
varargout{1} = geometry_wrapper(32, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -186,22 +132,12 @@ classdef Test < handle
|
||||||
function varargout = return_int(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_int(int value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'numeric')
|
|
||||||
varargout{1} = geometry_wrapper(33, this, varargin{:});
|
varargout{1} = geometry_wrapper(33, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Test.return_int');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = return_matrix1(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_matrix1(Matrix value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'double')
|
if length(varargin) == 1 && isa(varargin{1},'double')
|
||||||
varargout{1} = geometry_wrapper(34, this, varargin{:});
|
varargout{1} = geometry_wrapper(34, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -212,9 +148,6 @@ classdef Test < handle
|
||||||
function varargout = return_matrix2(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_matrix2(Matrix value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'double')
|
if length(varargin) == 1 && isa(varargin{1},'double')
|
||||||
varargout{1} = geometry_wrapper(35, this, varargin{:});
|
varargout{1} = geometry_wrapper(35, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -225,9 +158,6 @@ classdef Test < handle
|
||||||
function varargout = return_pair(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_pair(Vector v, Matrix A)
|
|
||||||
if length(varargin) == 2 && isa(varargin{1},'double') && isa(varargin{2},'double')
|
if length(varargin) == 2 && isa(varargin{1},'double') && isa(varargin{2},'double')
|
||||||
[ varargout{1} varargout{2} ] = geometry_wrapper(36, this, varargin{:});
|
[ varargout{1} varargout{2} ] = geometry_wrapper(36, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -238,9 +168,6 @@ classdef Test < handle
|
||||||
function varargout = return_ptrs(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_ptrs(Test p1, Test p2)
|
|
||||||
if length(varargin) == 2 && isa(varargin{1},'Test') && isa(varargin{2},'Test')
|
if length(varargin) == 2 && isa(varargin{1},'Test') && isa(varargin{2},'Test')
|
||||||
[ varargout{1} varargout{2} ] = geometry_wrapper(37, this, varargin{:});
|
[ varargout{1} varargout{2} ] = geometry_wrapper(37, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -251,22 +178,12 @@ classdef Test < handle
|
||||||
function varargout = return_size_t(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_size_t(size_t value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'numeric')
|
|
||||||
varargout{1} = geometry_wrapper(38, this, varargin{:});
|
varargout{1} = geometry_wrapper(38, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function Test.return_size_t');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = return_string(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_string(string value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'char')
|
if length(varargin) == 1 && isa(varargin{1},'char')
|
||||||
varargout{1} = geometry_wrapper(39, this, varargin{:});
|
varargout{1} = geometry_wrapper(39, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -277,9 +194,6 @@ classdef Test < handle
|
||||||
function varargout = return_vector1(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_vector1(Vector value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'double')
|
if length(varargin) == 1 && isa(varargin{1},'double')
|
||||||
varargout{1} = geometry_wrapper(40, this, varargin{:});
|
varargout{1} = geometry_wrapper(40, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -290,9 +204,6 @@ classdef Test < handle
|
||||||
function varargout = return_vector2(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% return_vector2(Vector value)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'double')
|
if length(varargin) == 1 && isa(varargin{1},'double')
|
||||||
varargout{1} = geometry_wrapper(41, this, varargin{:});
|
varargout{1} = geometry_wrapper(41, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
|
|
@ -40,22 +40,12 @@ classdef ClassA < handle
|
||||||
function varargout = memberFunction(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% memberFunction()
|
|
||||||
if length(varargin) == 0
|
|
||||||
varargout{1} = testNamespaces_wrapper(9, this, varargin{:});
|
varargout{1} = testNamespaces_wrapper(9, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function ns2.ClassA.memberFunction');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function varargout = nsArg(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% nsArg(ClassB arg)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'ns1.ClassB')
|
if length(varargin) == 1 && isa(varargin{1},'ns1.ClassB')
|
||||||
varargout{1} = testNamespaces_wrapper(10, this, varargin{:});
|
varargout{1} = testNamespaces_wrapper(10, this, varargin{:});
|
||||||
else
|
else
|
||||||
|
@ -66,14 +56,7 @@ classdef ClassA < handle
|
||||||
function varargout = nsReturn(this, varargin)
|
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
|
% Doxygen can be found at http://research.cc.gatech.edu/borg/sites/edu.borg/html/index.html
|
||||||
%
|
|
||||||
% Method Overloads
|
|
||||||
% nsReturn(double q)
|
|
||||||
if length(varargin) == 1 && isa(varargin{1},'double')
|
|
||||||
varargout{1} = testNamespaces_wrapper(11, this, varargin{:});
|
varargout{1} = testNamespaces_wrapper(11, this, varargin{:});
|
||||||
else
|
|
||||||
error('Arguments do not match any overload of function ns2.ClassA.nsReturn');
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -89,7 +89,7 @@ bool files_equal(const string& expected, const string& actual, bool skipheader)
|
||||||
bool equal = actual_contents == expected_contents;
|
bool equal = actual_contents == expected_contents;
|
||||||
if (!equal) {
|
if (!equal) {
|
||||||
stringstream command;
|
stringstream command;
|
||||||
command << "diff " << actual << " " << expected << endl;
|
command << "diff " << expected << " " << actual << endl;
|
||||||
system(command.str().c_str());
|
system(command.str().c_str());
|
||||||
}
|
}
|
||||||
return equal;
|
return equal;
|
||||||
|
|
Loading…
Reference in New Issue