diff options
Diffstat (limited to 'gnuradio-core/src/lib/swig/shared_ptr.i')
-rw-r--r-- | gnuradio-core/src/lib/swig/shared_ptr.i | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/swig/shared_ptr.i b/gnuradio-core/src/lib/swig/shared_ptr.i new file mode 100644 index 0000000000..9663033ae7 --- /dev/null +++ b/gnuradio-core/src/lib/swig/shared_ptr.i @@ -0,0 +1,43 @@ +// +// shared_ptr +// +// An enhanced relative of scoped_ptr with reference counted copy semantics. +// The object pointed to is deleted when the last shared_ptr pointing to it +// is destroyed or reset. +// + +// +// This is highly hacked up version of boost::shared_ptr +// We just need enough to get SWIG to "do the right thing" and +// generate "Smart Pointer" code. +// + +namespace boost { + +template<class T> class shared_ptr +{ +public: + + shared_ptr() + { + } + + shared_ptr (T * p) + { + } + + + T * operator-> () // never throws + { + return px; + } + + +private: + + T * px; // contained pointer + int pn; + +}; // shared_ptr + +};
\ No newline at end of file |