ucommon  7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
  Fossies Dox: ucommon-7.0.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Loading...
Searching...
No Matches
ucommon::Atomic::counter Class Reference

Atomic counter class. More...

#include <atomic.h>

Public Member Functions

 counter (atomic_t initial=0)
 
atomic_t fetch_retain () volatile
 
atomic_t fetch_release () volatile
 
atomic_t fetch_add (atomic_t offset=1) volatile
 
atomic_t fetch_sub (atomic_t offset=1) volatile
 
atomic_t operator++ () volatile
 
atomic_t operator-- () volatile
 
atomic_t operator+= (atomic_t offset) volatile
 
atomic_t operator-= (atomic_t offset) volatile
 
atomic_t get () volatile
 
void clear () volatile
 
 operator atomic_t () volatile
 
atomic_t operator* () volatile
 

Private Member Functions

 __DELETE_COPY (counter)
 

Private Attributes

volatile atomic_t value
 

Detailed Description

Atomic counter class.

Can be used to manipulate value of an atomic counter without requiring explicit thread locking.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 60 of file atomic.h.

Constructor & Destructor Documentation

◆ counter()

ucommon::Atomic::counter::counter ( atomic_t  initial = 0)

Definition at line 49 of file atomic.cpp.

References init(), and value.

Here is the call graph for this function:

Member Function Documentation

◆ __DELETE_COPY()

ucommon::Atomic::counter::__DELETE_COPY ( counter  )
private

References ucommon::clear(), and ucommon::operator+=().

Here is the call graph for this function:

◆ clear()

void ucommon::Atomic::counter::clear ( ) volatile

Definition at line 363 of file atomic.cpp.

References ucommon::Mutex::protect(), and ucommon::Mutex::release().

Here is the call graph for this function:

◆ fetch_add()

atomic_t ucommon::Atomic::counter::fetch_add ( atomic_t  offset = 1) volatile

Definition at line 370 of file atomic.cpp.

References ucommon::Mutex::protect(), and ucommon::Mutex::release().

Here is the call graph for this function:

◆ fetch_release()

atomic_t ucommon::Atomic::counter::fetch_release ( ) volatile

Definition at line 395 of file atomic.cpp.

◆ fetch_retain()

atomic_t ucommon::Atomic::counter::fetch_retain ( ) volatile

Definition at line 390 of file atomic.cpp.

◆ fetch_sub()

atomic_t ucommon::Atomic::counter::fetch_sub ( atomic_t  offset = 1) volatile

Definition at line 380 of file atomic.cpp.

References ucommon::Mutex::protect(), and ucommon::Mutex::release().

Here is the call graph for this function:

◆ get()

atomic_t ucommon::Atomic::counter::get ( ) volatile

Definition at line 354 of file atomic.cpp.

References ucommon::Mutex::protect(), and ucommon::Mutex::release().

Referenced by ucommon::TypeRef::Counted::copies(), and ucommon::TypeRef::Counted::is().

Here is the call graph for this function:

◆ operator atomic_t()

ucommon::Atomic::counter::operator atomic_t ( ) volatile
inline

Definition at line 85 of file atomic.h.

◆ operator*()

atomic_t ucommon::Atomic::counter::operator* ( ) volatile
inline

Definition at line 89 of file atomic.h.

◆ operator++()

atomic_t ucommon::Atomic::counter::operator++ ( ) volatile

Definition at line 428 of file atomic.cpp.

◆ operator+=()

atomic_t ucommon::Atomic::counter::operator+= ( atomic_t  offset) volatile

Definition at line 438 of file atomic.cpp.

◆ operator--()

atomic_t ucommon::Atomic::counter::operator-- ( ) volatile

Definition at line 433 of file atomic.cpp.

◆ operator-=()

atomic_t ucommon::Atomic::counter::operator-= ( atomic_t  offset) volatile

Definition at line 443 of file atomic.cpp.

Member Data Documentation

◆ value

volatile atomic_t ucommon::Atomic::counter::value
mutableprivate

Definition at line 63 of file atomic.h.

Referenced by counter().


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