library of assembled shared sources

http://lass.cocamware.com

lass::util::TaggedPtr< T > Class Template Reference
[Atomic]

Pointer with a tag for ABA salvation

Some lock-free algorithms suffer from the ABA problem when acting on pointers. More...

#include <atomic.h>

Inheritance diagram for lass::util::TaggedPtr< T >:

Inheritance graph
[legend]

Public Types

typedef num::TuintPtr TTag

Public Member Functions

 TaggedPtr ()
 TaggedPtr (T *ptr, TTag tag)
 TaggedPtr (const TaggedPtr &other)
 TaggedPtr (const volatile TaggedPtr &other)
TaggedPtroperator= (const TaggedPtr &other)
TaggedPtroperator= (const volatile TaggedPtr &other)
T *const get () const
const TTag tag () const
bool operator== (const TaggedPtr &other) const
bool operator== (const volatile TaggedPtr &other) const
bool atomicCompareAndSwap (const TaggedPtr &expected, const TaggedPtr &fresh) volatile
T *const operator-> () const
const bool operator! () const
 operator num::SafeBool () const

Private Attributes

T * ptr_
TTag tag_

Detailed Description

template<typename T>
class lass::util::TaggedPtr< T >

Pointer with a tag for ABA salvation

Some lock-free algorithms suffer from the ABA problem when acting on pointers.

This can be solved (read: be make very unlikely) by adding a tag to the pointer.

Definition at line 141 of file atomic.h.


Member Typedef Documentation

template<typename T >
typedef num::TuintPtr lass::util::TaggedPtr< T >::TTag

Definition at line 189 of file atomic.h.


Constructor & Destructor Documentation

template<typename T >
lass::util::TaggedPtr< T >::TaggedPtr (  )  [inline]

Definition at line 190 of file atomic.h.

template<typename T >
lass::util::TaggedPtr< T >::TaggedPtr ( T *  ptr,
TTag  tag 
) [inline]

Definition at line 191 of file atomic.h.

template<typename T >
lass::util::TaggedPtr< T >::TaggedPtr ( const TaggedPtr< T > &  other  )  [inline]

Definition at line 192 of file atomic.h.

template<typename T >
lass::util::TaggedPtr< T >::TaggedPtr ( const volatile TaggedPtr< T > &  other  )  [inline]

Definition at line 193 of file atomic.h.


Member Function Documentation

template<typename T >
TaggedPtr& lass::util::TaggedPtr< T >::operator= ( const TaggedPtr< T > &  other  )  [inline]

Definition at line 194 of file atomic.h.

template<typename T >
TaggedPtr& lass::util::TaggedPtr< T >::operator= ( const volatile TaggedPtr< T > &  other  )  [inline]

Definition at line 195 of file atomic.h.

template<typename T >
T* const lass::util::TaggedPtr< T >::get (  )  const [inline]

template<typename T >
const TTag lass::util::TaggedPtr< T >::tag (  )  const [inline]

template<typename T >
bool lass::util::TaggedPtr< T >::operator== ( const TaggedPtr< T > &  other  )  const [inline]

Definition at line 198 of file atomic.h.

template<typename T >
bool lass::util::TaggedPtr< T >::operator== ( const volatile TaggedPtr< T > &  other  )  const [inline]

Definition at line 199 of file atomic.h.

template<typename T >
bool lass::util::TaggedPtr< T >::atomicCompareAndSwap ( const TaggedPtr< T > &  expected,
const TaggedPtr< T > &  fresh 
) volatile [inline]

template<typename T >
T* const lass::util::TaggedPtr< T >::operator-> (  )  const [inline]

Definition at line 212 of file atomic.h.

template<typename T >
const bool lass::util::TaggedPtr< T >::operator! (  )  const [inline]

Definition at line 213 of file atomic.h.

template<typename T >
lass::util::TaggedPtr< T >::operator num::SafeBool (  )  const [inline]

Definition at line 214 of file atomic.h.


Field Documentation

template<typename T >
T* lass::util::TaggedPtr< T >::ptr_ [private]

template<typename T >
TTag lass::util::TaggedPtr< T >::tag_ [private]


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

Generated on Mon Nov 10 14:22:16 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo