#include <atomic.h>
Public Member Functions | |
| _AtomicInt32 (_BaseType val) | |
| _AtomicInt32 () | |
| operator _BaseType () | |
| _BaseType | operator++ () |
| _BaseType | operator++ (_BaseType) |
| _BaseType | operator-- () |
| _BaseType | operator-- (_BaseType) |
| _BaseType | operator+= (_BaseType v) |
| _BaseType | operator-= (_BaseType v) |
| _BaseType | operator|= (_BaseType v) |
| _BaseType | operator&= (_BaseType v) |
| _BaseType | operator^= (_BaseType v) |
Private Attributes | |
| long | m_Value |
The _AtomicInt32 template class provides support for atomic operations (such as addition and subtraction) on 32-bit integers. To use such class, simply declare a variable and apply standard operators. For example, the following code ensures atomic operation:
class Test
{
public:
AtomicInt32 m_RefCount;
unsigned Retain()
{
return ++m_RefCount;
}
unsigned Release()
{
register int r = --m_RefCount;
if (!r)
delete this;
return r;
}
};
Avoid using the _AtomicInt32 template directly. Instead use the AtomicInt32 and AtomicUInt32 typedefs. | BazisLib::DDK::_AtomicInt32< _BaseType >::_AtomicInt32 | ( | _BaseType | val | ) | [inline] |
| BazisLib::DDK::_AtomicInt32< _BaseType >::_AtomicInt32 | ( | ) | [inline] |
| BazisLib::DDK::_AtomicInt32< _BaseType >::operator _BaseType | ( | ) | [inline] |
| _BaseType BazisLib::DDK::_AtomicInt32< _BaseType >::operator&= | ( | _BaseType | v | ) | [inline] |
| _BaseType BazisLib::DDK::_AtomicInt32< _BaseType >::operator++ | ( | _BaseType | ) | [inline] |
| _BaseType BazisLib::DDK::_AtomicInt32< _BaseType >::operator++ | ( | ) | [inline] |
| _BaseType BazisLib::DDK::_AtomicInt32< _BaseType >::operator+= | ( | _BaseType | v | ) | [inline] |
| _BaseType BazisLib::DDK::_AtomicInt32< _BaseType >::operator-- | ( | _BaseType | ) | [inline] |
| _BaseType BazisLib::DDK::_AtomicInt32< _BaseType >::operator-- | ( | ) | [inline] |
| _BaseType BazisLib::DDK::_AtomicInt32< _BaseType >::operator-= | ( | _BaseType | v | ) | [inline] |
| _BaseType BazisLib::DDK::_AtomicInt32< _BaseType >::operator^= | ( | _BaseType | v | ) | [inline] |
| _BaseType BazisLib::DDK::_AtomicInt32< _BaseType >::operator|= | ( | _BaseType | v | ) | [inline] |
long BazisLib::DDK::_AtomicInt32< _BaseType >::m_Value [private] |