proxygen
folly::hazptr_root< T, Atom > Class Template Reference

#include <Hazptr-fwd.h>

Public Member Functions

 hazptr_root (T *p=nullptr) noexcept
 
 ~hazptr_root ()
 
const Atom< T * > & operator() () const noexcept
 
Atom< T * > & operator() () noexcept
 

Private Attributes

Atom< T * > link_
 

Detailed Description

template<typename T, template< typename > class Atom>
class folly::hazptr_root< T, Atom >

Classes related to link counted objects and automatic retirement. Defined in HazptrLinked.hhazptr_root

hazptr_root

Link to counted objects. When destroyed unlinks the linked object if any.

Template parameter T must support a member function unlink(), inherited from hazptr_obj_base_linked.

Use example: Bucket heads in ConcurrentHashMap.

Definition at line 75 of file Hazptr-fwd.h.

Constructor & Destructor Documentation

template<typename T, template< typename > class Atom>
folly::hazptr_root< T, Atom >::hazptr_root ( T p = nullptr)
inlineexplicitnoexcept

Definition at line 48 of file HazptrObjLinked.h.

48 : link_(p) {}
template<typename T, template< typename > class Atom>
folly::hazptr_root< T, Atom >::~hazptr_root ( )
inline

Definition at line 50 of file HazptrObjLinked.h.

50  {
51  auto p = link_.load(std::memory_order_relaxed);
52  if (p) {
53  p->unlink();
54  }
55  }

Member Function Documentation

template<typename T, template< typename > class Atom>
const Atom<T*>& folly::hazptr_root< T, Atom >::operator() ( ) const
inlinenoexcept

Definition at line 57 of file HazptrObjLinked.h.

57  {
58  return link_;
59  }
template<typename T, template< typename > class Atom>
Atom<T*>& folly::hazptr_root< T, Atom >::operator() ( )
inlinenoexcept

Definition at line 61 of file HazptrObjLinked.h.

61  {
62  return link_;
63  }

Member Data Documentation

template<typename T, template< typename > class Atom>
Atom<T*> folly::hazptr_root< T, Atom >::link_
private

Definition at line 45 of file HazptrObjLinked.h.

Referenced by folly::hazptr_root< Node, Atom >::operator()().


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