scoped_ptr stores a pointer to a dynamically allocated object. More...
#include <scoped_ptr.hpp>
Public Types | |
typedef T | element_type |
typedef Deleter | deleter_type |
typedef ipcdetail::pointer_type< T, Deleter >::type | pointer |
typedef pointer this_type::* | unspecified_bool_type |
Public Member Functions | |
scoped_ptr (const pointer &p=0, const Deleter &d=Deleter()) | |
Constructs a scoped_ptr, storing a copy of p(which can be 0) and d. More... | |
~scoped_ptr () | |
If the stored pointer is not 0, destroys the object pointed to by the stored pointer. More... | |
void | reset (const pointer &p=0) |
Deletes the object pointed to by the stored pointer and then stores a copy of p. More... | |
void | reset (const pointer &p, const Deleter &d) |
Deletes the object pointed to by the stored pointer and then stores a copy of p and a copy of d. More... | |
pointer | release () |
Assigns internal pointer as 0 and returns previous pointer. More... | |
reference | operator* () const |
Returns a reference to the object pointed to by the stored pointer. More... | |
pointer & | operator-> () |
Returns the internal stored pointer. More... | |
const pointer & | operator-> () const |
Returns the internal stored pointer. More... | |
pointer & | get () |
Returns the stored pointer. More... | |
const pointer & | get () const |
Returns the stored pointer. More... | |
operator unspecified_bool_type () const | |
Conversion to bool Never throws. More... | |
bool | operator! () const |
Returns true if the stored pointer is 0. More... | |
void | swap (scoped_ptr &b) |
Exchanges the internal pointer and deleter with other scoped_ptr Never throws. More... | |
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>).
typedef Deleter boost::interprocess::scoped_ptr< T, Deleter >::deleter_type |
typedef T boost::interprocess::scoped_ptr< T, Deleter >::element_type |
typedef ipcdetail::pointer_type<T, Deleter>::type boost::interprocess::scoped_ptr< T, Deleter >::pointer |
typedef pointer this_type::* boost::interprocess::scoped_ptr< T, Deleter >::unspecified_bool_type |
|
inlineexplicit |
Constructs a scoped_ptr, storing a copy of p(which can be 0) and d.
Does not throw.
|
inline |
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
References boost::python::api::del().
|
inline |
Returns the stored pointer.
Never throws.
|
inline |
Returns the stored pointer.
Never throws.
|
inline |
Conversion to bool Never throws.
|
inline |
Returns true if the stored pointer is 0.
Never throws.
|
inline |
Returns a reference to the object pointed to by the stored pointer.
Never throws.
References BOOST_ASSERT.
|
inline |
|
inline |
|
inline |
Assigns internal pointer as 0 and returns previous pointer.
This will avoid deletion on destructor
|
inline |
Deletes the object pointed to by the stored pointer and then stores a copy of p.
Never throws
References BOOST_ASSERT, and boost::multiprecision::backends::p.
|
inline |
Deletes the object pointed to by the stored pointer and then stores a copy of p and a copy of d.
References BOOST_ASSERT.
|
inline |
Exchanges the internal pointer and deleter with other scoped_ptr Never throws.
References boost::asio::b.