Add shared_ptr test to regular test-suite

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10262 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2008-02-14 23:07:30 +00:00
commit f0a4145cb3
2 changed files with 14 additions and 1 deletions

View file

@ -177,6 +177,7 @@ CPP_TEST_CASES += \
kind \
langobj \
li_attribute \
li_boost_shared_ptr \
li_carrays \
li_cdata \
li_cpointer \

View file

@ -29,11 +29,19 @@
#ifndef SHARED_PTR_WRAPPER
# define SWIG_SHARED_PTR_NAMESPACE SwigBoost
#endif
%include "boost_shared_ptr.i"
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGPYTHON)
#define SHARED_PTR_WRAPPERS_IMPLEMENTED
#endif
#if defined(SHARED_PTR_WRAPPERS_IMPLEMENTED)
%include "boost_shared_ptr.i"
SWIG_SHARED_PTR(Klass, Space::Klass)
SWIG_SHARED_PTR_DERIVED(KlassDerived, Space::Klass, Space::KlassDerived)
#endif
// TODO:
// const shared_ptr
// std::vector
@ -273,12 +281,16 @@ struct MemberVariables {
};
%}
#if defined(SHARED_PTR_WRAPPERS_IMPLEMENTED)
// Note: %template after the shared_ptr typemaps
SWIG_SHARED_PTR(BaseIntDouble, Base<int, double>)
// Note: cannot use Base<int, double> in the macro below because of the comma in the type,
// so we use a typedef instead. Alternatively use %arg(Base<int, double>). %arg is defined in swigmacros.swg.
SWIG_SHARED_PTR_DERIVED(PairIntDouble, BaseIntDouble_t, Pair<int, double>)
#endif
// Templates
%inline %{
template <class T1, class T2> struct Base {