libcopp  2.2.0
Public Types | Public Member Functions | Private Attributes | Friends
util::intrusive_ptr< T > Class Template Reference

#include <intrusive_ptr.h>

Collaboration diagram for util::intrusive_ptr< T >:
Collaboration graph

Public Types

using self_type = intrusive_ptr< T >
 
using element_type = T
 

Public Member Functions

constexpr intrusive_ptr () LIBCOPP_MACRO_NOEXCEPT
 
 intrusive_ptr (T *p, bool add_ref=true)
 
template<typename U >
 intrusive_ptr (intrusive_ptr< U > const &rhs, typename std::enable_if< std::is_convertible< U *, T * >::value >::type *=nullptr)
 
 intrusive_ptr (self_type const &rhs)
 
 ~intrusive_ptr ()
 
template<typename U >
intrusive_ptroperator= (intrusive_ptr< U > const &rhs)
 
 intrusive_ptr (self_type &&rhs) LIBCOPP_MACRO_NOEXCEPT
 
self_typeoperator= (self_type &&rhs) LIBCOPP_MACRO_NOEXCEPT
 
template<typename U >
 intrusive_ptr (intrusive_ptr< U > &&rhs, typename std::enable_if< std::is_convertible< U *, T * >::value >::type *=nullptr) LIBCOPP_MACRO_NOEXCEPT
 
template<typename U , typename Deleter >
self_typeoperator= (std::unique_ptr< U, Deleter > &&rhs)
 
self_typeoperator= (self_type const &rhs)
 
void reset () LIBCOPP_MACRO_NOEXCEPT
 
void reset (element_type *rhs)
 
void reset (element_type *rhs, bool add_ref)
 
element_typeget () const LIBCOPP_MACRO_NOEXCEPT
 
element_typedetach () LIBCOPP_MACRO_NOEXCEPT
 
element_typeoperator* () const
 
element_typeoperator-> () const
 
 operator bool () const LIBCOPP_MACRO_NOEXCEPT
 
bool operator! () const LIBCOPP_MACRO_NOEXCEPT
 
void swap (intrusive_ptr &rhs) LIBCOPP_MACRO_NOEXCEPT
 

Private Attributes

element_typepx
 

Friends

template<typename U >
class intrusive_ptr
 

Detailed Description

template<typename T>
class util::intrusive_ptr< T >

Definition at line 50 of file intrusive_ptr.h.

Member Typedef Documentation

◆ element_type

template<typename T >
using util::intrusive_ptr< T >::element_type = T

Definition at line 53 of file intrusive_ptr.h.

◆ self_type

template<typename T >
using util::intrusive_ptr< T >::self_type = intrusive_ptr<T>

Definition at line 52 of file intrusive_ptr.h.

Constructor & Destructor Documentation

◆ intrusive_ptr() [1/6]

template<typename T >
constexpr util::intrusive_ptr< T >::intrusive_ptr ( )
inlineconstexpr

Definition at line 55 of file intrusive_ptr.h.

◆ intrusive_ptr() [2/6]

template<typename T >
util::intrusive_ptr< T >::intrusive_ptr ( T *  p,
bool  add_ref = true 
)
inline

Definition at line 57 of file intrusive_ptr.h.

References util::intrusive_ptr< T >::px.

◆ intrusive_ptr() [3/6]

template<typename T >
template<typename U >
util::intrusive_ptr< T >::intrusive_ptr ( intrusive_ptr< U > const &  rhs,
typename std::enable_if< std::is_convertible< U *, T * >::value >::type *  = nullptr 
)
inline

Definition at line 64 of file intrusive_ptr.h.

References util::intrusive_ptr< T >::px.

◆ intrusive_ptr() [4/6]

template<typename T >
util::intrusive_ptr< T >::intrusive_ptr ( self_type const &  rhs)
inline

Definition at line 72 of file intrusive_ptr.h.

References util::intrusive_ptr< T >::px.

◆ ~intrusive_ptr()

