#include <Atomic_Op_T.h>
Collaboration diagram for ACE_Atomic_Op:

Public Methods | |
| ACE_Atomic_Op (void) | |
| Initialize <value_> to 0. More... | |
| ACE_Atomic_Op (const TYPE &c) | |
| Initialize <value_> to c. More... | |
| ACE_Atomic_Op (const ACE_Atomic_Op< ACE_LOCK, TYPE > &c) | |
| Manage copying... More... | |
| void | operator= (const TYPE &rhs) |
| Atomically assign rhs to <value_>. More... | |
| void | operator= (const ACE_Atomic_Op< ACE_LOCK, TYPE > &rhs) |
| Atomically assign <rhs> to <value_>. More... | |
| TYPE | operator++ (void) |
| Atomically pre-increment <value_>. More... | |
| TYPE | operator++ (int) |
| Atomically post-increment <value_>. More... | |
| TYPE | operator+= (const TYPE &rhs) |
| Atomically increment <value_> by rhs. More... | |
| TYPE | operator-- (void) |
| Atomically pre-decrement <value_>. More... | |
| TYPE | operator-- (int) |
| Atomically post-decrement <value_>. More... | |
| TYPE | operator-= (const TYPE &rhs) |
| Atomically decrement <value_> by rhs. More... | |
| int | operator== (const TYPE &rhs) const |
| Atomically compare <value_> with rhs. More... | |
| int | operator!= (const TYPE &rhs) const |
| Atomically compare <value_> with rhs. More... | |
| int | operator>= (const TYPE &rhs) const |
| Atomically check if <value_> greater than or equal to rhs. More... | |
| int | operator> (const TYPE &rhs) const |
| Atomically check if <value_> greater than rhs. More... | |
| int | operator<= (const TYPE &rhs) const |
| Atomically check if <value_> less than or equal to rhs. More... | |
| int | operator< (const TYPE &rhs) const |
| Atomically check if <value_> less than rhs. More... | |
| TYPE | value (void) const |
| Explicitly return <value_>. More... | |
| void | dump (void) const |
| Dump the state of an object. More... | |
| ACE_LOCK & | mutex (void) |
| TYPE & | value_i (void) |
Private Attributes | |
| ACE_LOCK | own_mutex_ |
| Type of synchronization mechanism. More... | |
| ACE_Atomic_Op_Ex< ACE_LOCK, TYPE > | impl_ |
| Underlying atomic op implementation. More... | |
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 152 of file Atomic_Op_T.h.
|
||||||||||
|
Initialize <value_> to 0.
Definition at line 59 of file Atomic_Op_T.cpp.
00060 : impl_ (this->own_mutex_) 00061 { 00062 // ACE_TRACE ("ACE_Atomic_Op<ACE_LOCK, TYPE>::ACE_Atomic_Op"); 00063 } |
|
||||||||||
|
Initialize <value_> to c.
Definition at line 66 of file Atomic_Op_T.cpp.
00067 : impl_ (this->own_mutex_, c) 00068 { 00069 // ACE_TRACE ("ACE_Atomic_Op<ACE_LOCK, TYPE>::ACE_Atomic_Op"); 00070 } |
|
||||||||||
|
Manage copying...
Definition at line 74 of file Atomic_Op_T.cpp.
|
|
||||||||||
|
Dump the state of an object.
Definition at line 245 of file Atomic_Op_T.i. References impl_.
00246 {
00247 this->impl_.dump ();
00248 return;
00249 }
|
|
||||||||||
|
Returns a reference to the underlying <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> or <ACE_Process_Mutex>. NOTE: This member function is deprecated and so may go away in the future. If you need access to the underlying mutex, consider using the ACE_Atomic_Op_Ex template instead. Definition at line 252 of file Atomic_Op_T.i. References own_mutex_.
00253 {
00254 return this->own_mutex_;
00255 }
|
|
||||||||||
|
Atomically compare <value_> with rhs.
Definition at line 209 of file Atomic_Op_T.i. References impl_.
00210 {
00211 return this->impl_ != rhs;
00212 }
|
|
||||||||||
|
Atomically post-increment <value_>.
Definition at line 173 of file Atomic_Op_T.i. References impl_.
00174 {
00175 return this->impl_++;
00176 }
|
|
||||||||||
|
Atomically pre-increment <value_>.
Definition at line 167 of file Atomic_Op_T.i. References impl_.
00168 {
00169 return ++this->impl_;
00170 }
|
|
||||||||||
|
Atomically increment <value_> by rhs.
Definition at line 179 of file Atomic_Op_T.i. References impl_.
00180 {
00181 return this->impl_ += rhs;
00182 }
|
|
||||||||||
|
Atomically post-decrement <value_>.
Definition at line 191 of file Atomic_Op_T.i. References impl_.
00192 {
00193 return this->impl_--;
00194 }
|
|
||||||||||
|
Atomically pre-decrement <value_>.
Definition at line 185 of file Atomic_Op_T.i. References impl_.
00186 {
00187 return --this->impl_;
00188 }
|
|
||||||||||
|
Atomically decrement <value_> by rhs.
Definition at line 197 of file Atomic_Op_T.i. References impl_.
00198 {
00199 return this->impl_ -= rhs;
00200 }
|
|
||||||||||
|
Atomically check if <value_> less than rhs.
Definition at line 233 of file Atomic_Op_T.i. References impl_.
00234 {
00235 return this->impl_ < rhs;
00236 }
|
|
||||||||||
|
Atomically check if <value_> less than or equal to rhs.
Definition at line 227 of file Atomic_Op_T.i. References impl_.
00228 {
00229 return this->impl_ <= rhs;
00230 }
|
|
||||||||||
|
Atomically assign <rhs> to <value_>.
Definition at line 161 of file Atomic_Op_T.i. References impl_.
|
|
||||||||||
|
Atomically assign rhs to <value_>.
Definition at line 155 of file Atomic_Op_T.i. References impl_.
00156 {
00157 this->impl_ = i;
00158 }
|
|
||||||||||
|
Atomically compare <value_> with rhs.
Definition at line 203 of file Atomic_Op_T.i. References impl_.
00204 {
00205 return this->impl_ == rhs;
00206 }
|
|
||||||||||
|
Atomically check if <value_> greater than rhs.
Definition at line 221 of file Atomic_Op_T.i. References impl_.
00222 {
00223 return this->impl_ > rhs;
00224 }
|
|
||||||||||
|
Atomically check if <value_> greater than or equal to rhs.
Definition at line 215 of file Atomic_Op_T.i. References impl_.
00216 {
00217 return this->impl_ >= rhs;
00218 }
|
|
||||||||||
|
Explicitly return <value_>.
Definition at line 239 of file Atomic_Op_T.i. References impl_.
00240 {
00241 return this->impl_.value ();
00242 }
|
|
||||||||||
|
Explicitly return <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 ;-) Definition at line 258 of file Atomic_Op_T.i. References impl_.
00259 {
00260 return this->impl_.value_i ();
00261 }
|
|
|||||
|
Underlying atomic op implementation.
Definition at line 237 of file Atomic_Op_T.h. Referenced by dump, operator!=, operator++, operator+=, operator--, operator-=, operator<, operator<=, operator=, operator==, operator>, operator>=, value, and value_i. |
|
|||||
|
Type of synchronization mechanism.
Definition at line 234 of file Atomic_Op_T.h. Referenced by mutex. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002