Skip to content

Commit 31459d0

Browse files
committed
[ruby] use boost/shared_ptr and boost_shared_ptr.i. not use auto.
1 parent 6672338 commit 31459d0

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Examples/test-suite/cpp11_shared_ptr_director.i

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
%module(directors="1") "cpp11_shared_ptr_director"
22

33
%{
4-
#include <memory>
4+
#include <boost/shared_ptr.hpp>
55
%}
66

7-
%include "std_shared_ptr.i";
7+
%include "boost_shared_ptr.i";
88
%shared_ptr(C);
99
%feature("director") Base;
1010

@@ -18,18 +18,18 @@ struct C {
1818

1919
struct Base {
2020
Base() {};
21-
virtual std::shared_ptr<C> ret_c_shared_ptr() = 0;
21+
virtual boost::shared_ptr<C> ret_c_shared_ptr() = 0;
2222
virtual C ret_c_by_value() = 0;
2323
virtual int take_c_by_value(C c) = 0;
24-
virtual int take_c_shared_ptr_by_value(std::shared_ptr<C> c) = 0;
25-
virtual int take_c_shared_ptr_by_ref(std::shared_ptr<C>& c) = 0;
26-
virtual int take_c_shared_ptr_by_pointer(std::shared_ptr<C>* c) = 0;
27-
virtual int take_c_shared_ptr_by_pointer_ref(std::shared_ptr<C>*const&c) = 0;
24+
virtual int take_c_shared_ptr_by_value(boost::shared_ptr<C> c) = 0;
25+
virtual int take_c_shared_ptr_by_ref(boost::shared_ptr<C>& c) = 0;
26+
virtual int take_c_shared_ptr_by_pointer(boost::shared_ptr<C>* c) = 0;
27+
virtual int take_c_shared_ptr_by_pointer_ref(boost::shared_ptr<C>*const&c) = 0;
2828
virtual ~Base() {}
2929
};
3030

3131
int call_ret_c_shared_ptr(Base* b) {
32-
std::shared_ptr<C> ptr = b->ret_c_shared_ptr();
32+
boost::shared_ptr<C> ptr = b->ret_c_shared_ptr();
3333
if (ptr) {
3434
return ptr->get_m();
3535
} else {
@@ -48,42 +48,42 @@ int call_take_c_by_value(Base* b) {
4848
}
4949

5050
int call_take_c_shared_ptr_by_value(Base* b) {
51-
std::shared_ptr<C> ptr(new C(6));
51+
boost::shared_ptr<C> ptr(new C(6));
5252
return b->take_c_shared_ptr_by_value(ptr);
5353
}
5454

5555
int call_take_c_shared_ptr_by_value_with_null(Base* b) {
56-
std::shared_ptr<C> ptr;
56+
boost::shared_ptr<C> ptr;
5757
return b->take_c_shared_ptr_by_value(ptr);
5858
}
5959

6060
int call_take_c_shared_ptr_by_ref(Base* b) {
61-
std::shared_ptr<C> ptr(new C(7));
61+
boost::shared_ptr<C> ptr(new C(7));
6262
return b->take_c_shared_ptr_by_ref(ptr);
6363
}
6464

6565
int call_take_c_shared_ptr_by_ref_with_null(Base* b) {
66-
std::shared_ptr<C> ptr;
66+
boost::shared_ptr<C> ptr;
6767
return b->take_c_shared_ptr_by_ref(ptr);
6868
}
6969

7070
int call_take_c_shared_ptr_by_pointer(Base* b) {
71-
std::shared_ptr<C> ptr(new C(8));
71+
boost::shared_ptr<C> ptr(new C(8));
7272
return b->take_c_shared_ptr_by_pointer(&ptr);
7373
}
7474

7575
int call_take_c_shared_ptr_by_pointer_with_null(Base* b) {
76-
std::shared_ptr<C> ptr;
76+
boost::shared_ptr<C> ptr;
7777
return b->take_c_shared_ptr_by_pointer(&ptr);
7878
}
7979

8080
int call_take_c_shared_ptr_by_pointer_ref(Base* b) {
81-
auto ptr = new std::shared_ptr<C>(new C(9));
81+
boost::shared_ptr<C> *ptr = new boost::shared_ptr<C>(new C(9));
8282
return b->take_c_shared_ptr_by_pointer_ref(ptr);
8383
}
8484

8585
int call_take_c_shared_ptr_by_pointer_ref_with_null(Base* b) {
86-
auto ptr = new std::shared_ptr<C>();
86+
boost::shared_ptr<C> *ptr = new boost::shared_ptr<C>();
8787
return b->take_c_shared_ptr_by_pointer_ref(ptr);
8888
}
8989

0 commit comments

Comments
 (0)