... | ... |
@@ -56,13 +56,12 @@ |
56 | 56 |
_SubCounter &operator++() { count++; return *this;} |
57 | 57 |
int operator++(int) { return count++; } |
58 | 58 |
_SubCounter &operator--() { count--; return *this;} |
59 | 59 |
int operator--(int) { return count--; } |
60 | 60 |
_SubCounter &operator+=(int c) { count+=c; return *this;} |
61 | 61 |
_SubCounter &operator-=(int c) { count-=c; return *this;} |
62 |
void reset(int c=0) {count=c;} |
|
63 | 62 |
operator int() {return count;} |
64 | 63 |
}; |
65 | 64 |
|
66 | 65 |
template<class P> |
67 | 66 |
class _NoSubCounter |
68 | 67 |
{ |
... | ... |
@@ -84,14 +83,12 @@ |
84 | 83 |
_NoSubCounter &operator++() { ++_parent; return *this;} |
85 | 84 |
int operator++(int) { _parent++; return 0;} |
86 | 85 |
_NoSubCounter &operator--() { --_parent; return *this;} |
87 | 86 |
int operator--(int) { _parent--; return 0;} |
88 | 87 |
_NoSubCounter &operator+=(int c) { _parent+=c; return *this;} |
89 | 88 |
_NoSubCounter &operator-=(int c) { _parent-=c; return *this;} |
90 |
void reset(int) {} |
|
91 |
void reset() {} |
|
92 | 89 |
operator int() {return 0;} |
93 | 90 |
}; |
94 | 91 |
|
95 | 92 |
|
96 | 93 |
/// \addtogroup timecount |
97 | 94 |
/// @{ |
... | ... |
@@ -200,12 +197,17 @@ |
200 | 197 |
int operator--(int) { return count--;} |
201 | 198 |
///\e |
202 | 199 |
Counter &operator+=(int c) { count+=c; return *this;} |
203 | 200 |
///\e |
204 | 201 |
Counter &operator-=(int c) { count-=c; return *this;} |
205 | 202 |
/// Resets the counter to the given value. |
203 |
|
|
204 |
/// Resets the counter to the given value. |
|
205 |
/// \note This function does not reset the values of |
|
206 |
/// \ref SubCounter "SubCounter"s but it resets \ref NoSubCounter |
|
207 |
/// "NoSubCounter"s along with the main counter. |
|
206 | 208 |
void reset(int c=0) {count=c;} |
207 | 209 |
/// Returns the value of the counter. |
208 | 210 |
operator int() {return count;} |
209 | 211 |
}; |
210 | 212 |
|
211 | 213 |
/// 'Do nothing' version of Counter. |
0 comments (0 inline)