libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT > Class Template Reference

An atomic counter class for integer types, similar to the atomic integer types in C++11 ch 29. More...

#include <atomic_counter.hpp>

Inheritance diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >:
[legend]
Collaboration diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >:
[legend]

Public Types

typedef sp_counter_itf_type< V > base_t
 
typedef LkT lock_traits
 
typedef base_t::value_type value_type
 
typedef std::atomic< value_typeatomic_t
 
- Public Types inherited from jmmcg::LIBJMMCG_VER_NAMESPACE::sp_counter_itf_type< V >
typedef V value_type
 
typedef default_delete< sp_counter_itf_typedeleter_t
 The default deletion method for objects that inherit from this intrusively-counted type, which is just heap-deletion, if the objects are heap-allocated. More...
 

Public Member Functions

constexpr __stdcall atomic_ctr_opt () noexcept(true) FORCE_INLINE
 
constexpr __stdcall atomic_ctr_opt (const value_type) noexcept(true) FORCE_INLINE
 
constexpr atomic_ctr_opt (const atomic_ctr_opt &) noexcept(true) FORCE_INLINE
 
template<class V1 >
constexpr atomic_ctr_opt (const atomic_ctr_opt< V1, LkT > &) noexcept(true) FORCE_INLINE
 
template<class V1 >
 atomic_ctr_opt (atomic_ctr_opt< V1, LkT > &&) noexcept(true) FORCE_INLINE
 
 ~atomic_ctr_opt () noexcept(true) FORCE_INLINE
 
template<class V1 , class V2 = V1>
std::enable_if< std::is_pointer< V2 >::value, void >::type __fastcall operator= (const atomic_ctr_opt< V1, LkT > &v) noexcept(true) FORCE_INLINE
 
void __fastcall operator= (const atomic_ctr_opt &) noexcept(true) FORCE_INLINE
 
void __fastcall operator= (const value_type &) noexcept(true) FORCE_INLINE
 
void swap (atomic_ctr_opt &) noexcept(true) FORCE_INLINE
 
template<class V1 , class V2 = V1>
std::enable_if< std::is_pointer< V2 >::value, void >::type swap (atomic_ctr_opt< V1, LkT > &rhs) noexcept(true) FORCE_INLINE
 
constexpr bool sp_noop_ctr () const noexcept(true) override __attribute__((const))
 
constexpr value_type __fastcall get () const noexcept(true) FORCE_INLINE
 
constexpr operator bool () const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator== (const value_type) const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator== (const atomic_ctr_opt &) const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator!= (const value_type) const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator!= (const atomic_ctr_opt &) const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator< (const value_type) const noexcept(true) FORCE_INLINE override
 
constexpr bool __fastcall operator< (const atomic_ctr_opt &) const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator< (base_t const &) const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator> (const value_type) const noexcept(true) FORCE_INLINE override
 
constexpr bool __fastcall operator> (const atomic_ctr_opt &) const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator> (base_t const &) const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator<= (const value_type) const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator<= (const atomic_ctr_opt &) const noexcept(true) FORCE_INLINE
 
constexpr bool __fastcall operator>= (const value_type) const noexcept(true) FORCE_INLINE override
 
constexpr bool __fastcall operator>= (const atomic_ctr_opt &) const noexcept(true) FORCE_INLINE
 
value_type __fastcall operator++ () noexcept(true) FORCE_INLINE
 
value_type __fastcall operator++ (int) noexcept(true) FORCE_INLINE
 
value_type __fastcall operator-- () noexcept(true) FORCE_INLINE
 
value_type __fastcall operator-- (int) noexcept(true) FORCE_INLINE
 
value_type __fastcall operator+= (const value_type) noexcept(true) FORCE_INLINE
 
value_type __fastcall operator+= (const atomic_ctr_opt &) noexcept(true) FORCE_INLINE
 
value_type __fastcall operator-= (const value_type) noexcept(true) FORCE_INLINE
 
value_type __fastcall operator-= (const atomic_ctr_opt &) noexcept(true) FORCE_INLINE
 
template<class V1 = value_type>
std::enable_if< std::is_pointer< V1 >::value, V1 >::type FORCE_INLINE operator-> () const noexcept(true)
 
template<class BinOp >
value_type __fastcall apply (typename BinOp::second_argument_type const &a, BinOp const &op) noexcept(noexcept(op.operator()(std::declval< value_type >(), std::declval< typename BinOp::second_argument_type >()))) FORCE_INLINE
 
template<class V1 >
value_type __fastcall apply (V1 const &a, std::plus< V1 > const &) noexcept(true) FORCE_INLINE
 
