proxygen
folly::DelayedDestructionBase::IntrusivePtr< AliasType > Class Template Reference

#include <DelayedDestructionBase.h>

Inheritance diagram for folly::DelayedDestructionBase::IntrusivePtr< AliasType >:
folly::DelayedDestructionBase::DestructorGuard

Public Member Functions

 IntrusivePtr ()=default
 
 IntrusivePtr (const IntrusivePtr &)=default
 
 IntrusivePtr (IntrusivePtr &&) noexcept=default
 
template<typename CopyAliasType , typename = typename std::enable_if< std::is_convertible<CopyAliasType*, AliasType*>::value>::type>
 IntrusivePtr (const IntrusivePtr< CopyAliasType > &copy)
 
template<typename CopyAliasType , typename = typename std::enable_if< std::is_convertible<CopyAliasType*, AliasType*>::value>::type>
 IntrusivePtr (IntrusivePtr< CopyAliasType > &&copy)
 
 IntrusivePtr (AliasType *dd)
 
template<typename CopyAliasType , typename Deleter , typename = typename std::enable_if< std::is_convertible<CopyAliasType*, AliasType*>::value>::type>
 IntrusivePtr (const std::unique_ptr< CopyAliasType, Deleter > &copy)
 
IntrusivePtroperator= (const IntrusivePtr &)=default
 
IntrusivePtroperator= (IntrusivePtr &&) noexcept=default
 
template<typename CopyAliasType , typename = typename std::enable_if< std::is_convertible<CopyAliasType*, AliasType*>::value>::type>
IntrusivePtroperator= (IntrusivePtr< CopyAliasType > copy) noexcept
 
IntrusivePtroperator= (AliasType *dd)
 
void reset (AliasType *dd=nullptr)
 
AliasType * get () const
 
AliasType & operator* () const
 
AliasType * operator-> () const
 
 operator bool () const
 

Static Public Member Functions

template<typename... Args>
static IntrusivePtr< AliasType > make (Args &&...args)
 

Friends

template<typename CopyAliasType >
class IntrusivePtr
 

Additional Inherited Members

- Private Member Functions inherited from folly::DelayedDestructionBase::DestructorGuard
 DestructorGuard (DelayedDestructionBase *dd)
 
 DestructorGuard (const DestructorGuard &dg)
 
 DestructorGuard (DestructorGuard &&dg) noexcept
 
DestructorGuardoperator= (DestructorGuard dg) noexcept
 
DestructorGuardoperator= (DelayedDestructionBase *dd)
 
 ~DestructorGuard ()
 
DelayedDestructionBaseget () const
 
 operator bool () const
 

Detailed Description

template<typename AliasType>
class folly::DelayedDestructionBase::IntrusivePtr< AliasType >

This smart pointer is a convenient way to manage a concrete DelayedDestructorBase child. It can replace the equivalent raw pointer and provide automatic memory management.

Definition at line 114 of file DelayedDestructionBase.h.

Constructor & Destructor Documentation

template<typename AliasType>
folly::DelayedDestructionBase::IntrusivePtr< AliasType >::IntrusivePtr ( )
default
template<typename AliasType>
folly::DelayedDestructionBase::IntrusivePtr< AliasType >::IntrusivePtr ( const IntrusivePtr< AliasType > &  )
default
template<typename AliasType>
folly::DelayedDestructionBase::IntrusivePtr< AliasType >::IntrusivePtr ( IntrusivePtr< AliasType > &&  )
defaultnoexcept
template<typename AliasType>
template<typename CopyAliasType , typename = typename std::enable_if< std::is_convertible<CopyAliasType*, AliasType*>::value>::type>
folly::DelayedDestructionBase::IntrusivePtr< AliasType >::IntrusivePtr ( const IntrusivePtr< CopyAliasType > &  copy)
inline

Definition at line 132 of file DelayedDestructionBase.h.

References type, and value.

133  : DestructorGuard(copy) {}
constexpr std::decay< T >::type copy(T &&value) noexcept(noexcept(typename std::decay< T >::type(std::forward< T >(value))))
Definition: Utility.h:72
template<typename AliasType>
template<typename CopyAliasType , typename = typename std::enable_if< std::is_convertible<CopyAliasType*, AliasType*>::value>::type>
folly::DelayedDestructionBase::IntrusivePtr< AliasType >::IntrusivePtr ( IntrusivePtr< CopyAliasType > &&  copy)
inline

Definition at line 139 of file DelayedDestructionBase.h.

constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
constexpr std::decay< T >::type copy(T &&value) noexcept(noexcept(typename std::decay< T >::type(std::forward< T >(value))))
Definition: Utility.h:72
template<typename AliasType>
folly::DelayedDestructionBase::IntrusivePtr< AliasType >::IntrusivePtr ( AliasType *  dd)
inlineexplicit

Definition at line 142 of file DelayedDestructionBase.h.

References type, and value.

142 : DestructorGuard(dd) {}
template<typename AliasType>
template<typename CopyAliasType , typename Deleter , typename = typename std::enable_if< std::is_convertible<CopyAliasType*, AliasType*>::value>::type>
folly::DelayedDestructionBase::IntrusivePtr< AliasType >::IntrusivePtr ( const std::unique_ptr< CopyAliasType, Deleter > &  copy)
inlineexplicit

Member Function Documentation

template<typename AliasType>
AliasType* folly::DelayedDestructionBase::IntrusivePtr< AliasType >::get ( ) const
inline

Definition at line 176 of file DelayedDestructionBase.h.

References folly::DelayedDestructionBase::DestructorGuard::get().

Referenced by folly::operator!=(), and folly::operator==().

176  {
177  return static_cast<AliasType*>(DestructorGuard::get());
178  }
template<typename AliasType>
template<typename... Args>
static IntrusivePtr<AliasType> folly::DelayedDestructionBase::IntrusivePtr< AliasType >::make ( Args &&...  args)
inlinestatic

Definition at line 120 of file DelayedDestructionBase.h.

References folly::pushmi::__adl::noexcept(), type, and value.

120  {
121  return {new AliasType(std::forward<Args>(args)...)};
122  }
template<typename AliasType>
folly::DelayedDestructionBase::IntrusivePtr< AliasType >::operator bool ( ) const
inlineexplicit

Definition at line 188 of file DelayedDestructionBase.h.

188  {
189  return DestructorGuard::operator bool();
190  }
template<typename AliasType>
AliasType& folly::DelayedDestructionBase::IntrusivePtr< AliasType >::operator* ( ) const
inline

Definition at line 180 of file DelayedDestructionBase.h.

180  {
181  return *get();
182  }
template<typename AliasType>
AliasType* folly::DelayedDestructionBase::IntrusivePtr< AliasType >::operator-> ( ) const
inline

Definition at line 184 of file DelayedDestructionBase.h.

184  {
185  return get();
186  }
template<typename AliasType>
IntrusivePtr& folly::DelayedDestructionBase::IntrusivePtr< AliasType >::operator= ( const IntrusivePtr< AliasType > &  )
default
template<typename AliasType>
IntrusivePtr& folly::DelayedDestructionBase::IntrusivePtr< AliasType >::operator= ( IntrusivePtr< AliasType > &&  )
defaultnoexcept
template<typename AliasType>
template<typename CopyAliasType , typename = typename std::enable_if< std::is_convertible<CopyAliasType*, AliasType*>::value>::type>
IntrusivePtr& folly::DelayedDestructionBase::IntrusivePtr< AliasType >::operator= ( IntrusivePtr< CopyAliasType >  copy)
inlinenoexcept

Definition at line 162 of file DelayedDestructionBase.h.

References folly::copy(), and folly::DelayedDestructionBase::DestructorGuard::operator=().

162  {
164  return *this;
165  }
DestructorGuard & operator=(DestructorGuard dg) noexcept
constexpr std::decay< T >::type copy(T &&value) noexcept(noexcept(typename std::decay< T >::type(std::forward< T >(value))))
Definition: Utility.h:72
template<typename AliasType>
IntrusivePtr& folly::DelayedDestructionBase::IntrusivePtr< AliasType >::operator= ( AliasType *  dd)
inline

Definition at line 167 of file DelayedDestructionBase.h.

References folly::DelayedDestructionBase::DestructorGuard::operator=().

167  {
169  return *this;
170  }
DestructorGuard & operator=(DestructorGuard dg) noexcept
template<typename AliasType>
void folly::DelayedDestructionBase::IntrusivePtr< AliasType >::reset ( AliasType *  dd = nullptr)
inline

Definition at line 172 of file DelayedDestructionBase.h.

172  {
173  *this = dd;
174  }

Friends And Related Function Documentation

template<typename AliasType>
template<typename CopyAliasType >
friend class IntrusivePtr
friend

Definition at line 116 of file DelayedDestructionBase.h.


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