proxygen
NodeRC< Mutable, Atom > Class Template Reference
Inheritance diagram for NodeRC< Mutable, Atom >:
folly::hazptr_obj_base_linked< NodeRC< Mutable, Atom >, Atom > folly::hazptr_obj_linked< Atom > folly::hazptr_deleter< NodeRC< Mutable, Atom >, D > folly::hazptr_obj< Atom >

Public Member Functions

 NodeRC (int v=0, NodeRC *n=nullptr, bool acq=false) noexcept
 
 ~NodeRC ()
 
int value () const noexcept
 
NodeRC< Mutable, Atom > * next () const noexcept
 
template<typename S >
void push_links (bool m, S &s)
 
- Public Member Functions inherited from folly::hazptr_obj_base_linked< NodeRC< Mutable, Atom >, Atom >
void retire ()
 
void unlink ()
 
void unlink_and_reclaim_unchecked ()
 
- Public Member Functions inherited from folly::hazptr_obj_linked< Atom >
void acquire_link () noexcept
 
void acquire_link_safe () noexcept
 
void acquire_ref () noexcept
 
void acquire_ref_safe () noexcept
 
- Public Member Functions inherited from folly::hazptr_obj< Atom >
 hazptr_obj () noexcept
 
 hazptr_obj (const hazptr_obj< Atom > &) noexcept
 
 hazptr_obj (hazptr_obj< Atom > &&) noexcept
 
hazptr_obj< Atom > & operator= (const hazptr_obj< Atom > &) noexcept
 
hazptr_obj< Atom > & operator= (hazptr_obj< Atom > &&) noexcept
 
- Public Member Functions inherited from folly::hazptr_deleter< NodeRC< Mutable, Atom >, D >
void set_deleter (D d={})
 
void delete_obj (NodeRC< Mutable, Atom > *p)
 

Private Attributes

Atom< NodeRC< Mutable, Atom > * > next_
 
int val_
 

Detailed Description

template<bool Mutable, template< typename > class Atom = std::atomic>
class NodeRC< Mutable, Atom >

NodeRC

Definition at line 127 of file HazptrTest.cpp.

Constructor & Destructor Documentation

template<bool Mutable, template< typename > class Atom = std::atomic>
NodeRC< Mutable, Atom >::NodeRC ( int  v = 0,
NodeRC< Mutable, Atom > *  n = nullptr,
bool  acq = false 
)
inlineexplicitnoexcept

Definition at line 132 of file HazptrTest.cpp.

References Count::inc_ctors(), and folly::gen::Mutable.

133  : next_(n), val_(v) {
134  this->set_deleter();
135  c_.inc_ctors();
136  if (acq) {
137  if (Mutable) {
138  this->acquire_link_safe();
139  } else {
140  this->acquire_ref_safe();
141  }
142  }
143  }
void inc_ctors() noexcept
Definition: HazptrTest.cpp:81
int val_
Definition: HazptrTest.cpp:129
static Count c_
Definition: HazptrTest.cpp:94
void acquire_ref_safe() noexcept
Atom< NodeRC< Mutable, Atom > * > next_
Definition: HazptrTest.cpp:128
void acquire_link_safe() noexcept
template<bool Mutable, template< typename > class Atom = std::atomic>
NodeRC< Mutable, Atom >::~NodeRC ( )
inline

Definition at line 145 of file HazptrTest.cpp.

References Count::inc_dtors().

145  {
146  c_.inc_dtors();
147  }
void inc_dtors() noexcept
Definition: HazptrTest.cpp:85
static Count c_
Definition: HazptrTest.cpp:94

Member Function Documentation

template<bool Mutable, template< typename > class Atom = std::atomic>
NodeRC<Mutable, Atom>* NodeRC< Mutable, Atom >::next ( ) const
inlinenoexcept

Definition at line 153 of file HazptrTest.cpp.

Referenced by linked_test(), and mt_linked_test().

153  {
154  return next_.load(std::memory_order_acquire);
155  }
Atom< NodeRC< Mutable, Atom > * > next_
Definition: HazptrTest.cpp:128
template<bool Mutable, template< typename > class Atom = std::atomic>
template<typename S >
void NodeRC< Mutable, Atom >::push_links ( bool  m,
S s 
)
inline

Definition at line 158 of file HazptrTest.cpp.

References Atom, folly::gen::Mutable, and cpp.ast::next().

158  {
159  if (Mutable == m) {
160  auto p = next();
161  if (p) {
162  s.push(p);
163  }
164  }
165  }
NodeRC< Mutable, Atom > * next() const noexcept
Definition: HazptrTest.cpp:153
static map< string, int > m
static set< string > s
template<bool Mutable, template< typename > class Atom = std::atomic>
int NodeRC< Mutable, Atom >::value ( ) const
inlinenoexcept

Definition at line 149 of file HazptrTest.cpp.

149  {
150  return val_;
151  }
int val_
Definition: HazptrTest.cpp:129

Member Data Documentation

template<bool Mutable, template< typename > class Atom = std::atomic>
Atom<NodeRC<Mutable, Atom>*> NodeRC< Mutable, Atom >::next_
private

Definition at line 128 of file HazptrTest.cpp.

template<bool Mutable, template< typename > class Atom = std::atomic>
int NodeRC< Mutable, Atom >::val_
private

Definition at line 129 of file HazptrTest.cpp.


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