![]() |
Home | Libraries | People | FAQ | More |
boost::interprocess::scoped_ptr
// In header: <boost/interprocess/smart_ptr/scoped_ptr.hpp> template<typename T, typename Deleter> class scoped_ptr : private { public: // types typedef ; typedef ; typedef ; typedef ; // construct/copy/destruct ( = , = ); ~(); // public member functions ( = ); (, ); () ; () ; () ; () ; () ; () ; () ; () ; (scoped_ptr &) ; };
scoped_ptr stores a pointer to a dynamically allocated object. The object pointed to is guaranteed to be deleted, either on destruction of the scoped_ptr, or via an explicit reset. The user can avoid this deletion using release(). scoped_ptr is parameterized on T (the type of the object pointed to) and Deleter (the functor to be executed to delete the internal pointer). The internal pointer will be of the same pointer type as typename Deleter::pointer type (that is, if typename Deleter::pointer is offset_ptr<void>, the internal pointer will be offset_ptr<T>).
scoped_ptr
public
construct/copy/destruct( p = , d = );
Constructs a scoped_ptr
, storing a copy of p(which can be 0) and d. Does not throw.
~();
If the stored pointer is not 0, destroys the object pointed to by the stored pointer. calling the operator() of the stored deleter. Never throws
scoped_ptr
public member functions( p = );
Deletes the object pointed to by the stored pointer and then stores a copy of p. Never throws
( p, d);
Deletes the object pointed to by the stored pointer and then stores a copy of p and a copy of d.
() ;
Assigns internal pointer as 0 and returns previous pointer. This will avoid deletion on destructor
() ;
Returns a reference to the object pointed to by the stored pointer. Never throws.
() ;
Returns the internal stored pointer. Never throws.
() ;
Returns the internal stored pointer. Never throws.
() ;
Returns the stored pointer. Never throws.
() ;
Returns the stored pointer. Never throws.
() ;
Conversion to bool Never throws
() ;
Returns true if the stored pointer is 0. Never throws.
(scoped_ptr & b) ;
Exchanges the internal pointer and deleter with other scoped_ptr
Never throws.