From 31459d0cc070c294e6f7465ef68b262c634bbdbd Mon Sep 17 00:00:00 2001 From: Takashi Tamura Date: Fri, 21 Apr 2017 22:56:13 +0900 Subject: [ruby] use boost/shared_ptr and boost_shared_ptr.i. not use auto. --- Examples/test-suite/cpp11_shared_ptr_director.i | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'Examples') diff --git a/Examples/test-suite/cpp11_shared_ptr_director.i b/Examples/test-suite/cpp11_shared_ptr_director.i index 0f0554134..0a8a2494f 100644 --- a/Examples/test-suite/cpp11_shared_ptr_director.i +++ b/Examples/test-suite/cpp11_shared_ptr_director.i @@ -1,10 +1,10 @@ %module(directors="1") "cpp11_shared_ptr_director" %{ -#include +#include %} -%include "std_shared_ptr.i"; +%include "boost_shared_ptr.i"; %shared_ptr(C); %feature("director") Base; @@ -18,18 +18,18 @@ struct C { struct Base { Base() {}; - virtual std::shared_ptr ret_c_shared_ptr() = 0; + virtual boost::shared_ptr ret_c_shared_ptr() = 0; virtual C ret_c_by_value() = 0; virtual int take_c_by_value(C c) = 0; - virtual int take_c_shared_ptr_by_value(std::shared_ptr c) = 0; - virtual int take_c_shared_ptr_by_ref(std::shared_ptr& c) = 0; - virtual int take_c_shared_ptr_by_pointer(std::shared_ptr* c) = 0; - virtual int take_c_shared_ptr_by_pointer_ref(std::shared_ptr*const&c) = 0; + virtual int take_c_shared_ptr_by_value(boost::shared_ptr c) = 0; + virtual int take_c_shared_ptr_by_ref(boost::shared_ptr& c) = 0; + virtual int take_c_shared_ptr_by_pointer(boost::shared_ptr* c) = 0; + virtual int take_c_shared_ptr_by_pointer_ref(boost::shared_ptr*const&c) = 0; virtual ~Base() {} }; int call_ret_c_shared_ptr(Base* b) { - std::shared_ptr ptr = b->ret_c_shared_ptr(); + boost::shared_ptr ptr = b->ret_c_shared_ptr(); if (ptr) { return ptr->get_m(); } else { @@ -48,42 +48,42 @@ int call_take_c_by_value(Base* b) { } int call_take_c_shared_ptr_by_value(Base* b) { - std::shared_ptr ptr(new C(6)); + boost::shared_ptr ptr(new C(6)); return b->take_c_shared_ptr_by_value(ptr); } int call_take_c_shared_ptr_by_value_with_null(Base* b) { - std::shared_ptr ptr; + boost::shared_ptr ptr; return b->take_c_shared_ptr_by_value(ptr); } int call_take_c_shared_ptr_by_ref(Base* b) { - std::shared_ptr ptr(new C(7)); + boost::shared_ptr ptr(new C(7)); return b->take_c_shared_ptr_by_ref(ptr); } int call_take_c_shared_ptr_by_ref_with_null(Base* b) { - std::shared_ptr ptr; + boost::shared_ptr ptr; return b->take_c_shared_ptr_by_ref(ptr); } int call_take_c_shared_ptr_by_pointer(Base* b) { - std::shared_ptr ptr(new C(8)); + boost::shared_ptr ptr(new C(8)); return b->take_c_shared_ptr_by_pointer(&ptr); } int call_take_c_shared_ptr_by_pointer_with_null(Base* b) { - std::shared_ptr ptr; + boost::shared_ptr ptr; return b->take_c_shared_ptr_by_pointer(&ptr); } int call_take_c_shared_ptr_by_pointer_ref(Base* b) { - auto ptr = new std::shared_ptr(new C(9)); + boost::shared_ptr *ptr = new boost::shared_ptr(new C(9)); return b->take_c_shared_ptr_by_pointer_ref(ptr); } int call_take_c_shared_ptr_by_pointer_ref_with_null(Base* b) { - auto ptr = new std::shared_ptr(); + boost::shared_ptr *ptr = new boost::shared_ptr(); return b->take_c_shared_ptr_by_pointer_ref(ptr); } -- cgit v1.2.1