actor-framework
Public Types | Public Member Functions | Static Public Attributes | Friends | Related Functions | List of all members
caf::intrusive_ptr< T > Class Template Reference

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

#include <intrusive_ptr.hpp>

Public Types

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

Public Member Functions

constexpr intrusive_ptr (std::nullptr_t) noexcept
 
 intrusive_ptr (pointer raw_ptr, bool add_ref=true) noexcept
 
 intrusive_ptr (intrusive_ptr &&other) noexcept
 
 intrusive_ptr (const intrusive_ptr &other) noexcept
 
template<class Y >
 intrusive_ptr (intrusive_ptr< Y > other) noexcept
 
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) noexcept
 
template<class... Ts>
void emplace (Ts &&... xs)
 
intrusive_ptroperator= (pointer ptr) noexcept
 
intrusive_ptroperator= (intrusive_ptr &&other) noexcept
 
intrusive_ptroperator= (const intrusive_ptr &other) noexcept
 
pointer get () const noexcept
 
pointer operator-> () const noexcept
 
reference operator* () const noexcept
 
bool operator! () const noexcept
 
 operator bool () const noexcept
 
ptrdiff_t compare (const_pointer ptr) const noexcept
 
ptrdiff_t compare (const intrusive_ptr &other) const noexcept
 
ptrdiff_t compare (std::nullptr_t) const noexcept
 
template<class C >
intrusive_ptr< C > downcast () const noexcept
 
template<class C >
intrusive_ptr< C > upcast () const &noexcept
 
template<class C >
intrusive_ptr< C > upcast () &&noexcept
 

Static Public Attributes

static constexpr bool has_weak_ptr_semantics = false
 

Friends

template<class >
class intrusive_cow_ptr
 

Related Functions

(Note that these are not member functions.)

template<class T >
bool operator== (const intrusive_ptr< T > &x, std::nullptr_t)
 
template<class T >
bool operator== (std::nullptr_t, const intrusive_ptr< T > &x)
 
template<class T >
bool operator!= (const intrusive_ptr< T > &x, std::nullptr_t)
 
template<class T >
bool operator!= (std::nullptr_t, const intrusive_ptr< T > &x)
 
template<class T , class U >
std::enable_if_t< detail::is_comparable< T *, U *>::value, bool > operator== (const intrusive_ptr< T > &lhs, const U *rhs)
 
template<class T , class U >
std::enable_if_t< detail::is_comparable< T *, U *>::value, bool > operator== (const T *lhs, const intrusive_ptr< U > &rhs)
 
template<class T , class U >
std::enable_if_t< detail::is_comparable< T *, U *>::value, bool > operator!= (const intrusive_ptr< T > &lhs, const U *rhs)
 
template<class T , class U >
std::enable_if_t< detail::is_comparable< T *, U *>::value, bool > operator!= (const T *lhs, const intrusive_ptr< U > &rhs)
 
template<class T , class U >
std::enable_if_t< detail::is_comparable_v< T *, U *>, bool > operator== (const intrusive_ptr< T > &x, const intrusive_ptr< U > &y)
 
template<class T , class U >
std::enable_if_t< detail::is_comparable_v< T *, U *>, bool > operator!= (const intrusive_ptr< T > &x, const intrusive_ptr< U > &y)
 
template<class T >
bool operator< (const intrusive_ptr< T > &x, const intrusive_ptr< T > &y)
 
template<class T >
bool operator< (const intrusive_ptr< T > &x, const T *y)
 
template<class T >
bool operator< (const T *x, const intrusive_ptr< T > &y)
 

Detailed Description

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

An intrusive, reference counting smart pointer implementation.

Member Function Documentation

◆ detach()

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

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

◆ release()

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

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

Friends And Related Function Documentation

◆ operator!=() [1/5]

template<class T >
bool operator!= ( const intrusive_ptr< T > &  x,
std::nullptr_t   
)
related

◆ operator!=() [2/5]

template<class T >
bool operator!= ( std::nullptr_t  ,
const intrusive_ptr< T > &  x 
)
related

◆ operator!=() [3/5]

template<class T , class U >
std::enable_if_t< detail::is_comparable< T *, U * >::value, bool > operator!= ( const intrusive_ptr< T > &  lhs,
const U *  rhs 
)
related

◆ operator!=() [4/5]

template<class T , class U >
std::enable_if_t< detail::is_comparable< T *, U * >::value, bool > operator!= ( const T *  lhs,
const intrusive_ptr< U > &  rhs 
)
related

◆ operator!=() [5/5]

template<class T , class U >
std::enable_if_t< detail::is_comparable_v< T *, U * >, bool > operator!= ( const intrusive_ptr< T > &  x,
const intrusive_ptr< U > &  y 
)
related

◆ operator<() [1/3]

template<class T >
bool operator< ( const intrusive_ptr< T > &  x,
const intrusive_ptr< T > &  y 
)
related

◆ operator<() [2/3]

template<class T >
bool operator< ( const intrusive_ptr< T > &  x,
const T *  y 
)
related

◆ operator<() [3/3]

template<class T >
bool operator< ( const T *  x,
const intrusive_ptr< T > &  y 
)
related

◆ operator==() [1/5]

template<class T >
bool operator== ( const intrusive_ptr< T > &  x,
std::nullptr_t   
)
related

◆ operator==() [2/5]

template<class T >
bool operator== ( std::nullptr_t  ,
const intrusive_ptr< T > &  x 
)
related

◆ operator==() [3/5]

template<class T , class U >
std::enable_if_t< detail::is_comparable< T *, U * >::value, bool > operator== ( const intrusive_ptr< T > &  lhs,
const U *  rhs 
)
related

◆ operator==() [4/5]

template<class T , class U >
std::enable_if_t< detail::is_comparable< T *, U * >::value, bool > operator== ( const T *  lhs,
const intrusive_ptr< U > &  rhs 
)
related

◆ operator==() [5/5]

template<class T , class U >
std::enable_if_t< detail::is_comparable_v< T *, U * >, bool > operator== ( const intrusive_ptr< T > &  x,
const intrusive_ptr< U > &  y 
)
related

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