Imported Upstream version 3.0
[debian/gnuradio] / gnuradio-core / src / lib / swig / shared_ptr.i
1 //
2 //  shared_ptr
3 //
4 //  An enhanced relative of scoped_ptr with reference counted copy semantics.
5 //  The object pointed to is deleted when the last shared_ptr pointing to it
6 //  is destroyed or reset.
7 //
8
9 //
10 // This is highly hacked up version of boost::shared_ptr
11 // We just need enough to get SWIG to "do the right thing" and
12 // generate "Smart Pointer" code.
13 //
14
15 namespace boost {
16
17 template<class T> class shared_ptr
18 {
19 public:
20
21     shared_ptr()
22     {
23     }
24
25     shared_ptr (T * p)
26     {
27     }
28
29
30     T * operator-> () // never throws
31     {
32         return px;
33     }
34     
35
36 private:
37
38     T * px;                     // contained pointer
39     int pn;
40
41 };  // shared_ptr
42
43 };