Tervel  1.0.0
A collection of wait-free containers and algorithms.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tervel::containers::wf::RingBuffer< T >::Helper< T > Class Template Reference

#include <helper.h>

Inheritance diagram for tervel::containers::wf::RingBuffer< T >::Helper< T >:
tervel::util::memory::hp::Element

Public Member Functions

 Helper (BufferOp *op, uintptr_t old_value)
 
 ~Helper ()
 
bool on_watch (std::atomic< void * > *address, void *expected)
 This function is used to achieve a strong watch on an Element. More...
 
void * associate ()
 
bool valid ()
 
- Public Member Functions inherited from tervel::util::memory::hp::Element
 Element ()
 
virtual ~Element ()
 
void safe_delete (bool no_check=false, ElementList *const element_list=tervel::tl_thread_info->get_hp_element_list())
 This function is used to free a hazard pointer protected object if it is safe to do so OR add it to a list to be freed later. More...
 
virtual bool on_is_watched ()
 This function is used to check a strong watch on an Element. More...
 
virtual void on_unwatch ()
 This function is used to remove a strong watch on an Element. More...
 

Static Public Member Functions

static uintptr_t HelperType (Helper *h)
 Returns a uintptr_t for the passed helper object. More...
 
static bool isHelperType (uintptr_t val)
 
static HelpergetHelperType (uintptr_t val)
 

Public Attributes

BufferOpop_
 
const uintptr_t old_value_
 

Constructor & Destructor Documentation

template<typename T>
template<typename T >
tervel::containers::wf::RingBuffer< T >::Helper< T >::Helper ( BufferOp op,
uintptr_t  old_value 
)
inline
template<typename T>
template<typename T >
tervel::containers::wf::RingBuffer< T >::Helper< T >::~Helper ( )
inline

Member Function Documentation

template<typename T>
template<typename T >
void * tervel::containers::wf::RingBuffer< T >::Helper< T >::associate ( )
template<typename T>
template<typename T >
RingBuffer< T >::Helper * tervel::containers::wf::RingBuffer< T >::Helper< T >::getHelperType ( uintptr_t  val)
inlinestatic
template<typename T>
template<typename T >
uintptr_t tervel::containers::wf::RingBuffer< T >::Helper< T >::HelperType ( Helper< T > *  h)
inlinestatic

Returns a uintptr_t for the passed helper object.

Returns a uintptr_t for the passed helper object by performing a bitwise OR with h and oprec_lsb

Parameters
hthe pointer to OR
Returns
the result of the bitwise or.
template<typename T>
template<typename T >
bool tervel::containers::wf::RingBuffer< T >::Helper< T >::isHelperType ( uintptr_t  val)
inlinestatic
template<typename T>
template<typename T >
bool tervel::containers::wf::RingBuffer< T >::Helper< T >::on_watch ( std::atomic< void * > *  address,
void *  expected 
)
virtual

This function is used to achieve a strong watch on an Element.

Classes wishing to express this should override this function.

Parameters
addressthe expected was load from
expectedthe last known value of address
Returns
whether or not the element was succefully watched.

Reimplemented from tervel::util::memory::hp::Element.

template<typename T>
template<typename T >
bool tervel::containers::wf::RingBuffer< T >::Helper< T >::valid ( )

Member Data Documentation

template<typename T>
template<typename T >
const uintptr_t tervel::containers::wf::RingBuffer< T >::Helper< T >::old_value_
template<typename T>
template<typename T >
BufferOp* tervel::containers::wf::RingBuffer< T >::Helper< T >::op_

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