|
Miosix
2.0alpha1
|
#include <intrusive.h>
Public Types | |
| typedef T | element_type |
| As shared_ptr, expose the managed type. | |
Public Member Functions | |
| intrusive_ref_ptr () | |
| intrusive_ref_ptr (T *o) | |
| template<typename U > | |
| intrusive_ref_ptr (U *o) | |
| intrusive_ref_ptr (const intrusive_ref_ptr &rhs) | |
| template<typename U > | |
| intrusive_ref_ptr (const intrusive_ref_ptr< U > &rhs) | |
| intrusive_ref_ptr & | operator= (const intrusive_ref_ptr &rhs) |
| template<typename U > | |
| intrusive_ref_ptr & | operator= (const intrusive_ref_ptr< U > &rhs) |
| intrusive_ref_ptr & | operator= (T *o) |
| T * | get () const |
| T & | operator* () const |
| T * | operator-> () const |
| operator SafeBool () const | |
| void | swap (intrusive_ref_ptr &rhs) |
| void | reset () |
| int | use_count () const |
| ~intrusive_ref_ptr () | |
Reference counted pointer to intrusively reference counted objects. This class is made in a way to resemble the shared_ptr class, as specified in chapter 20.7.2.2 of the C++11 standard.
Thread safety of this class is the same as shared_ptr. The reference count is updated using atomic operations, but this does not make all kind of concurrent access to the same intrusive_ref_ptr safe. A good reference that explains why is www.drdobbs.com/cpp/a-base-class-for-intrusively-reference-c/229218807?pgno=3
| T | type to which the object points |
|
inline |
Default constructor
|
inlineexplicit |
Constructor, with raw pointer
| object | object to manage |
|
inlineexplicit |
Generalized constructor, with raw pointer
| object | object to manage |
|
inline |
Copy constructor, with same type of managed pointer
| rhs | object to manage |
|
inline |
Generalized copy constructor, to support upcast among refcounted pointers
| rhs | object to manage |
|
inline |
Destructor
|
inline |
|
inline |
|
inline |
|
inline |
Allows this class to behave like the managed type
| intrusive_ref_ptr< T > & miosix::intrusive_ref_ptr< T >::operator= | ( | const intrusive_ref_ptr< T > & | rhs | ) |
Operator=, with same type of managed pointer
| rhs | object to manage |
| intrusive_ref_ptr& miosix::intrusive_ref_ptr< T >::operator= | ( | const intrusive_ref_ptr< U > & | rhs | ) |
Generalized perator=, to support upcast among refcounted pointers
| rhs | object to manage |
| intrusive_ref_ptr< T > & miosix::intrusive_ref_ptr< T >::operator= | ( | T * | o | ) |
Operator=, with raw pointer
| rhs | object to manage |
|
inline |
After a call to this member function, this intrusive_ref_ptr no longer points to the managed object. The managed object is deleted if this was the only pointer at it
|
inline |
Swap the managed object with another intrusive_ref_ptr
| rhs | the other smart pointer |
|
inline |