FIX::atomic_count Class Reference

Atomic count class - consider using interlocked functions. More...

`#include <AtomicCount.h>`

Collaboration diagram for FIX::atomic_count:
[legend]

## Public Member Functions

| atomic_count (long v)
long | operator++ ()
long | operator-- ()
| operator long () const

## Private Member Functions

| atomic_count (atomic_count const &)
atomic_count & | operator= (atomic_count const &)

## Private Attributes

Mutex | m_mutex
long | m_counter

## Detailed Description

Atomic count class - consider using interlocked functions.

Definition at line 71 of file AtomicCount.h.

## Constructor & Destructor Documentation

## atomic_count() [1/2]

FIX::atomic_count::atomic_count | ( | long | v | ) |

inline explicit

Definition at line 74 of file AtomicCount.h.

Referenced by operator long().

: m_counter( v )
{
}
FIX::atomic_count::m_counter
long m_counter
Definition: AtomicCount.h:101

## atomic_count() [2/2]

FIX::atomic_count::atomic_count | ( | atomic_count const & |  | ) |

private

## Member Function Documentation

## operator long()

FIX::atomic_count::operator long | ( |  | ) | const

inline

Definition at line 90 of file AtomicCount.h.

References atomic_count(), m_counter, and operator=().

{
return static_cast<long const volatile &>( m_counter );
}
FIX::atomic_count::m_counter
long m_counter
Definition: AtomicCount.h:101

## operator++()

long FIX::atomic_count::operator++ | ( |  | ) |

inline

Definition at line 78 of file AtomicCount.h.

References m_counter, and m_mutex.

{
Locker _lock(m_mutex);
return ++m_counter;
}
FIX::atomic_count::m_mutex
Mutex m_mutex
Definition: AtomicCount.h:100
FIX::atomic_count::m_counter
long m_counter
Definition: AtomicCount.h:101

## operator--()

long FIX::atomic_count::operator-- | ( |  | ) |

inline

Definition at line 84 of file AtomicCount.h.

References m_counter, and m_mutex.

{
Locker _lock(m_mutex);
return --m_counter;
}
FIX::atomic_count::m_mutex
Mutex m_mutex
Definition: AtomicCount.h:100
FIX::atomic_count::m_counter
long m_counter
Definition: AtomicCount.h:101

## operator=()

atomic_count& FIX::atomic_count::operator= | ( | atomic_count const & |  | ) |

private

Referenced by operator long().

## Member Data Documentation

## m_counter

long FIX::atomic_count::m_counter

private

Definition at line 101 of file AtomicCount.h.

Referenced by operator long(), operator++(), and operator--().

## m_mutex

Mutex FIX::atomic_count::m_mutex

private

Definition at line 100 of file AtomicCount.h.

Referenced by operator++(), and operator--().

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

- AtomicCount.h