#include <JCounter.hpp>
Public Methods | |
JCounter (register unsigned long initial=0, register unsigned long maximum=~0) | |
JCounter (const JCounter &src) | |
virtual | ~JCounter () |
const JCounter & | operator= (const JCounter &src) |
const JCounter & | operator= (register unsigned long value) |
const JCounter & | operator+= (const JCounter &src) |
const JCounter & | operator-= (const JCounter &src) |
const JCounter & | operator+= (register unsigned long v) |
const JCounter & | operator-= (register unsigned long v) |
const JCounter & | operator++ () |
const JCounter & | operator-- () |
const JCounter & | operator++ (int) |
const JCounter & | operator-- (int) |
const JCounter & | operator~ () |
const JCounter & | operator! () |
unsigned long | operator() () |
bool | operator== (const JCounter &src) |
bool | operator!= (const JCounter &src) |
bool | operator> (const JCounter &src) |
bool | operator>= (const JCounter &src) |
bool | operator< (const JCounter &src) |
bool | operator<= (const JCounter &src) |
bool | operator== (register unsigned long v) |
bool | operator!= (register unsigned long v) |
bool | operator> (register unsigned long v) |
bool | operator>= (register unsigned long v) |
bool | operator< (register unsigned long v) |
bool | operator<= (register unsigned long v) |
JCounter | operator+ (const JCounter &right) |
JCounter | operator- (const JCounter &right) |
JCounter | operator * (const JCounter &right) |
JCounter | operator/ (const JCounter &right) |
JCounter | operator+ (register unsigned long right) |
JCounter | operator- (register unsigned long right) |
JCounter | operator * (register unsigned long right) |
JCounter | operator/ (register unsigned long right) |
operator unsigned long () const | |
void | setMax (register unsigned long maximum) |
void | set (register unsigned long value) |
Protected Methods | |
void | JCounter::check () |
unsigned long | JCounter::verify (_int64 value) |
JCounter | JCounter::add (register unsigned long right, register unsigned long maximum) |
JCounter | JCounter::substract (register unsigned long right, register unsigned long maximum) |
JCounter | JCounter::multiply (register unsigned long right, register unsigned long maximum) |
JCounter | JCounter::divideBy (register unsigned long right, register unsigned long maximum) |
Static Protected Methods | |
unsigned long | JCounter::verify (_int64 value, register unsigned long maximum) |
Private Methods | |
__inline | JCounter (ULONG init=0) |
__inline | JCounter (const JCounter &src) |
__inline | ~JCounter () |
__inline const JCounter & | operator= (const JCounter &src) |
__inline const JCounter & | operator+= (const JCounter &src) |
__inline const JCounter & | operator-= (const JCounter &src) |
__inline const JCounter & | operator+= (ULONG v) |
__inline const JCounter & | operator-= (ULONG v) |
__inline const JCounter & | operator++ () |
__inline const JCounter & | operator-- () |
__inline const JCounter & | operator++ (int) |
__inline const JCounter & | operator-- (int) |
__inline const JCounter & | operator~ () |
__inline const JCounter & | operator! () |
__inline ULONG | operator() () |
__inline bool | operator== (const JCounter &src) |
__inline bool | operator!= (const JCounter &src) |
__inline bool | operator> (const JCounter &src) |
__inline bool | operator>= (const JCounter &src) |
__inline bool | operator< (const JCounter &src) |
__inline bool | operator<= (const JCounter &src) |
__inline bool | operator== (ULONG v) |
__inline bool | operator> (ULONG v) |
__inline bool | operator>= (ULONG v) |
__inline bool | operator< (ULONG v) |
__inline bool | operator<= (ULONG v) |
Private Attributes | |
unsigned long | count |
unsigned long | max |
Friends | |
ostream & | operator<< (ostream &os, JCounter &right) |
istream & | operator>> (istream &is, JCounter &right) |
bool | operator== (register unsigned long left, const JCounter &right) |
bool | operator!= (register unsigned long left, const JCounter &right) |
bool | operator> (register unsigned long left, const JCounter &right) |
bool | operator>= (register unsigned long left, const JCounter &right) |
bool | operator< (register unsigned long left, const JCounter &right) |
bool | operator<= (register unsigned long left, const JCounter &right) |
JCounter | JCounter::operator+ (register unsigned long left, const JCounter &right) |
JCounter | JCounter::operator- (register unsigned long left, const JCounter &right) |
JCounter | JCounter::operator * (register unsigned long left, const JCounter &right) |
JCounter | JCounter::operator/ (register unsigned long left, const JCounter &right) |
|
Definition at line 7 of file JCounter.hpp. Referenced by JCounter::add(), JCounter::divideBy(), JCounter::multiply(), JCounter::operator *(), JCounter::operator+(), JCounter::operator-(), JCounter::operator/(), and JCounter::substract().
00007 : cnt( init ) { } |
|
Definition at line 8 of file JCounter.hpp. |
|
Definition at line 9 of file JCounter.hpp. 00009 { } |
|
Definition at line 7 of file JCounter.cpp. |
|
|
|
|
|
Definition at line 179 of file JCounter.hpp. |
|
Definition at line 157 of file JCounter.hpp. 00158 { 00159 count = ( ( count >= max ) ? max : count ); 00160 } |
|
Definition at line 197 of file JCounter.hpp. |
|
Definition at line 191 of file JCounter.hpp. |
|
Definition at line 185 of file JCounter.hpp. |
|
Definition at line 170 of file JCounter.hpp. 00171 { 00172 if ( value <= 0 ) return 0; 00173 if ( value >= maximum ) return maximum; 00174 00175 return (ULONG)value; 00176 } |
|
Definition at line 162 of file JCounter.hpp. 00163 { 00164 if ( value <= 0 ) return 0; 00165 if ( value >= max ) return max; 00166 00167 return (ULONG)value; 00168 } |
|
Definition at line 144 of file JCounter.cpp. 00144 { return multiply( right, max ); } |
|
Definition at line 132 of file JCounter.cpp. |
|
Definition at line 139 of file JCounter.hpp. 00140 { 00141 return count; 00142 } |
|
|
|
Definition at line 30 of file JCounter.hpp. 00030 { cnt = 0; return *this; } |
|
Definition at line 115 of file JCounter.cpp. 00115 { return (count != v); } |
|
|
|
Definition at line 36 of file JCounter.hpp. |
|
|
|
Definition at line 32 of file JCounter.hpp. 00032 { return cnt; } |
|
Definition at line 142 of file JCounter.cpp. 00142 { return add( right, max ); } |
|
Definition at line 122 of file JCounter.cpp. |
|
|
|
|
|
Definition at line 23 of file JCounter.hpp. 00023 { cnt++; return *this; } |
|
Definition at line 19 of file JCounter.hpp. 00019 { ++cnt; return *this; } |
|
Definition at line 48 of file JCounter.cpp. 00049 { 00050 count = verify( count + v ); 00051 return *this; 00052 } |
|
|
|
Definition at line 15 of file JCounter.hpp. 00015 { cnt += v; return *this; } |
|
Definition at line 12 of file JCounter.hpp. |
|
Definition at line 143 of file JCounter.cpp. 00143 { return substract( right, max ); } |
|
Definition at line 127 of file JCounter.cpp. |
|
|
|
|
|
Definition at line 24 of file JCounter.hpp. 00024 { cnt--; return *this; } |
|
Definition at line 20 of file JCounter.hpp. 00020 { --cnt; return *this; } |
|
Definition at line 54 of file JCounter.cpp. 00055 { 00056 count = verify( count - v ); 00057 return *this; 00058 } |
|
|
|
Definition at line 16 of file JCounter.hpp. 00016 { cnt -= v; return *this; } |
|
Definition at line 13 of file JCounter.hpp. |
|
Definition at line 145 of file JCounter.cpp. 00145 { return divideBy( right, max ); } |
|
Definition at line 137 of file JCounter.cpp. |
|
Definition at line 118 of file JCounter.cpp. 00118 { return (count < v); } |
|
|
|
Definition at line 45 of file JCounter.hpp. 00045 { return (cnt < v); } |
|
Definition at line 39 of file JCounter.hpp. |
|
Definition at line 119 of file JCounter.cpp. 00119 { return (count <= v); } |
|
|
|
Definition at line 46 of file JCounter.hpp. 00046 { return (cnt <= v); } |
|
Definition at line 40 of file JCounter.hpp. |
|
Definition at line 28 of file JCounter.cpp. 00029 { 00030 count = value; 00031 check(); 00032 return *this; 00033 } |
|
|
|
Definition at line 11 of file JCounter.hpp. |
|
Definition at line 114 of file JCounter.cpp. 00114 { return (count == v); } |
|
|
|
Definition at line 42 of file JCounter.hpp. 00042 { return (cnt == v); } |
|
Definition at line 35 of file JCounter.hpp. |
|
Definition at line 116 of file JCounter.cpp. 00116 { return (count > v); } |
|
|
|
Definition at line 43 of file JCounter.hpp. 00043 { return (cnt > v); } |
|
Definition at line 37 of file JCounter.hpp. |
|
Definition at line 117 of file JCounter.cpp. 00117 { return (count >= v); } |
|
|
|
Definition at line 44 of file JCounter.hpp. 00044 { return (cnt >= v); } |
|
Definition at line 38 of file JCounter.hpp. |
|
|
|
Definition at line 27 of file JCounter.hpp. 00027 { cnt = (ULONG)(~0); return *this; } |
|
Definition at line 150 of file JCounter.hpp. 00151 { 00152 count = verify( (_int64)value ); 00153 } |
|
Definition at line 145 of file JCounter.hpp. 00146 { 00147 max = maximum; 00148 } |
|
Definition at line 124 of file JCounter.hpp. |
|
Definition at line 112 of file JCounter.hpp. |
|
Definition at line 118 of file JCounter.hpp. |
|
Definition at line 130 of file JCounter.hpp. |
|
Definition at line 105 of file JCounter.hpp. 00105 { return ( left != right.count ); } |
|
Definition at line 108 of file JCounter.hpp. 00108 { return ( left < right.count ); } |
|
Definition at line 89 of file JCounter.hpp. 00090 { 00091 return os << right.count; 00092 } |
|
Definition at line 109 of file JCounter.hpp. 00109 { return ( left <= right.count ); } |
|
Definition at line 104 of file JCounter.hpp. 00104 { return ( left == right.count ); } |
|
Definition at line 106 of file JCounter.hpp. 00106 { return ( left > right.count ); } |
|
Definition at line 107 of file JCounter.hpp. 00107 { return ( left >= right.count ); } |
|
Definition at line 94 of file JCounter.hpp. 00095 { 00096 return is >> right.count; 00097 } |
|
Definition at line 205 of file JCounter.hpp. Referenced by JCounter::operator *(), JCounter::operator+(), JCounter::operator-(), JCounter::operator/(), operator *(), operator!=(), operator+(), operator-(), operator/(), operator<(), operator<<(), operator<=(), operator==(), operator>(), operator>=(), and operator>>().
|
|
Definition at line 206 of file JCounter.hpp. Referenced by JCounter::operator *(), JCounter::operator+(), JCounter::operator-(), JCounter::operator/(), operator *(), operator+(), operator-(), and operator/().
|