libcaf  0.14.4
Public Types | Public Member Functions | Related Functions | List of all members
caf::intrusive_ptr< T > Class Template Reference

An intrusive, reference counting smart pointer impelementation. More...

#include <intrusive_ptr.hpp>

Inherits comparable< intrusive_ptr< T > >, comparable< intrusive_ptr< T >, const T * >, and comparable< intrusive_ptr< T >, std::nullptr_t >.

Public Types

using pointer = T *
 
using const_pointer = const T *
 
using element_type = T
 
using reference = T &
 
using const_reference = const T &
 

Public Member Functions

 intrusive_ptr (pointer raw_ptr, bool add_ref=true)
 
 intrusive_ptr (intrusive_ptr &&other)
 
 intrusive_ptr (const intrusive_ptr &other)
 
template<class Y >
 intrusive_ptr (intrusive_ptr< Y > other)
 
void swap (intrusive_ptr &other) noexcept
 
pointer detach () noexcept
 Returns the raw pointer without modifying reference count and sets this to nullptr. More...
 
pointer release () noexcept
 Returns the raw pointer without modifying reference count and sets this to nullptr. More...
 
void reset (pointer new_value=nullptr, bool add_ref=true)
 
template<class... Ts>
void emplace (Ts &&...xs)
 
intrusive_ptroperator= (pointer ptr)
 
intrusive_ptroperator= (intrusive_ptr &&other)
 
intrusive_ptroperator= (const intrusive_ptr &other)
 
template<class Y >
intrusive_ptroperator= (intrusive_ptr< Y > other)
 
pointer get () const
 
pointer operator-> () const
 
reference operator* () const
 
bool operator! () const
 
 operator bool () const
 
ptrdiff_t compare (const_pointer ptr) const
 
ptrdiff_t compare (const intrusive_ptr &other) const
 
ptrdiff_t compare (std::nullptr_t) const
 
template<class C >
intrusive_ptr< C > downcast () const
 
template<class C >
intrusive_ptr< C > upcast () const
 

Related Functions

(Note that these are not member functions.)

template<class X , typename Y >
bool operator== (const intrusive_ptr< X > &lhs, const intrusive_ptr< Y > &rhs)
 
template<class X , typename Y >
bool operator!= (const intrusive_ptr< X > &lhs, const intrusive_ptr< Y > &rhs)
 

Detailed Description

template<class T>
class caf::intrusive_ptr< T >

An intrusive, reference counting smart pointer impelementation.

Member Function Documentation

template<class T>
pointer caf::intrusive_ptr< T >::detach ( )
noexcept

Returns the raw pointer without modifying reference count and sets this to nullptr.

template<class T>
pointer caf::intrusive_ptr< T >::release ( )
noexcept

Returns the raw pointer without modifying reference count and sets this to nullptr.

Friends And Related Function Documentation

template<class X , typename Y >
bool operator!= ( const intrusive_ptr< X > &  lhs,
const intrusive_ptr< Y > &  rhs 
)
related
template<class X , typename Y >
bool operator== ( const intrusive_ptr< X > &  lhs,
const intrusive_ptr< Y > &  rhs 
)
related

The documentation for this class was generated from the following files: