diff options
Diffstat (limited to 'ue4/mycpu/cdat.h')
| -rw-r--r-- | ue4/mycpu/cdat.h | 70 |
1 files changed, 45 insertions, 25 deletions
diff --git a/ue4/mycpu/cdat.h b/ue4/mycpu/cdat.h index ca9d745..a5f2ce0 100644 --- a/ue4/mycpu/cdat.h +++ b/ue4/mycpu/cdat.h | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | */ | 18 | */ |
| 19 | template <class T> | 19 | template <class T> |
| 20 | class CDat | 20 | class CDat |
| 21 | : boost::operators<CDat<T> > | 21 | : public boost::operators<CDat<T> > |
| 22 | { | 22 | { |
| 23 | public: | 23 | public: |
| 24 | /** | 24 | /** |
| @@ -28,7 +28,8 @@ class CDat | |||
| 28 | * @return - | 28 | * @return - |
| 29 | * @globalvars none | 29 | * @globalvars none |
| 30 | * @exception bad_alloc | 30 | * @exception bad_alloc |
| 31 | * @conditions none | 31 | * @pre none |
| 32 | * @post none | ||
| 32 | */ | 33 | */ |
| 33 | CDat() | 34 | CDat() |
| 34 | {} | 35 | {} |
| @@ -40,9 +41,10 @@ class CDat | |||
| 40 | * @return - | 41 | * @return - |
| 41 | * @globalvars none | 42 | * @globalvars none |
| 42 | * @exception none | 43 | * @exception none |
| 43 | * @conditions none | 44 | * @pre none |
| 45 | * @post none | ||
| 44 | */ | 46 | */ |
| 45 | ~CDat() | 47 | virtual ~CDat() |
| 46 | {} | 48 | {} |
| 47 | 49 | ||
| 48 | /** | 50 | /** |
| @@ -52,7 +54,8 @@ class CDat | |||
| 52 | * @return - | 54 | * @return - |
| 53 | * @globalvars none | 55 | * @globalvars none |
| 54 | * @exception none | 56 | * @exception none |
| 55 | * @conditions none | 57 | * @pre none |
| 58 | * @post none | ||
| 56 | */ | 59 | */ |
| 57 | CDat(const CDat& other) | 60 | CDat(const CDat& other) |
| 58 | : m_value(other.m_value) | 61 | : m_value(other.m_value) |
| @@ -60,14 +63,15 @@ class CDat | |||
| 60 | 63 | ||
| 61 | /** | 64 | /** |
| 62 | * @method CDat | 65 | * @method CDat |
| 63 | * @brief Copy constructor for int | 66 | * @brief Copy constructor for T |
| 64 | * @param newval new value for CDat | 67 | * @param newval new value for CDat |
| 65 | * @return - | 68 | * @return - |
| 66 | * @globalvars none | 69 | * @globalvars none |
| 67 | * @exception none | 70 | * @exception none |
| 68 | * @conditions none | 71 | * @pre none |
| 72 | * @post none | ||
| 69 | */ | 73 | */ |
| 70 | CDat(T newval) | 74 | CDat(const T newval) |
| 71 | : m_value(newval) | 75 | : m_value(newval) |
| 72 | {} | 76 | {} |
| 73 | 77 | ||
| @@ -78,7 +82,8 @@ class CDat | |||
| 78 | * @return value of CDat | 82 | * @return value of CDat |
| 79 | * @globalvars none | 83 | * @globalvars none |
| 80 | * @exception none | 84 | * @exception none |
| 81 | * @conditions none | 85 | * @pre none |
| 86 | * @post none | ||
| 82 | */ | 87 | */ |
| 83 | T getValue() const | 88 | T getValue() const |
| 84 | { | 89 | { |
| @@ -92,7 +97,8 @@ class CDat | |||
| 92 | * @return T | 97 | * @return T |
| 93 | * @globalvars none | 98 | * @globalvars none |
| 94 | * @exception none | 99 | * @exception none |
| 95 | * @conditions none | 100 | * @pre none |
| 101 | * @post none | ||
| 96 | */ | 102 | */ |
| 97 | operator T() | 103 | operator T() |
| 98 | { | 104 | { |
| @@ -106,7 +112,8 @@ class CDat | |||
| 106 | * @return true if cdat is less than object x | 112 | * @return true if cdat is less than object x |
| 107 | * @globalvars none | 113 | * @globalvars none |
| 108 | * @exception none | 114 | * @exception none |
| 109 | * @conditions none | 115 | * @pre none |
| 116 | * @post none | ||
| 110 | */ | 117 | */ |
| 111 | bool operator<(const CDat& x) const | 118 | bool operator<(const CDat& x) const |
| 112 | { | 119 | { |
| @@ -120,7 +127,8 @@ class CDat | |||
| 120 | * @return true if cdat equals object x | 127 | * @return true if cdat equals object x |
| 121 | * @globalvars none | 128 | * @globalvars none |
| 122 | * @exception none | 129 | * @exception none |
| 123 | * @conditions none | 130 | * @pre none |
| 131 | * @post none | ||
| 124 | */ | 132 | */ |
| 125 | bool operator==(const CDat& x) const | 133 | bool operator==(const CDat& x) const |
| 126 | { | 134 | { |
| @@ -134,7 +142,8 @@ class CDat | |||
| 134 | * @return refecence to CDat | 142 | * @return refecence to CDat |
| 135 | * @globalvars none | 143 | * @globalvars none |
| 136 | * @exception none | 144 | * @exception none |
| 137 | * @conditions none | 145 | * @pre none |
| 146 | * @post none | ||
| 138 | */ | 147 | */ |
| 139 | CDat& operator+=(const CDat& x) | 148 | CDat& operator+=(const CDat& x) |
| 140 | { | 149 | { |
| @@ -149,7 +158,8 @@ class CDat | |||
| 149 | * @return refecence to CDat | 158 | * @return refecence to CDat |
| 150 | * @globalvars none | 159 | * @globalvars none |
| 151 | * @exception none | 160 | * @exception none |
| 152 | * @conditions none | 161 | * @pre none |
| 162 | * @post none | ||
| 153 | */ | 163 | */ |
| 154 | CDat& operator-=(const CDat& x) | 164 | CDat& operator-=(const CDat& x) |
| 155 | { | 165 | { |
| @@ -164,7 +174,8 @@ class CDat | |||
| 164 | * @return refecence to CDat | 174 | * @return refecence to CDat |
| 165 | * @globalvars none | 175 | * @globalvars none |
| 166 | * @exception none | 176 | * @exception none |
| 167 | * @conditions none | 177 | * @pre none |
| 178 | * @post none | ||
| 168 | */ | 179 | */ |
| 169 | CDat& operator*=(const CDat& x) | 180 | CDat& operator*=(const CDat& x) |
| 170 | { | 181 | { |
| @@ -179,7 +190,8 @@ class CDat | |||
| 179 | * @return refecence to CDat | 190 | * @return refecence to CDat |
| 180 | * @globalvars none | 191 | * @globalvars none |
| 181 | * @exception none | 192 | * @exception none |
| 182 | * @conditions none | 193 | * @pre none |
| 194 | * @post none | ||
| 183 | */ | 195 | */ |
| 184 | CDat& operator/=(const CDat& x) | 196 | CDat& operator/=(const CDat& x) |
| 185 | { | 197 | { |
| @@ -194,7 +206,8 @@ class CDat | |||
| 194 | * @return refecence to CDat | 206 | * @return refecence to CDat |
| 195 | * @globalvars none | 207 | * @globalvars none |
| 196 | * @exception none | 208 | * @exception none |
| 197 | * @conditions none | 209 | * @pre none |
| 210 | * @post none | ||
| 198 | */ | 211 | */ |
| 199 | CDat& operator%=(const CDat& x) | 212 | CDat& operator%=(const CDat& x) |
| 200 | { | 213 | { |
| @@ -209,7 +222,8 @@ class CDat | |||
| 209 | * @return refecence to CDat | 222 | * @return refecence to CDat |
| 210 | * @globalvars none | 223 | * @globalvars none |
| 211 | * @exception none | 224 | * @exception none |
| 212 | * @conditions none | 225 | * @pre none |
| 226 | * @post none | ||
| 213 | */ | 227 | */ |
| 214 | CDat& operator|=(const CDat& x) | 228 | CDat& operator|=(const CDat& x) |
| 215 | { | 229 | { |
| @@ -224,7 +238,8 @@ class CDat | |||
| 224 | * @return refecence to CDat | 238 | * @return refecence to CDat |
| 225 | * @globalvars none | 239 | * @globalvars none |
| 226 | * @exception none | 240 | * @exception none |
| 227 | * @conditions none | 241 | * @pre none |
| 242 | * @post none | ||
| 228 | */ | 243 | */ |
| 229 | CDat& operator&=(const CDat& x) | 244 | CDat& operator&=(const CDat& x) |
| 230 | { | 245 | { |
| @@ -239,7 +254,8 @@ class CDat | |||
| 239 | * @return refecence to CDat | 254 | * @return refecence to CDat |
| 240 | * @globalvars none | 255 | * @globalvars none |
| 241 | * @exception none | 256 | * @exception none |
| 242 | * @conditions none | 257 | * @pre none |
| 258 | * @post none | ||
| 243 | */ | 259 | */ |
| 244 | CDat& operator^=(const CDat& x) | 260 | CDat& operator^=(const CDat& x) |
| 245 | { | 261 | { |
| @@ -254,7 +270,8 @@ class CDat | |||
| 254 | * @return refecence to CDat | 270 | * @return refecence to CDat |
| 255 | * @globalvars none | 271 | * @globalvars none |
| 256 | * @exception none | 272 | * @exception none |
| 257 | * @conditions none | 273 | * @pre none |
| 274 | * @post none | ||
| 258 | */ | 275 | */ |
| 259 | CDat& operator++() | 276 | CDat& operator++() |
| 260 | { | 277 | { |
| @@ -269,7 +286,8 @@ class CDat | |||
| 269 | * @return refecence to CDat | 286 | * @return refecence to CDat |
| 270 | * @globalvars none | 287 | * @globalvars none |
| 271 | * @exception none | 288 | * @exception none |
| 272 | * @conditions none | 289 | * @pre none |
| 290 | * @post none | ||
| 273 | */ | 291 | */ |
| 274 | CDat& operator--() | 292 | CDat& operator--() |
| 275 | { | 293 | { |
| @@ -285,7 +303,8 @@ class CDat | |||
| 285 | * @return reference to outputstream | 303 | * @return reference to outputstream |
| 286 | * @globalvars none | 304 | * @globalvars none |
| 287 | * @exception none | 305 | * @exception none |
| 288 | * @conditions none | 306 | * @pre none |
| 307 | * @post none | ||
| 289 | */ | 308 | */ |
| 290 | friend std::ostream& operator<<(std::ostream& stream, CDat cdat) | 309 | friend std::ostream& operator<<(std::ostream& stream, CDat cdat) |
| 291 | { | 310 | { |
| @@ -301,7 +320,8 @@ class CDat | |||
| 301 | * @return reference to inputstream | 320 | * @return reference to inputstream |
| 302 | * @globalvars none | 321 | * @globalvars none |
| 303 | * @exception none | 322 | * @exception none |
| 304 | * @conditions none | 323 | * @pre none |
| 324 | * @post none | ||
| 305 | */ | 325 | */ |
| 306 | friend std::istream& operator>>(std::istream & stream, CDat& cdat) | 326 | friend std::istream& operator>>(std::istream & stream, CDat& cdat) |
| 307 | { | 327 | { |
| @@ -309,7 +329,7 @@ class CDat | |||
| 309 | return stream; | 329 | return stream; |
| 310 | } | 330 | } |
| 311 | 331 | ||
| 312 | private: | 332 | protected: |
| 313 | /* members */ | 333 | /* members */ |
| 314 | T m_value; | 334 | T m_value; |
| 315 | }; | 335 | }; |
