version 1.1.2.3, 2005/10/11 23:57:18
|
version 1.1.4.5, 2005/10/19 01:42:04
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@austin.rr.com) |
// Author: Mike Brasher (mike-brasher@austin.rr.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
| |
#ifndef PEGASUS_INTERNALONLY |
//#ifndef PEGASUS_INTERNALONLY |
# error "ERROR: This header is for internal use only (AtomicInt.h)" |
//# error "ERROR: This header is for internal use only (AtomicInt.h)" |
#endif |
//#endif |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
void dec(); | void dec(); |
| |
// Decrements and returns true if it is zero. | // Decrements and returns true if it is zero. |
bool dec_and_test(); |
bool decAndTestIfZero(); |
| |
// Assignment. | // Assignment. |
AtomicIntTemplate& operator=(Uint32 n) { set(n); } |
AtomicIntTemplate& operator=(Uint32 n) { set(n); return* this; } |
| |
// Post-increment. | // Post-increment. |
void operator++(int) { inc(); } | void operator++(int) { inc(); } |
|
|
// Post-decrement. | // Post-decrement. |
void operator--(int) { dec(); } | void operator--(int) { dec(); } |
| |
|
// Backwards compatibility: |
|
Uint32 value() const { return get(); } |
|
|
private: | private: |
| |
// Note: These methods are intentionally hidden (and should not be called). | // Note: These methods are intentionally hidden (and should not be called). |
|
|
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
|
|
|
|
|
#else |
|
|
#if defined(PEGASUS_PLATFORM_LINUX_IX86_GNU) | #if defined(PEGASUS_PLATFORM_LINUX_IX86_GNU) |
# include <Pegasus/Common/AtomicInt_LINUX_IX86_GNU.h> | # include <Pegasus/Common/AtomicInt_LINUX_IX86_GNU.h> |
|
#elif defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
|
# include <Pegasus/Common/AtomicInt_LINUX_IA64_GNU.h> |
#elif defined(PEGASUS_PLATFORM_LINUX_PPC_GNU) | #elif defined(PEGASUS_PLATFORM_LINUX_PPC_GNU) |
# include <Pegasus/Common/AtomicInt_LINUX_PPC_GNU.h> | # include <Pegasus/Common/AtomicInt_LINUX_PPC_GNU.h> |
#elif defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC) | #elif defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC) |
# include <Pegasus/Common/AtomicInt_WIN32_IX86_MSVC.h> | # include <Pegasus/Common/AtomicInt_WIN32_IX86_MSVC.h> |
#elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) | #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) |
# include <Pegasus/Common/AtomicInt_ZOS_ZSERIES_IBM.h> | # include <Pegasus/Common/AtomicInt_ZOS_ZSERIES_IBM.h> |
|
#elif defined (PEGASUS_PLATFORM_HPUX_PARISC_ACC) |
|
# include <Pegasus/Common/AtomicInt_HPUX_PARISC_ACC.h> |
#else | #else |
# include <Pegasus/Common/AtomicInt_Generic.h> | # include <Pegasus/Common/AtomicInt_Generic.h> |
#endif | #endif |
| |
|
#endif /* if 1 */ |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
typedef AtomicIntTemplate<AtomicType> NewAtomicInt; |
typedef AtomicIntTemplate<AtomicType> AtomicInt; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |