Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ACE_ATOMIC_OP_GCC_T_H
00014 #define ACE_ATOMIC_OP_GCC_T_H
00015 #include "ace/pre.h"
00016
00017 #include "ace/config-all.h"
00018
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif
00022
00023 #include "ace/Thread_Mutex.h"
00024 #include "ace/ACE_export.h"
00025
00026 #if defined (ACE_HAS_GCC_ATOMIC_BUILTINS) && (ACE_HAS_GCC_ATOMIC_BUILTINS == 1)
00027
00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00029
00030
00031
00032
00033
00034
00035
00036
00037 template<typename T>
00038 class ACE_Export ACE_Atomic_Op_GCC
00039 {
00040 public:
00041
00042 T operator++ (void);
00043
00044
00045 T operator++ (int);
00046
00047
00048 T operator+= (T rhs);
00049
00050
00051 T operator-- (void);
00052
00053
00054 T operator-- (int);
00055
00056
00057 T operator-= (T rhs);
00058
00059
00060 bool operator== (T rhs) const;
00061
00062
00063 bool operator!= (T rhs) const;
00064
00065
00066 bool operator>= (T rhs) const;
00067
00068
00069 bool operator> (T rhs) const;
00070
00071
00072 bool operator<= (T rhs) const;
00073
00074
00075 bool operator< (T rhs) const;
00076
00077
00078 T value (void) const;
00079
00080
00081 void dump (void) const;
00082
00083
00084 volatile T &value_i (void);
00085
00086
00087
00088
00089 protected:
00090
00091 ACE_Atomic_Op_GCC<T> &operator= (T rhs);
00092
00093
00094 ACE_Atomic_Op_GCC<T> &operator= (const ACE_Atomic_Op_GCC<T> &rhs);
00095
00096
00097 ACE_Atomic_Op_GCC (void);
00098
00099
00100 ACE_Atomic_Op_GCC (T c);
00101
00102
00103 ACE_Atomic_Op_GCC (const ACE_Atomic_Op_GCC<T> &c);
00104
00105 private:
00106
00107
00108
00109
00110 ACE_Thread_Mutex &mutex (void);
00111
00112 private:
00113
00114
00115 volatile T value_;
00116 };
00117
00118 ACE_END_VERSIONED_NAMESPACE_DECL
00119
00120 #if defined (__ACE_INLINE__)
00121 #include "ace/Atomic_Op_GCC_T.inl"
00122 #endif
00123
00124 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00125 #include "ace/Atomic_Op_GCC_T.cpp"
00126 #endif
00127
00128 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00129 #pragma implementation ("Atomic_Op_GCC_T.cpp")
00130 #endif
00131
00132
00133 #endif
00134
00135 #include "ace/post.h"
00136 #endif