Add missing intrusive_ptr csvarout typemaps for C#

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12807 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2011-09-13 22:35:14 +00:00
commit 2aeed2fd48
3 changed files with 25 additions and 2 deletions

View file

@ -22,7 +22,8 @@ CPP_TEST_CASES = \
enum_thorough_simple \
enum_thorough_typesafe \
exception_partial_info \
intermediary_classname
intermediary_classname \
li_boost_intrusive_ptr
include $(srcdir)/../common.mk

View file

@ -10,6 +10,8 @@
%module li_boost_intrusive_ptr
%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK);
%warnfilter(SWIGWARN_LANG_SMARTPTR_MISSING) KlassDerived;
%warnfilter(SWIGWARN_LANG_SMARTPTR_MISSING) KlassDerivedDerived;
%inline %{
#include "boost/shared_ptr.hpp"
@ -37,7 +39,7 @@
# define SWIG_SHARED_PTR_NAMESPACE SwigBoost
#endif
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGPYTHON)
#if defined(SWIGJAVA) || defined(SWIGCSHARP)
#define INTRUSIVE_PTR_WRAPPERS_IMPLEMENTED
#endif
@ -50,6 +52,7 @@
%intrusive_ptr(Space::KlassDerivedDerived)
//For the use_count shared_ptr functions
#if defined(SWIGJAVA)
%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::shared_ptr< Space::Klass > & ($*1_ltype tempnull) %{
$1 = $input ? *($&1_ltype)&$input : &tempnull;
%}
@ -74,6 +77,10 @@
%typemap (jstype) SWIG_INTRUSIVE_PTR_QNAMESPACE::shared_ptr< Space::KlassDerivedDerived > & "KlassDerivedDerived"
%typemap(javain) SWIG_INTRUSIVE_PTR_QNAMESPACE::shared_ptr< Space::KlassDerivedDerived > & "KlassDerivedDerived.getCPtr($javainput)"
#elif defined(SWIGCSHARP)
// TODO!
#endif
#endif
// TODO:

View file

@ -239,6 +239,21 @@
$typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
return ret;
}
%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{
get {
$typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode
return ret;
} %}
%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >& %{
get {
$typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode
return ret;
} %}
%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >* %{
get {
$typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode
return ret;
} %}
%typemap(csout, excode=SWIGEXCODE) CONST TYPE {