template<class V1 >
value_type __fastcall apply (V1 const &a, std::minus< V1 > const &) noexcept(true) FORCE_INLINE
 
bool compare_exchange_strong (value_type expected, value_type desired) noexcept(true) FORCE_INLINE
 
template<class V1 , class V2 = V1>
std::enable_if< std::is_pointer< V2 >::value, bool >::type compare_exchange_strong (value_type expected, V1 desired) noexcept(true) FORCE_INLINE
 
template<class Op >
atomic_ctr_opt assign (Op &&op) noexcept(true) FORCE_INLINE
 
template<class V1 , class V2 >
std::enable_if< std::is_pointer< V2 >::value, void >::type operator= (const atomic_ctr_opt< V1, LkT > &a) noexcept(true)
 
template<class BinOp >
atomic_ctr_opt< V, LkT >::value_type apply (typename BinOp::second_argument_type const &a, BinOp const &op) noexcept(noexcept(op.operator()(std::declval< value_type >(), std::declval< typename BinOp::second_argument_type >())))
 
template<class V1 >
atomic_ctr_opt< V, LkT >::value_type apply (V1 const &a, std::plus< V1 > const &) noexcept(true)
 
template<class V1 >
atomic_ctr_opt< V, LkT >::value_type apply (V1 const &a, std::minus< V1 > const &) noexcept(true)
 
template<class Op >
atomic_ctr_opt< V, LkT > assign (Op &&op) noexcept(true)
 
- Public Member Functions inherited from jmmcg::LIBJMMCG_VER_NAMESPACE::sp_counter_itf_type< V >
virtual ~sp_counter_itf_type ()
 
virtual value_type sp_count () const noexcept(true)
 
virtual value_type sp_acquire () noexcept(true)
 
virtual bool sp_release () noexcept(true)
 
constexpr bool FORCE_INLINE operator== (const value_type v) const noexcept(true)
 
virtual void deleter ()
 Call the correct deleter_t object to delete the object. More...
 
virtual tstring sp_to_string () const noexcept(false)
 

Static Public Attributes

static constexpr generic_traits::memory_access_modes memory_access_mode =generic_traits::memory_access_modes::crew_memory_access
 
- Static Public Attributes inherited from jmmcg::LIBJMMCG_VER_NAMESPACE::sp_counter_itf_type< V >
static constexpr ppd::generic_traits::memory_access_modes memory_access_mode =ppd::generic_traits::memory_access_modes::crew_memory_access
 

Protected Attributes

atomic_t count
 

Friends

template<class V1 , class LkT1 >
class atomic_ctr_opt
 

Additional Inherited Members

- Protected Member Functions inherited from jmmcg::LIBJMMCG_VER_NAMESPACE::sp_counter_itf_type< V >
constexpr sp_counter_itf_type () noexcept(true)
 

Detailed Description

template<class V, class LkT>
class jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >

An atomic counter class for integer types, similar to the atomic integer types in C++11 ch 29.

Note that this class is a valid value-type. Also note that this class reduces to a simple V-type, if it is single threaded, so costs nothing.

Definition at line 401 of file atomic_counter.hpp.

Member Typedef Documentation

◆ atomic_t

template<class V , class LkT >
typedef std::atomic<value_type> jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::atomic_t

Definition at line 406 of file atomic_counter.hpp.

◆ base_t

template<class V , class LkT >
typedef sp_counter_itf_type<V> jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::base_t

Definition at line 403 of file atomic_counter.hpp.

◆ lock_traits

template<class V , class LkT >
typedef LkT jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::lock_traits

Definition at line 404 of file atomic_counter.hpp.

◆ value_type

template<class V , class LkT >
typedef base_t::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::value_type

Definition at line 405 of file atomic_counter.hpp.

Constructor & Destructor Documentation

◆ atomic_ctr_opt() [1/5]

template<class V , class LkT >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::atomic_ctr_opt
inlineconstexprnoexcept

◆ atomic_ctr_opt() [2/5]

template<class V , class LkT >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::atomic_ctr_opt ( const value_type  v)
inlineexplicitconstexprnoexcept

◆ atomic_ctr_opt() [3/5]

template<class V , class LkT >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::atomic_ctr_opt ( const atomic_ctr_opt< V, LkT > &  a)
inlineconstexprnoexcept

◆ atomic_ctr_opt() [4/5]

template<class V , class LkT >
template<class V1 >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::atomic_ctr_opt ( const atomic_ctr_opt< V1, LkT > &  a)
inlineconstexprnoexcept

◆ atomic_ctr_opt() [5/5]

template<class V , class LkT >
template<class V1 >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::atomic_ctr_opt ( atomic_ctr_opt< V1, LkT > &&  a)
inlinenoexcept

