proxygen
folly::CoreCachedWeakPtr< T, kNumSlots > Class Template Reference

#include <CoreCachedSharedPtr.h>

Public Member Functions

 CoreCachedWeakPtr (const CoreCachedSharedPtr< T, kNumSlots > &p)
 
std::weak_ptr< Tget () const
 

Private Attributes

std::array< std::weak_ptr< T >, kNumSlots > slots_
 

Detailed Description

template<class T, size_t kNumSlots = 64>
class folly::CoreCachedWeakPtr< T, kNumSlots >

Definition at line 71 of file CoreCachedSharedPtr.h.

Constructor & Destructor Documentation

template<class T, size_t kNumSlots = 64>
folly::CoreCachedWeakPtr< T, kNumSlots >::CoreCachedWeakPtr ( const CoreCachedSharedPtr< T, kNumSlots > &  p)
inlineexplicit

Definition at line 73 of file CoreCachedSharedPtr.h.

References folly::enumerate(), and folly::CoreCachedSharedPtr< T, kNumSlots >::slots_.

73  {
74  for (auto slot : folly::enumerate(slots_)) {
75  *slot = p.slots_[slot.index];
76  }
77  }
std::array< std::weak_ptr< T >, kNumSlots > slots_
detail::RangeEnumerator< Range > enumerate(Range &&r)
Definition: Enumerate.h:167

Member Function Documentation

template<class T, size_t kNumSlots = 64>
std::weak_ptr<T> folly::CoreCachedWeakPtr< T, kNumSlots >::get ( ) const
inline

Definition at line 79 of file CoreCachedSharedPtr.h.

References folly::AccessSpreader< Atom >::current(), and folly::CoreCachedSharedPtr< T, kNumSlots >::slots_.

79  {
80  return slots_[AccessSpreader<>::current(kNumSlots)];
81  }
std::array< std::weak_ptr< T >, kNumSlots > slots_
static size_t current(size_t numStripes)

Member Data Documentation

template<class T, size_t kNumSlots = 64>
std::array<std::weak_ptr<T>, kNumSlots> folly::CoreCachedWeakPtr< T, kNumSlots >::slots_
private

Definition at line 84 of file CoreCachedSharedPtr.h.


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