2012-11-05 04:34:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
template<typename TrackedType>
|
|
|
|
class __TRACKER_NAME
|
|
|
|
{
|
|
|
|
TrackedType TrackedValue;
|
|
|
|
|
|
|
|
public:
|
2012-11-09 22:31:02 +00:00
|
|
|
inline TrackedType* operator & ()
|
|
|
|
{
|
|
|
|
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
|
|
|
return &this->TrackedValue;
|
|
|
|
}
|
2012-11-05 04:34:23 +00:00
|
|
|
|
2012-11-09 22:31:02 +00:00
|
|
|
inline TrackedType operator ++ ()
|
|
|
|
{
|
|
|
|
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
|
|
|
return ++this->TrackedValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline TrackedType operator ++ (int)
|
|
|
|
{
|
|
|
|
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
|
|
|
return this->TrackedValue++;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline TrackedType operator -- ()
|
|
|
|
{
|
|
|
|
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
|
|
|
return --this->TrackedValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline TrackedType operator -- (int)
|
|
|
|
{
|
|
|
|
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
|
|
|
return this->TrackedValue--;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline TrackedType operator = (TrackedType);
|
|
|
|
inline TrackedType operator = (__TRACKER_NAME<TrackedType>);
|
|
|
|
|
|
|
|
inline TrackedType operator += (TrackedType);
|
|
|
|
inline TrackedType operator += (__TRACKER_NAME<TrackedType>);
|
|
|
|
|
|
|
|
inline TrackedType operator -= (TrackedType);
|
|
|
|
inline TrackedType operator -= (__TRACKER_NAME<TrackedType>);
|
|
|
|
|
|
|
|
inline TrackedType operator *= (TrackedType);
|
|
|
|
inline TrackedType operator *= (__TRACKER_NAME<TrackedType>);
|
|
|
|
|
|
|
|
inline TrackedType operator /= (TrackedType);
|
|
|
|
inline TrackedType operator /= (__TRACKER_NAME<TrackedType>);
|
|
|
|
|
|
|
|
inline TrackedType operator |= (TrackedType);
|
|
|
|
inline TrackedType operator |= (__TRACKER_NAME<TrackedType>);
|
|
|
|
|
|
|
|
inline TrackedType operator &= (TrackedType);
|
|
|
|
inline TrackedType operator &= (__TRACKER_NAME<TrackedType>);
|
|
|
|
|
|
|
|
inline TrackedType operator ^= (TrackedType);
|
|
|
|
inline TrackedType operator ^= (__TRACKER_NAME<TrackedType>);
|
|
|
|
|
|
|
|
inline TrackedType operator <<= (TrackedType);
|
|
|
|
inline TrackedType operator <<= (__TRACKER_NAME<TrackedType>);
|
|
|
|
|
|
|
|
inline TrackedType operator >>= (TrackedType);
|
|
|
|
inline TrackedType operator >>= (__TRACKER_NAME<TrackedType>);
|
|
|
|
|
|
|
|
inline operator TrackedType() const;
|
2012-11-05 04:34:23 +00:00
|
|
|
};
|
|
|
|
|
2012-11-09 22:31:02 +00:00
|
|
|
#ifndef __tracker_hpp
|
|
|
|
#define __tracker_hpp
|
|
|
|
|
2012-11-05 04:34:23 +00:00
|
|
|
enum {
|
|
|
|
__TRACKER_NOOP_RIGHTHAND_EQUAL = 0,
|
|
|
|
__TRACKER_NOOP_RIGHTHAND_ZERO,
|
2012-11-09 22:31:02 +00:00
|
|
|
__TRACKER_NOOP_RIGHTHAND_ONE,
|
2012-11-05 04:34:23 +00:00
|
|
|
__TRACKER_NEVER,
|
|
|
|
};
|
|
|
|
|
2012-11-09 22:31:02 +00:00
|
|
|
#endif
|
|
|
|
|
2012-11-05 04:34:23 +00:00
|
|
|
#define __TRACKER_RIGHTHAND_TYPE __TRACKER_NAME<TrackedType> rightHand
|
|
|
|
#define __TRACKER_RIGHTHAND rightHand.TrackedValue
|
|
|
|
#include "tracker_operators.hpp"
|
|
|
|
#undef __TRACKER_RIGHTHAND_TYPE
|
|
|
|
#undef __TRACKER_RIGHTHAND
|
|
|
|
|
|
|
|
#define __TRACKER_RIGHTHAND_TYPE TrackedType rightHand
|
|
|
|
#define __TRACKER_RIGHTHAND rightHand
|
|
|
|
#include "tracker_operators.hpp"
|
|
|
|
#undef __TRACKER_RIGHTHAND_TYPE
|
|
|
|
#undef __TRACKER_RIGHTHAND
|
|
|
|
|
|
|
|
template<typename TrackedType>
|
2012-11-09 22:31:02 +00:00
|
|
|
__TRACKER_NAME<TrackedType>::operator TrackedType() const
|
2012-11-05 04:34:23 +00:00
|
|
|
{
|
|
|
|
return this->TrackedValue;
|
|
|
|
}
|