◆ ~atomic_ctr_opt()

template<class V , class LkT >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::~atomic_ctr_opt
inlinenoexcept

Definition at line 331 of file atomic_counter_impl.hpp.

Member Function Documentation

◆ apply() [1/6]

template<class V , class LkT >
template<class BinOp >
atomic_ctr_opt<V, LkT>::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::apply ( typename BinOp::second_argument_type const &  a,
BinOp const &  op 
)
inlinenoexcept

◆ apply() [2/6]

template<class V , class LkT >
template<class BinOp >
value_type __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::apply ( typename BinOp::second_argument_type const &  a,
BinOp const &  op 
)
noexcept

◆ apply() [3/6]

template<class V , class LkT >
template<class V1 >
atomic_ctr_opt<V, LkT>::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::apply ( V1 const &  a,
std::minus< V1 > const &   
)
inlinenoexcept

Definition at line 558 of file atomic_counter_impl.hpp.

◆ apply() [4/6]

template<class V , class LkT >
template<class V1 >
value_type __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::apply ( V1 const &  a,
std::minus< V1 > const &   
)
noexcept

◆ apply() [5/6]

template<class V , class LkT >
template<class V1 >
atomic_ctr_opt<V, LkT>::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::apply ( V1 const &  a,
std::plus< V1 > const &   
)
inlinenoexcept

Definition at line 549 of file atomic_counter_impl.hpp.

◆ apply() [6/6]

template<class V , class LkT >
template<class V1 >
value_type __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::apply ( V1 const &  a,
std::plus< V1 > const &   
)
noexcept

◆ assign() [1/2]

template<class V , class LkT >
template<class Op >
atomic_ctr_opt<V, LkT> jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::assign ( Op &&  op)
inlinenoexcept

Definition at line 566 of file atomic_counter_impl.hpp.

◆ assign() [2/2]

template<class V , class LkT >
template<class Op >
atomic_ctr_opt jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::assign ( Op &&  op)
noexcept

◆ compare_exchange_strong() [1/2]

template<class V , class LkT >
template<class V1 , class V2 >
std::enable_if< std::is_pointer< V2 >::value, bool >::type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::compare_exchange_strong ( value_type  expected,
V1  desired 
)
inlinenoexcept

◆ compare_exchange_strong() [2/2]

template<class V , class LkT >
bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::compare_exchange_strong ( value_type  expected,
value_type  desired 
)
inlinenoexcept

◆ get()

template<class V , class LkT >
constexpr atomic_ctr_opt< V, LkT >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::get
inlineconstexprnoexcept

◆ operator bool()

template<class V , class LkT >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator bool
inlineexplicitconstexprnoexcept

◆ operator!=() [1/2]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator!= ( const atomic_ctr_opt< V, LkT > &  a) const
inlineconstexprnoexcept

Definition at line 397 of file atomic_counter_impl.hpp.

◆ operator!=() [2/2]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator!= ( const value_type  v) const
inlineconstexprnoexcept

Definition at line 391 of file atomic_counter_impl.hpp.

◆ operator++() [1/2]

template<class V , class LkT >
atomic_ctr_opt< V, LkT >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator++
inlinenoexcept
Returns
Atomically increment and return that incremented value.

Definition at line 469 of file atomic_counter_impl.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::count.

◆ operator++() [2/2]

template<class V , class LkT >
atomic_ctr_opt< V, LkT >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator++ ( int  )
inlinenoexcept

◆ operator+=() [1/2]

template<class V , class LkT >
atomic_ctr_opt< V, LkT >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator+= ( const atomic_ctr_opt< V, LkT > &  a)
inlinenoexcept

Definition at line 499 of file atomic_counter_impl.hpp.

◆ operator+=() [2/2]

template<class V , class LkT >
atomic_ctr_opt< V, LkT >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator+= ( const value_type  v)
inlinenoexcept

◆ operator--() [1/2]

template<class V , class LkT >
atomic_ctr_opt< V, LkT >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator--
inlinenoexcept
Returns
Atomically decrement and return that incremented value.

Definition at line 481 of file atomic_counter_impl.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::count.

◆ operator--() [2/2]

template<class V , class LkT >
atomic_ctr_opt< V, LkT >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator-- ( int  )
inlinenoexcept

◆ operator-=() [1/2]

template<class V , class LkT >
atomic_ctr_opt< V, LkT >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator-= ( const atomic_ctr_opt< V, LkT > &  a)
inlinenoexcept

Definition at line 511 of file atomic_counter_impl.hpp.

◆ operator-=() [2/2]

