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

#include <pushback_op.h>

Inheritance diagram for tervel::containers::wf::vector::PushDescr< T >:
tervel::util::Descriptor

Public Member Functions

 PushDescr (T val, Vector< T > *vec)
 
void set_prev_spot (std::atomic< T > *prev_spot)
 
bool in_progress ()
 
bool result ()
 
bool success ()
 
bool fail ()
 
void * get_logical_value ()
 This method is implemented by each sub class. More...
 
void * complete (void *value, std::atomic< void * > *address)
 This method is implemented by each sub class and must guarantee that upon return that the descriptor no longer exists at the address it was placed. More...
 
void set_control_word ()
 
- Public Member Functions inherited from tervel::util::Descriptor
 Descriptor ()
 
virtual ~Descriptor ()
 
virtual bool on_watch (std::atomic< void * > *, void *)
 This method is optional to implement for each sub class. More...
 
virtual void on_unwatch ()
 This method must be implemented if on_watch is implemented, and is optional otherwise. More...
 
virtual bool on_is_watched ()
 This method is optional to implement for each sub class. More...
 

Private Attributes

val_
 
Vector< T > * vec_
 
std::atomic< T > * prev_spot_ {nullptr}
 
std::atomic< uint64_t > success_ {0}
 

Constructor & Destructor Documentation

template<typename T>
tervel::containers::wf::vector::PushDescr< T >::PushDescr ( val,
Vector< T > *  vec 
)
inlineexplicit

Member Function Documentation

template<typename T>
void* tervel::containers::wf::vector::PushDescr< T >::complete ( void *  current,
std::atomic< void * > *  address 
)
inlinevirtual

This method is implemented by each sub class and must guarantee that upon return that the descriptor no longer exists at the address it was placed.

Parameters
currentthe reference to this object as it is at the address,
addressthe location this object was read from

Implements tervel::util::Descriptor.

template<typename T>
bool tervel::containers::wf::vector::PushDescr< T >::fail ( )
inline
template<typename T>
void* tervel::containers::wf::vector::PushDescr< T >::get_logical_value ( )
inlinevirtual

This method is implemented by each sub class.

It returns the logical value of the past address. If the associated operation is still in progress then it will generally return the value that was replaced by this descriptor. Otherwise it will generally return the result of the operation for the specified address.

It can only be called from the static function which protects the object from being reused during the function.

Implements tervel::util::Descriptor.

template<typename T>
bool tervel::containers::wf::vector::PushDescr< T >::in_progress ( )
inline
template<typename T>
bool tervel::containers::wf::vector::PushDescr< T >::result ( )
inline
template<typename T>
void tervel::containers::wf::vector::PushDescr< T >::set_control_word ( )
inline
template<typename T>
void tervel::containers::wf::vector::PushDescr< T >::set_prev_spot ( std::atomic< T > *  prev_spot)
inline
template<typename T>
bool tervel::containers::wf::vector::PushDescr< T >::success ( )
inline

Member Data Documentation

template<typename T>
std::atomic<T>* tervel::containers::wf::vector::PushDescr< T >::prev_spot_ {nullptr}
private
template<typename T>
std::atomic<uint64_t> tervel::containers::wf::vector::PushDescr< T >::success_ {0}
private
template<typename T>
T tervel::containers::wf::vector::PushDescr< T >::val_
private
template<typename T>
Vector<T>* tervel::containers::wf::vector::PushDescr< T >::vec_
private

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