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

#include <read_op.h>

Inheritance diagram for tervel::containers::wf::vector::ReadOp< T >:
tervel::util::OpRecord tervel::util::memory::hp::Element

Public Member Functions

 ReadOp (Vector< T > *vec, size_t idx)
 
void help_complete ()
 Implementations of this function that upon its return the operation described in the OpRecord has been completed. More...
 
bool result (T &expected)
 
- Public Member Functions inherited from tervel::util::OpRecord
 OpRecord ()
 
bool on_watch (std::atomic< void * > *address, void *expected)
 This function is used to achieve a strong watch on an Element. More...
 
bool on_is_watched ()
 This function is used to check a strong watch on an Element. More...
 
void on_unwatch ()
 This function is used to remove a strong watch on an Element. More...
 
- 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...
 

Private Attributes

Vector< T > * vec_
 
size_t idx_
 
std::atomic< T > value_ {Vector<T>::c_not_value_}
 

Static Private Attributes

static const T c_fail_value_ {static_cast<T>(~0x1L)}
 

Constructor & Destructor Documentation

template<typename T >
tervel::containers::wf::vector::ReadOp< T >::ReadOp ( Vector< T > *  vec,
size_t  idx 
)
inline

Member Function Documentation

template<typename T >
void tervel::containers::wf::vector::ReadOp< T >::help_complete ( )
inlinevirtual

Implementations of this function that upon its return the operation described in the OpRecord has been completed.

As such it must be thread-safe and the extending class must contain all the information necessary to complete the operation.

Implements tervel::util::OpRecord.

template<typename T >
bool tervel::containers::wf::vector::ReadOp< T >::result ( T &  expected)
inline

Member Data Documentation

template<typename T >
const T tervel::containers::wf::vector::ReadOp< T >::c_fail_value_ {static_cast<T>(~0x1L)}
staticprivate
template<typename T >
size_t tervel::containers::wf::vector::ReadOp< T >::idx_
private
template<typename T >
std::atomic<T> tervel::containers::wf::vector::ReadOp< T >::value_ {Vector<T>::c_not_value_}
private
template<typename T >
Vector<T>* tervel::containers::wf::vector::ReadOp< T >::vec_
private

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