cds  2.2.0
cds::urcu::exempt_ptr< RCU, NodeType, ValueType, Disposer, Cast > Class Template Reference

Exempt pointer for RCU. More...

#include <cds/urcu/exempt_ptr.h>

Public Types

typedef RCU rcu
 RCU type - one of cds::urcu::gc< ... >
typedef NodeType node_type
 Node type.
typedef ValueType value_type
 Value type.
typedef Disposer disposer
typedef std::conditional< std::is_same< Cast, void >::value, trivial_cast, Cast >::type node_to_value_cast
 Functor converting node_type to value_type.

Public Member Functions

 exempt_ptr () noexcept()
 Constructs empty pointer.
 exempt_ptr (exempt_ptr &&p) noexcept()
 Move ctor.
 exempt_ptr (exempt_ptr const &)=delete
 The exempt pointer is not copy-constructible.
 ~exempt_ptr ()
 Releases the pointer, see release()
bool empty () const noexcept()
 Checks if the pointer is nullptr.
 operator bool () const noexcept()
 bool operator returns !empty()
value_typeoperator-> () const noexcept()
 Dereference operator.
value_typeoperator* () noexcept()
 Returns a reference to the value.
exempt_ptroperator= (exempt_ptr &&p) noexcept()
 Move assignment. Can be called only outside of RCU critical section.
exempt_ptroperator= (exempt_ptr const &)=delete
 The exempt pointer is not copy-assignable.
void release ()
 Disposes the pointer. Should be called only outside of RCU critical section.

Detailed Description

template<class RCU, typename NodeType, typename ValueType, typename Disposer, typename Cast>
class cds::urcu::exempt_ptr< RCU, NodeType, ValueType, Disposer, Cast >

Exempt pointer for RCU.

This special pointer class is intended for returning extracted node from RCU-based container. The destructor (and release() member function) invokes RCU::retire_ptr< Disposer >() function to dispose the node. For non-intrusive containers from cds::container namespace Disposer is usually an invocation of node deallocator. For intrusive containers the disposer can be empty or it can trigger an event "node can be reused safely". In any case, the exempt pointer concept keeps RCU semantics. The destructor or release() should be called outside the RCU lock of current thread.

You don't need use this helper class directly. Any RCU-based container typedefs a simplified version of this template.

Template arguments:

  • RCU - one of RCU type
  • NodeType - container's node type
  • ValueType - value type stored in container's node. For intrusive containers it is the same as NodeType
  • Disposer - a disposer functor
  • Cast - a functor for casting from NodeType to ValueType. For intrusive containers the casting is usually disabled, i.e. Cast is void.

Member Typedef Documentation

§ disposer

template<class RCU , typename NodeType , typename ValueType , typename Disposer , typename Cast >
typedef Disposer cds::urcu::exempt_ptr< RCU, NodeType, ValueType, Disposer, Cast >::disposer

Disposer calling when release

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

cds 2.2.0 Developed by Maxim Khizhinsky aka khizmax 2007 - 2017
Autogenerated Wed Jan 4 2017 08:50:07 by Doxygen 1.8.12