#include <MaceKey.h>


Definition at line 1076 of file MaceKey.h.
Public Member Functions | |
| int | sign () |
| returns the sign of the MaceKeyDiff | |
| bool | isPositive () |
| Returns sign() > 0. | |
| bool | isNegative () |
| Returns sign() < 0. | |
| bool | isZero () |
| Returns sign() == 0. | |
| MaceKeyDiff & | abs () |
| modifies *this to be its unsigned value. | |
| MaceKeyDiff & | toSigned () |
| modifies *this to be signed. | |
| MaceKeyDiff & | toUnsigned () |
| modifies *this to be unsigned. | |
| MaceKeyDiff & | operator= (const MaceKeyDiff &) |
| standard assignment | |
| bool | operator< (const MaceKeyDiff &) const |
| standard less than | |
| bool | operator> (const MaceKeyDiff &right) const |
| standard greater than | |
| bool | operator== (const MaceKeyDiff &) const |
| standard equality check | |
| bool | operator<= (const MaceKeyDiff &right) const |
| standard less than or equal | |
| bool | operator>= (const MaceKeyDiff &right) const |
| standard greater than or equal | |
| MaceKeyDiff | operator>> (int bits) const |
| standard bit shifting | |
| MaceKeyDiff | operator+ (const MaceKeyDiff &) const |
| add a MaceKeyDiff to another | |
| MaceKeyDiff | operator- (const MaceKeyDiff &) const |
| subtract a MaceKeyDiff from another | |
| MaceKeyDiff | operator+ (uint32_t) const |
| add an unsigned int to a MaceKeyDiff | |
| MaceKeyDiff | operator- (uint32_t) const |
| subtract an unsigned int from a MaceKeyDiff | |
Static Public Attributes | |
| static MaceKeyDiff | NEG_INF = mace::MaceKeyDiff(_NEG_INFINITY) |
| basic helper for a NEG_INF MaceKeyDiff | |
| static MaceKeyDiff | INF = mace::MaceKeyDiff(_INFINITY) |
| basic helper for an INF MaceKeyDiff | |
Friends | |
| MaceKey | operator- (const MaceKey &to, const MaceKeyDiff &from) throw (InvalidMaceKeyException) |
| subtracts a MaceKeyDiff from a MaceKey | |
| MaceKey | operator+ (const MaceKey &to, const MaceKeyDiff &from) throw (InvalidMaceKeyException) |
| adds a MaceKeyDiff to a MaceKey | |
| int mace::MaceKeyDiff::sign | ( | ) |
returns the sign of the MaceKeyDiff
Note: unsigned diffs can only return 1 or 0.
Definition at line 286 of file MaceKey.cc.
Referenced by abs(), isNegative(), isPositive(), isZero(), operator<(), and operator<=().
| MaceKeyDiff & mace::MaceKeyDiff::abs | ( | ) |
modifies *this to be its unsigned value.
No-op for 0, inf, or unsigned diffs. -inf becomes +inf. For signed values, do nothing if sign() >= 0, otherwise do complement plus one.
Definition at line 299 of file MaceKey.cc.
References sign().
| MaceKeyDiff& mace::MaceKeyDiff::toSigned | ( | ) | [inline] |
modifies *this to be signed.
Note: no-op unless type is unsigned, then set type to signed. No content changes. It's like a cast.
Definition at line 1122 of file MaceKey.h.
Referenced by operator<(), and operator<=().
| MaceKeyDiff& mace::MaceKeyDiff::toUnsigned | ( | ) | [inline] |
1.5.5