wrap: forward declarations now allow for namespaces

release/4.3a0
Alex Cunningham 2012-02-01 15:19:34 +00:00
parent f34b1cd1eb
commit c901ceee27
5 changed files with 33 additions and 12 deletions

View File

@ -1896,6 +1896,30 @@
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="check install j5" path="build_cmake" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>check install</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="check install" path="build_cmake" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>check install</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="wrap.testWrap.run" path="build_cmake" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>wrap.testWrap.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests/testDSFVector.run" path="build/gtsam/base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>

View File

@ -18,13 +18,8 @@ install(FILES matlab.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/wrap)
if (GTSAM_LINK_BINARIES_AGAINST_CONVENIENCE_LIBS)
set(convenience_libs
slam
nonlinear
linear
inference
geometry
base
ccolamd)
)
else (GTSAM_LINK_BINARIES_AGAINST_CONVENIENCE_LIBS)
set(convenience_libs
gtsam-static)

View File

@ -25,7 +25,6 @@
#include <boost/foreach.hpp>
#include <iostream>
//#include <fstream>
using namespace std;
using namespace wrap;
@ -98,7 +97,7 @@ Module::Module(const string& interfacePath,
Rule classArg_p =
!str_p("const") [assign_a(arg.is_const,true)] >>
*namespace_arg_p >>
className_p [assign_a(arg.type)] >>
className_p[assign_a(arg.type)] >>
(ch_p('*')[assign_a(arg.is_ptr,true)] | ch_p('&')[assign_a(arg.is_ref,true)]);
Rule name_p = lexeme_d[alpha_p >> *(alnum_p | '_')];
@ -199,10 +198,12 @@ Module::Module(const string& interfacePath,
str_p("using") >> str_p("namespace")
>> namespace_name_p[push_back_a(using_namespaces)] >> ch_p(';');
Rule forward_delcaration_p =
(str_p("class") >> className_p >> ch_p(';'))[push_back_a(forward_declarations, class_name)];
Rule forward_declaration_p =
str_p("class") >>
(*(namespace_name_p >> str_p("::")) >> className_p)[push_back_a(forward_declarations)]
>> ch_p(';');
Rule module_content_p = comments_p | using_namespace_p | forward_delcaration_p | class_p | namespace_def_p ;
Rule module_content_p = comments_p | using_namespace_p | class_p | forward_declaration_p | namespace_def_p ;
Rule module_p = *module_content_p >> !end_p;

View File

@ -5,6 +5,7 @@
using namespace geometry;
class VectorNotEigen;
class ns::OtherClass;
class Point2 {
Point2();

View File

@ -76,7 +76,7 @@ TEST( wrap, parse ) {
EXPECT(assert_equal(exp_using, module.using_namespaces));
// forward declarations
strvec exp_forward; exp_forward += "VectorNotEigen";
strvec exp_forward; exp_forward += "VectorNotEigen", "ns::OtherClass";
EXPECT(assert_equal(exp_forward, module.forward_declarations));
// check first class, Point2