#include <Atomic_Op_T.h>
Collaboration diagram for ACE_Atomic_Op< ACE_LOCK, TYPE >:
Public Member Functions | |
ACE_Atomic_Op (void) | |
Initialize to 0. | |
ACE_Atomic_Op (const TYPE &c) | |
Initialize to c. | |
ACE_Atomic_Op (const ACE_Atomic_Op< ACE_LOCK, TYPE > &c) | |
Manage copying... | |
ACE_Atomic_Op< ACE_LOCK, TYPE > & | operator= (const TYPE &rhs) |
Atomically assign rhs to . | |
ACE_Atomic_Op< ACE_LOCK, TYPE > & | operator= (const ACE_Atomic_Op< ACE_LOCK, TYPE > &rhs) |
Atomically assign to . | |
TYPE | operator++ (void) |
Atomically pre-increment . | |
TYPE | operator++ (int) |
Atomically post-increment . | |
TYPE | operator+= (const TYPE &rhs) |
Atomically increment by rhs. | |
TYPE | operator-- (void) |
Atomically pre-decrement . | |
TYPE | operator-- (int) |
Atomically post-decrement . | |
TYPE | operator-= (const TYPE &rhs) |
Atomically decrement by rhs. | |
bool | operator== (const TYPE &rhs) const |
Atomically compare with rhs. | |
bool | operator!= (const TYPE &rhs) const |
Atomically compare with rhs. | |
bool | operator>= (const TYPE &rhs) const |
Atomically check if greater than or equal to rhs. | |
bool | operator> (const TYPE &rhs) const |
Atomically check if greater than rhs. | |
bool | operator<= (const TYPE &rhs) const |
Atomically check if less than or equal to rhs. | |
bool | operator< (const TYPE &rhs) const |
Atomically check if less than rhs. | |
TYPE | value (void) const |
Explicitly return . | |
void | dump (void) const |
Dump the state of an object. | |
ACE_LOCK & | mutex (void) |
TYPE & | value_i (void) |
Private Attributes | |
ACE_LOCK | own_mutex_ |
Type of synchronization mechanism. | |
ACE_Atomic_Op_Ex< ACE_LOCK, TYPE > | impl_ |
Underlying atomic op implementation. |
This class is described in an article in the July/August 1994 issue of the C++ Report magazine. It implements a templatized version of the Decorator pattern from the GoF book.
Certain platforms may provide a template specialization for ACE_Atomic_Op <ACE_Thread_Mutex, long> that provides optimized atomic integer operations without actually requiring a mutex.
Definition at line 151 of file Atomic_Op_T.h.
|
Initialize to 0.
Definition at line 62 of file Atomic_Op_T.cpp.
00063 : impl_ (this->own_mutex_) 00064 { 00065 // ACE_TRACE ("ACE_Atomic_Op<ACE_LOCK, TYPE>::ACE_Atomic_Op"); 00066 } |
|
Initialize to c.
Definition at line 69 of file Atomic_Op_T.cpp.
00070 : impl_ (this->own_mutex_, c) 00071 { 00072 // ACE_TRACE ("ACE_Atomic_Op<ACE_LOCK, TYPE>::ACE_Atomic_Op"); 00073 } |
|
Manage copying...
Definition at line 163 of file Atomic_Op_T.inl.
|
|
Dump the state of an object.
Definition at line 263 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00264 { 00265 #if defined (ACE_HAS_DUMP) 00266 this->impl_.dump (); 00267 #endif /* ACE_HAS_DUMP */ 00268 return; 00269 } |
|
Returns a reference to the underlying . 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 or ACE_Process_Mutex.
Definition at line 272 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::own_mutex_.
00273 { 00274 return this->own_mutex_; 00275 } |
|
Atomically compare with rhs.
Definition at line 227 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00228 { 00229 return this->impl_ != rhs; 00230 } |
|
Atomically post-increment .
Definition at line 191 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00192 { 00193 return this->impl_++; 00194 } |
|
Atomically pre-increment .
Definition at line 185 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00186 { 00187 return ++this->impl_; 00188 } |
|
Atomically increment by rhs.
Definition at line 197 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00198 { 00199 return this->impl_ += rhs; 00200 } |
|
Atomically post-decrement .
Definition at line 209 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00210 { 00211 return this->impl_--; 00212 } |
|
Atomically pre-decrement .
Definition at line 203 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00204 { 00205 return --this->impl_; 00206 } |
|
Atomically decrement by rhs.
Definition at line 215 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00216 { 00217 return this->impl_ -= rhs; 00218 } |
|
Atomically check if less than rhs.
Definition at line 251 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00252 { 00253 return this->impl_ < rhs; 00254 } |
|
Atomically check if less than or equal to rhs.
Definition at line 245 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00246 { 00247 return this->impl_ <= rhs; 00248 } |
|
Atomically assign to .
Definition at line 178 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
|
|
Atomically assign rhs to .
Definition at line 171 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00172 { 00173 this->impl_ = i; 00174 return *this; 00175 } |
|
Atomically compare with rhs.
Definition at line 221 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00222 { 00223 return this->impl_ == rhs; 00224 } |
|
Atomically check if greater than rhs.
Definition at line 239 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00240 { 00241 return this->impl_ > rhs; 00242 } |
|
Atomically check if greater than or equal to rhs.
Definition at line 233 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00234 { 00235 return this->impl_ >= rhs; 00236 } |
|
Explicitly return .
Definition at line 257 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00258 { 00259 return this->impl_.value (); 00260 } |
|
Explicitly return (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 ;-) Definition at line 278 of file Atomic_Op_T.inl. References ACE_Atomic_Op< ACE_LOCK, TYPE >::impl_.
00279 { 00280 return this->impl_.value_i (); 00281 } |
|
|
Type of synchronization mechanism.
Definition at line 233 of file Atomic_Op_T.h. Referenced by ACE_Atomic_Op< ACE_LOCK, TYPE >::mutex(). |