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

Public Member Functions | |
| ACE_Atomic_Op (void) | |
Initialize value_ to 0. | |
| ACE_Atomic_Op (const TYPE &c) | |
Initialize value_ 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 value_. | |
| ACE_Atomic_Op< ACE_LOCK, TYPE > & | operator= (const ACE_Atomic_Op< ACE_LOCK, TYPE > &rhs) |
Atomically assign to value_. | |
| TYPE | operator++ (void) |
Atomically pre-increment value_. | |
| TYPE | operator++ (int) |
Atomically post-increment value_. | |
| TYPE | operator+= (const TYPE &rhs) |
Atomically increment value_ by rhs. | |
| TYPE | operator-- (void) |
Atomically pre-decrement value_. | |
| TYPE | operator-- (int) |
Atomically post-decrement value_. | |
| TYPE | operator-= (const TYPE &rhs) |
Atomically decrement value_ by rhs. | |
| bool | operator== (const TYPE &rhs) const |
Atomically compare value_ with rhs. | |
| bool | operator!= (const TYPE &rhs) const |
Atomically compare value_ with rhs. | |
| bool | operator>= (const TYPE &rhs) const |
Atomically check if value_ greater than or equal to rhs. | |
| bool | operator> (const TYPE &rhs) const |
Atomically check if value_ greater than rhs. | |
| bool | operator<= (const TYPE &rhs) const |
Atomically check if value_ less than or equal to rhs. | |
| bool | operator< (const TYPE &rhs) const |
Atomically check if value_ less than rhs. | |
| TYPE | value (void) const |
Explicitly return value_. | |
| 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
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
Definition at line 69 of file Atomic_Op_T.cpp.
00070 : impl_ (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
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
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
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
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
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
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
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
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 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(). |
1.3.6