template<typename T >
util::intrusive_ptr< T >::~intrusive_ptr ( )
inline

Definition at line 78 of file intrusive_ptr.h.

References util::intrusive_ptr< T >::px.

◆ intrusive_ptr() [5/6]

template<typename T >
util::intrusive_ptr< T >::intrusive_ptr ( self_type &&  rhs)
inline

Definition at line 94 of file intrusive_ptr.h.

◆ intrusive_ptr() [6/6]

template<typename T >
template<typename U >
util::intrusive_ptr< T >::intrusive_ptr ( intrusive_ptr< U > &&  rhs,
typename std::enable_if< std::is_convertible< U *, T * >::value >::type *  = nullptr 
)
inline

Definition at line 102 of file intrusive_ptr.h.

Member Function Documentation

◆ detach()

template<typename T >
element_type* util::intrusive_ptr< T >::detach ( )
inline

Definition at line 127 of file intrusive_ptr.h.

References util::intrusive_ptr< T >::px.

◆ get()

template<typename T >
element_type* util::intrusive_ptr< T >::get ( ) const
inline

◆ operator bool()

template<typename T >
util::intrusive_ptr< T >::operator bool ( ) const
inline

Definition at line 144 of file intrusive_ptr.h.

References util::intrusive_ptr< T >::px.

◆ operator!()

template<typename T >
bool util::intrusive_ptr< T >::operator! ( ) const
inline

Definition at line 146 of file intrusive_ptr.h.

References util::intrusive_ptr< T >::px.

◆ operator*()

template<typename T >
element_type& util::intrusive_ptr< T >::operator* ( ) const
inline

Definition at line 133 of file intrusive_ptr.h.

References util::intrusive_ptr< T >::px.

◆ operator->()

template<typename T >
element_type* util::intrusive_ptr< T >::operator-> ( ) const
inline

Definition at line 138 of file intrusive_ptr.h.

References util::intrusive_ptr< T >::px.

◆ operator=() [1/4]

template<typename T >
template<typename U >
intrusive_ptr& util::intrusive_ptr< T >::operator= ( intrusive_ptr< U > const &  rhs)
inline

Definition at line 88 of file intrusive_ptr.h.

◆ operator=() [2/4]

template<typename T >
self_type& util::intrusive_ptr< T >::operator= ( self_type &&  rhs)
inline

Definition at line 96 of file intrusive_ptr.h.

◆ operator=() [3/4]

template<typename T >
self_type& util::intrusive_ptr< T >::operator= ( self_type const &  rhs)
inline

Definition at line 114 of file intrusive_ptr.h.

◆ operator=() [4/4]

template<typename T >
template<typename U , typename Deleter >
self_type& util::intrusive_ptr< T >::operator= ( std::unique_ptr< U, Deleter > &&  rhs)
inline

Definition at line 109 of file intrusive_ptr.h.

◆ reset() [1/3]

template<typename T >
void util::intrusive_ptr< T >::reset ( )
inline

Definition at line 119 of file intrusive_ptr.h.

◆ reset() [2/3]

template<typename T >
void util::intrusive_ptr< T >::reset ( element_type rhs)
inline

Definition at line 121 of file intrusive_ptr.h.

◆ reset() [3/3]

template<typename T >
void util::intrusive_ptr< T >::reset ( element_type rhs,
bool  add_ref 
)
inline

Definition at line 123 of file intrusive_ptr.h.

◆ swap()

template<typename T >
void util::intrusive_ptr< T >::swap ( intrusive_ptr< T > &  rhs)
inline

Definition at line 148 of file intrusive_ptr.h.

References util::intrusive_ptr< T >::px.

Referenced by util::swap().

Friends And Related Function Documentation

◆ intrusive_ptr

template<typename T >
template<typename U >
friend class intrusive_ptr
friend

Definition at line 85 of file intrusive_ptr.h.

Field Documentation

◆ px

template<typename T >
element_type* util::intrusive_ptr< T >::px
private

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