cds  1.4.0
Public Types | Public Member Functions
cds::atomicity::item_counter Class Reference

Atomic item counter. More...

#include <cds/cxx11_atomic.h>

Public Types

typedef std::atomic_size_t atomic_type
 atomic type used
 
typedef size_t counter_type
 Integral item counter type (size_t)
 

Public Member Functions

 item_counter ()
 Default ctor initializes the counter to zero.
 
counter_type value (std::memory_order order=std::memory_order_relaxed) const
 Returns current value of the counter.
 
 operator counter_type () const
 Same as value() with relaxed memory ordering.
 
atomic_typegetAtomic ()
 Returns underlying atomic interface.
 
const atomic_typegetAtomic () const
 Returns underlying atomic interface (const)
 
counter_type inc (std::memory_order order=std::memory_order_relaxed)
 Increments the counter. Semantics: postincrement.
 
counter_type dec (std::memory_order order=std::memory_order_relaxed)
 Decrements the counter. Semantics: postdecrement.
 
counter_type operator++ ()
 Preincrement.
 
counter_type operator++ (int)
 Postincrement.
 
counter_type operator-- ()
 Predecrement.
 
counter_type operator-- (int)
 Postdecrement.
 
void reset (std::memory_order order=std::memory_order_relaxed)
 Resets count to 0.
 

Detailed Description

Atomic item counter.

This class is simplified interface around std::atomic_size_t. The class supports getting of current value of the counter and increment/decrement its value.


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

cds 1.4.0 Developed by Maxim Khiszinsky aka khizmax 2007 - 2012
Autogenerated Mon May 20 2013 00:37:55 by Doxygen 1.8.3.1