proxygen
folly::hazptr_obj_list< Atom > Class Template Reference

#include <Hazptr-fwd.h>

Public Member Functions

 hazptr_obj_list () noexcept
 
 hazptr_obj_list (hazptr_obj< Atom > *obj) noexcept
 
 hazptr_obj_list (hazptr_obj< Atom > *head, hazptr_obj< Atom > *tail, int count) noexcept
 
hazptr_obj< Atom > * head ()
 
hazptr_obj< Atom > * tail ()
 
int count ()
 
void push (hazptr_obj< Atom > *obj)
 
void splice (hazptr_obj_list< Atom > &l)
 
void clear ()
 

Private Attributes

hazptr_obj< Atom > * head_
 
hazptr_obj< Atom > * tail_
 
int count_
 

Detailed Description

template<template< typename > class Atom>
class folly::hazptr_obj_list< Atom >

hazptr_obj_list

hazptr_obj_list

List of hazptr_obj-s.

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

Constructor & Destructor Documentation

template<template< typename > class Atom>
folly::hazptr_obj_list< Atom >::hazptr_obj_list ( )
inlinenoexcept

Definition at line 137 of file HazptrObj.h.

137 : head_(nullptr), tail_(nullptr), count_(0) {}
hazptr_obj< Atom > * head_
Definition: HazptrObj.h:132
hazptr_obj< Atom > * tail_
Definition: HazptrObj.h:133
template<template< typename > class Atom>
folly::hazptr_obj_list< Atom >::hazptr_obj_list ( hazptr_obj< Atom > *  obj)
inlineexplicitnoexcept

Definition at line 139 of file HazptrObj.h.

140  : head_(obj), tail_(obj), count_(1) {}
hazptr_obj< Atom > * head_
Definition: HazptrObj.h:132
hazptr_obj< Atom > * tail_
Definition: HazptrObj.h:133
template<template< typename > class Atom>
folly::hazptr_obj_list< Atom >::hazptr_obj_list ( hazptr_obj< Atom > *  head,
hazptr_obj< Atom > *  tail,
int  count 
)
inlineexplicitnoexcept

Definition at line 142 of file HazptrObj.h.

146  : head_(head), tail_(tail), count_(count) {}
hazptr_obj< Atom > * tail()
Definition: HazptrObj.h:152
hazptr_obj< Atom > * head_
Definition: HazptrObj.h:132
hazptr_obj< Atom > * head()
Definition: HazptrObj.h:148
hazptr_obj< Atom > * tail_
Definition: HazptrObj.h:133

Member Function Documentation

template<template< typename > class Atom>
void folly::hazptr_obj_list< Atom >::clear ( )
inline

Definition at line 183 of file HazptrObj.h.

Referenced by folly::hazptr_obj_list< Atom >::splice().

183  {
184  head_ = nullptr;
185  tail_ = nullptr;
186  count_ = 0;
187  }
hazptr_obj< Atom > * head_
Definition: HazptrObj.h:132
hazptr_obj< Atom > * tail_
Definition: HazptrObj.h:133
template<template< typename > class Atom>
hazptr_obj<Atom>* folly::hazptr_obj_list< Atom >::head ( )
inline

Definition at line 148 of file HazptrObj.h.

Referenced by folly::hazptr_domain< DeterministicAtomic >::push_retired(), and folly::hazptr_obj_list< Atom >::splice().

148  {
149  return head_;
150  }
hazptr_obj< Atom > * head_
Definition: HazptrObj.h:132
template<template< typename > class Atom>
void folly::hazptr_obj_list< Atom >::push ( hazptr_obj< Atom > *  obj)
inline

Definition at line 160 of file HazptrObj.h.

Referenced by folly::hazptr_domain< DeterministicAtomic >::bulk_lookup_and_reclaim(), and folly::hazptr_obj_base_linked< NodeAuto< Atom >, Atom >::release_retire_mutable_children().

160  {
161  obj->set_next(head_);
162  head_ = obj;
163  if (tail_ == nullptr) {
164  tail_ = obj;
165  }
166  ++count_;
167  }
hazptr_obj< Atom > * head_
Definition: HazptrObj.h:132
hazptr_obj< Atom > * tail_
Definition: HazptrObj.h:133
template<template< typename > class Atom>
void folly::hazptr_obj_list< Atom >::splice ( hazptr_obj_list< Atom > &  l)
inline

Definition at line 169 of file HazptrObj.h.

References folly::hazptr_obj_list< Atom >::clear(), folly::hazptr_obj_list< Atom >::count(), count, folly::hazptr_obj_list< Atom >::head(), and folly::hazptr_obj_list< Atom >::tail().

Referenced by folly::hazptr_domain< DeterministicAtomic >::bulk_lookup_and_reclaim().

169  {
170  if (l.count() == 0) {
171  return;
172  }
173  if (count() == 0) {
174  head_ = l.head();
175  } else {
176  tail_->set_next(l.head());
177  }
178  tail_ = l.tail();
179  count_ += l.count();
180  l.clear();
181  }
hazptr_obj< Atom > * head_
Definition: HazptrObj.h:132
hazptr_obj< Atom > * tail_
Definition: HazptrObj.h:133
template<template< typename > class Atom>
hazptr_obj<Atom>* folly::hazptr_obj_list< Atom >::tail ( )
inline

Definition at line 152 of file HazptrObj.h.

Referenced by folly::hazptr_domain< DeterministicAtomic >::push_retired(), and folly::hazptr_obj_list< Atom >::splice().

152  {
153  return tail_;
154  }
hazptr_obj< Atom > * tail_
Definition: HazptrObj.h:133

Member Data Documentation

template<template< typename > class Atom>
int folly::hazptr_obj_list< Atom >::count_
private

Definition at line 134 of file HazptrObj.h.

template<template< typename > class Atom>
hazptr_obj<Atom>* folly::hazptr_obj_list< Atom >::head_
private

Definition at line 132 of file HazptrObj.h.

template<template< typename > class Atom>
hazptr_obj<Atom>* folly::hazptr_obj_list< Atom >::tail_
private

Definition at line 133 of file HazptrObj.h.


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