template<class V , class LkT >
atomic_ctr_opt< V, LkT >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator-= ( const value_type  v)
inlinenoexcept

◆ operator->()

template<class V , class LkT >
template<class V1 = value_type>
std::enable_if<std::is_pointer<V1>::value, V1>::type FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator-> ( ) const
inlinenoexcept

◆ operator<() [1/3]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator< ( base_t const &  a) const
inlineconstexprnoexcept

Definition at line 420 of file atomic_counter_impl.hpp.

◆ operator<() [2/3]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator< ( const atomic_ctr_opt< V, LkT > &  a) const
inlineconstexprnoexcept

◆ operator<() [3/3]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator< ( const value_type  v) const
inlineconstexproverridevirtualnoexcept

◆ operator<=() [1/2]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator<= ( const atomic_ctr_opt< V, LkT > &  a) const
inlineconstexprnoexcept

◆ operator<=() [2/2]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator<= ( const value_type  v) const
inlineconstexprnoexcept

◆ operator=() [1/4]

template<class V , class LkT >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator= ( const atomic_ctr_opt< V, LkT > &  a)
inlinenoexcept

◆ operator=() [2/4]

template<class V , class LkT >
template<class V1 , class V2 >
std::enable_if<std::is_pointer<V2>::value, void>::type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator= ( const atomic_ctr_opt< V1, LkT > &  a)
inlinenoexcept

◆ operator=() [3/4]

template<class V , class LkT >
template<class V1 , class V2 = V1>
std::enable_if<std::is_pointer<V2>::value, void>::type __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator= ( const atomic_ctr_opt< V1, LkT > &  v)
noexcept

◆ operator=() [4/4]

template<class V , class LkT >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator= ( const value_type v)
inlinenoexcept

◆ operator==() [1/2]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator== ( const atomic_ctr_opt< V, LkT > &  a) const
inlineconstexprnoexcept

◆ operator==() [2/2]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator== ( const value_type  v) const
inlineconstexprnoexcept

◆ operator>() [1/3]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator> ( base_t const &  a) const
inlineconstexprnoexcept

Definition at line 439 of file atomic_counter_impl.hpp.

◆ operator>() [2/3]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator> ( const atomic_ctr_opt< V, LkT > &  a) const
inlineconstexprnoexcept

◆ operator>() [3/3]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator> ( const value_type  v) const
inlineconstexproverridevirtualnoexcept

◆ operator>=() [1/2]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator>= ( const atomic_ctr_opt< V, LkT > &  a) const
inlineconstexprnoexcept

◆ operator>=() [2/2]

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::operator>= ( const value_type  v) const
inlineconstexproverridevirtualnoexcept

◆ sp_noop_ctr()

template<class V , class LkT >
constexpr bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::sp_noop_ctr ( ) const
inlineconstexproverridevirtualnoexcept

This is a hack: we could use a dynamic_cast to check this, but in GCC dynamic_casts involve strcmps which may be slowish, so use a virtual thunk instead, which should be faster.

Reimplemented from jmmcg::LIBJMMCG_VER_NAMESPACE::sp_counter_itf_type< V >.

Definition at line 444 of file atomic_counter.hpp.

◆ swap() [1/2]

template<class V , class LkT >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::swap ( atomic_ctr_opt< V, LkT > &  a)
inlinenoexcept
Note
This is not lockfree! So it is not thread-safe.

Definition at line 336 of file atomic_counter_impl.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::count.

◆ swap() [2/2]

template<class V , class LkT >
template<class V1 , class V2 >
std::enable_if< std::is_pointer< V2 >::value, void >::type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr_opt< V, LkT >::swap ( atomic_ctr_opt< V1, LkT > &  rhs)
inlinenoexcept

Friends And Related Function Documentation

◆ atomic_ctr_opt

template<class V , class LkT >
template<class V1 , class LkT1 >
friend class atomic_ctr_opt
friend

Definition at line 501 of file atomic_counter.hpp.

Member Data Documentation

◆ count

◆ memory_access_mode

     To assist in allowing compile-time computation of the algorithmic order of the threading model.
     \todo Consider using to define this, equals 0 (never lockfree) or 2 (always lockfree):

ATOMIC_BOOL_LOCK_FREE ATOMIC_CHAR_LOCK_FREE
ATOMIC_CHAR16_T_LOCK_FREE ATOMIC_CHAR32_T_LOCK_FREE ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
ATOMIC_INT_LOCK_FREE
ATOMIC_LONG_LOCK_FREE
ATOMIC_LLONG_LOCK_FREE
ATOMIC_POINTER_LOCK_FREE

Definition at line 421 of file atomic_counter.hpp.


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