#include <ace/Synch_T.h>
template<class ACE_LOCK, class TYPE> class ACE_Atomic_Op {
public:
ACE_Atomic_Op (void);
ACE_Atomic_Op (const TYPE &c);
TYPE operator++ (void);
TYPE operator++ (int);
TYPE operator+= (const TYPE &i);
TYPE operator-- (void);
TYPE operator-- (int);
TYPE operator-= (const TYPE &i);
int operator== (const TYPE &i) const;
int operator!= (const TYPE &i) const;
int operator>= (const TYPE &i) const;
int operator> (const TYPE &rhs) const;
int operator<= (const TYPE &rhs) const;
int operator< (const TYPE &rhs) const;
void operator= (const TYPE &i);
void operator= (const ACE_Atomic_Op<ACE_LOCK, TYPE> &rhs);
TYPE value (void) const;
void dump (void) const;
ACE_Atomic_Op (const ACE_Atomic_Op<ACE_LOCK, TYPE> &);
ACE_LOCK &mutex (void);
TYPE &value_i (void);
private:
ACE_LOCK mutex_;
TYPE value_;
};
ACE_Atomic_Op (void);
value_
to 0.
ACE_Atomic_Op (const TYPE &c);
value_
to c.
TYPE operator++ (void);
value_
.
TYPE operator++ (int);
value_
.
TYPE operator+= (const TYPE &i);
value_
by i.
TYPE operator-- (void);
value_
.
TYPE operator-- (int);
value_
.
TYPE operator-= (const TYPE &i);
value_
by i.
int operator== (const TYPE &i) const;
value_
with i.
int operator!= (const TYPE &i) const;
value_
with i.
int operator>= (const TYPE &i) const;
value_
greater than or equal to i.
int operator> (const TYPE &rhs) const;
value_
greater than i.
int operator<= (const TYPE &rhs) const;
value_
less than or equal to i.
int operator< (const TYPE &rhs) const;
value_
less than i.
void operator= (const TYPE &i);
value_
.
void operator= (const ACE_Atomic_Op<ACE_LOCK, TYPE> &rhs);
rhs
to value_
.
TYPE value (void) const;
value_
.
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE; Declare the dynamic allocation hooks.
ACE_Atomic_Op (const ACE_Atomic_Op<ACE_LOCK, TYPE> &);
ACE_LOCK &mutex (void);
ACE_LOCK
. This makes it
possible to acquire the lock explicitly, which can be useful in
some cases *if* you instantiate the ACE_Atomic_Op
with an
ACE_Recursive_Mutex
.
NOTE: the right name would be lock_, but HP/C++ will choke on that!
TYPE &value_i (void);
value_
(by reference). This gives the user
full, unrestricted access to the underlying value. This method
will usually be used in conjunction with explicit access to the
lock. Use with care ;-)