proxygen
folly::ReadMostlyWeakPtr< T, RefCount > Class Template Reference

#include <ReadMostlySharedPtr.h>

Public Member Functions

 ReadMostlyWeakPtr ()
 
 ReadMostlyWeakPtr (const ReadMostlyMainPtr< T, RefCount > &mainPtr)
 
 ReadMostlyWeakPtr (const ReadMostlySharedPtr< T, RefCount > &ptr)
 
 ReadMostlyWeakPtr (const ReadMostlyWeakPtr &other)
 
ReadMostlyWeakPtroperator= (const ReadMostlyWeakPtr &other)
 
ReadMostlyWeakPtroperator= (const ReadMostlyMainPtr< T, RefCount > &mainPtr)
 
 ReadMostlyWeakPtr (ReadMostlyWeakPtr &&other) noexcept
 
ReadMostlyWeakPtroperator= (ReadMostlyWeakPtr &&other) noexcept
 
 ~ReadMostlyWeakPtr () noexcept
 
ReadMostlySharedPtr< T, RefCount > lock ()
 

Private Member Functions

void reset (detail::ReadMostlySharedPtrCore< T, RefCount > *impl)
 

Private Attributes

detail::ReadMostlySharedPtrCore< T, RefCount > * impl_ {nullptr}
 

Friends

class ReadMostlySharedPtr< T, RefCount >
 

Detailed Description

template<typename T, typename RefCount = DefaultRefCount>
class folly::ReadMostlyWeakPtr< T, RefCount >

Definition at line 28 of file ReadMostlySharedPtr.h.

Constructor & Destructor Documentation

template<typename T, typename RefCount = DefaultRefCount>
folly::ReadMostlyWeakPtr< T, RefCount >::ReadMostlyWeakPtr ( )
inline

Definition at line 194 of file ReadMostlySharedPtr.h.

194 {}
template<typename T, typename RefCount = DefaultRefCount>
folly::ReadMostlyWeakPtr< T, RefCount >::ReadMostlyWeakPtr ( const ReadMostlyMainPtr< T, RefCount > &  mainPtr)
inlineexplicit

Definition at line 196 of file ReadMostlySharedPtr.h.

196  {
197  reset(mainPtr.impl_);
198  }
void reset(detail::ReadMostlySharedPtrCore< T, RefCount > *impl)
template<typename T, typename RefCount = DefaultRefCount>
folly::ReadMostlyWeakPtr< T, RefCount >::ReadMostlyWeakPtr ( const ReadMostlySharedPtr< T, RefCount > &  ptr)
inlineexplicit

Definition at line 200 of file ReadMostlySharedPtr.h.

200  {
201  reset(ptr.impl_);
202  }
void * ptr
void reset(detail::ReadMostlySharedPtrCore< T, RefCount > *impl)
template<typename T, typename RefCount = DefaultRefCount>
folly::ReadMostlyWeakPtr< T, RefCount >::ReadMostlyWeakPtr ( const ReadMostlyWeakPtr< T, RefCount > &  other)
inline

Definition at line 204 of file ReadMostlySharedPtr.h.

204  {
205  *this = other;
206  }
template<typename T, typename RefCount = DefaultRefCount>
folly::ReadMostlyWeakPtr< T, RefCount >::ReadMostlyWeakPtr ( ReadMostlyWeakPtr< T, RefCount > &&  other)
inlinenoexcept

Definition at line 218 of file ReadMostlySharedPtr.h.

218  {
219  *this = other;
220  }
template<typename T, typename RefCount = DefaultRefCount>
folly::ReadMostlyWeakPtr< T, RefCount >::~ReadMostlyWeakPtr ( )
inlinenoexcept

Definition at line 227 of file ReadMostlySharedPtr.h.

227  {
228  reset(nullptr);
229  }
void reset(detail::ReadMostlySharedPtrCore< T, RefCount > *impl)

Member Function Documentation

template<typename T, typename RefCount = DefaultRefCount>
ReadMostlySharedPtr<T, RefCount> folly::ReadMostlyWeakPtr< T, RefCount >::lock ( )
inline

Definition at line 231 of file ReadMostlySharedPtr.h.

231  {
232  return ReadMostlySharedPtr<T, RefCount>(*this);
233  }
friend class ReadMostlySharedPtr< T, RefCount >
template<typename T, typename RefCount = DefaultRefCount>
ReadMostlyWeakPtr& folly::ReadMostlyWeakPtr< T, RefCount >::operator= ( const ReadMostlyWeakPtr< T, RefCount > &  other)
inline

Definition at line 208 of file ReadMostlySharedPtr.h.

208  {
209  reset(other.impl_);
210  return *this;
211  }
void reset(detail::ReadMostlySharedPtrCore< T, RefCount > *impl)
template<typename T, typename RefCount = DefaultRefCount>
ReadMostlyWeakPtr& folly::ReadMostlyWeakPtr< T, RefCount >::operator= ( const ReadMostlyMainPtr< T, RefCount > &  mainPtr)
inline

Definition at line 213 of file ReadMostlySharedPtr.h.

213  {
214  reset(mainPtr.impl_);
215  return *this;
216  }
void reset(detail::ReadMostlySharedPtrCore< T, RefCount > *impl)
template<typename T, typename RefCount = DefaultRefCount>
ReadMostlyWeakPtr& folly::ReadMostlyWeakPtr< T, RefCount >::operator= ( ReadMostlyWeakPtr< T, RefCount > &&  other)
inlinenoexcept

Definition at line 222 of file ReadMostlySharedPtr.h.

222  {
223  std::swap(impl_, other.impl_);
224  return *this;
225  }
detail::ReadMostlySharedPtrCore< T, RefCount > * impl_
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414
template<typename T, typename RefCount = DefaultRefCount>
void folly::ReadMostlyWeakPtr< T, RefCount >::reset ( detail::ReadMostlySharedPtrCore< T, RefCount > *  impl)
inlineprivate

Definition at line 238 of file ReadMostlySharedPtr.h.

238  {
239  if (impl_) {
240  impl_->decrefWeak();
241  }
242  impl_ = impl;
243  if (impl_) {
244  impl_->increfWeak();
245  }
246  }
detail::ReadMostlySharedPtrCore< T, RefCount > * impl_

Friends And Related Function Documentation

template<typename T, typename RefCount = DefaultRefCount>
friend class ReadMostlySharedPtr< T, RefCount >
friend

Definition at line 236 of file ReadMostlySharedPtr.h.

Member Data Documentation

template<typename T, typename RefCount = DefaultRefCount>
detail::ReadMostlySharedPtrCore<T, RefCount>* folly::ReadMostlyWeakPtr< T, RefCount >::impl_ {nullptr}
private

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