2012-11-05 04:34:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
template<typename TrackedType>
|
2014-11-22 12:32:56 +00:00
|
|
|
class TRACKER_NAME_
|
2012-11-05 04:34:23 +00:00
|
|
|
{
|
2012-11-15 06:42:00 +00:00
|
|
|
public:
|
2012-11-05 04:34:23 +00:00
|
|
|
TrackedType TrackedValue;
|
|
|
|
|
2012-11-09 22:31:02 +00:00
|
|
|
inline TrackedType* operator & ()
|
|
|
|
{
|
2014-11-22 12:32:56 +00:00
|
|
|
TRACKER_GLOBAL_HOOK_((uintptr_t)&this->TrackedValue);
|
2012-11-09 22:31:02 +00:00
|
|
|
return &this->TrackedValue;
|
|
|
|
}
|
2012-11-05 04:34:23 +00:00
|
|
|
|
2012-11-09 22:31:02 +00:00
|
|
|
inline TrackedType operator ++ ()
|
|
|
|
{
|
2014-11-22 12:32:56 +00:00
|
|
|
TRACKER_GLOBAL_HOOK_((uintptr_t)&this->TrackedValue);
|
2012-11-09 22:31:02 +00:00
|
|
|
return ++this->TrackedValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline TrackedType operator ++ (int)
|
|
|
|
{
|
2014-11-22 12:32:56 +00:00
|
|
|
TRACKER_GLOBAL_HOOK_((uintptr_t)&this->TrackedValue);
|
2012-11-09 22:31:02 +00:00
|
|
|
return this->TrackedValue++;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline TrackedType operator -- ()
|
|
|
|
{
|
2014-11-22 12:32:56 +00:00
|
|
|
TRACKER_GLOBAL_HOOK_((uintptr_t)&this->TrackedValue);
|
2012-11-09 22:31:02 +00:00
|
|
|
return --this->TrackedValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline TrackedType operator -- (int)
|
|
|
|
{
|
2014-11-22 12:32:56 +00:00
|
|
|
TRACKER_GLOBAL_HOOK_((uintptr_t)&this->TrackedValue);
|
2012-11-09 22:31:02 +00:00
|
|
|
return this->TrackedValue--;
|
|
|
|
}
|
|
|
|
|
2019-04-08 06:27:48 +00:00
|
|
|
template <typename RightHandType>
|
|
|
|
inline TrackedType operator = (RightHandType);
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-04-08 06:27:48 +00:00
|
|
|
template <typename RightHandType>
|
|
|
|
inline TrackedType operator += (RightHandType);
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-04-08 06:27:48 +00:00
|
|
|
template <typename RightHandType>
|
|
|
|
inline TrackedType operator -= (RightHandType);
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-04-08 06:27:48 +00:00
|
|
|
template <typename RightHandType>
|
|
|
|
inline TrackedType operator *= (RightHandType);
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-04-08 06:27:48 +00:00
|
|
|
template <typename RightHandType>
|
|
|
|
inline TrackedType operator /= (RightHandType);
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-04-08 06:27:48 +00:00
|
|
|
template <typename RightHandType>
|
|
|
|
inline TrackedType operator |= (RightHandType);
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-04-08 06:27:48 +00:00
|
|
|
template <typename RightHandType>
|
|
|
|
inline TrackedType operator &= (RightHandType);
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-04-08 06:27:48 +00:00
|
|
|
template <typename RightHandType>
|
|
|
|
inline TrackedType operator ^= (RightHandType);
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-04-08 06:27:48 +00:00
|
|
|
template <typename RightHandType>
|
|
|
|
inline TrackedType operator <<= (RightHandType);
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-04-08 06:27:48 +00:00
|
|
|
template <typename RightHandType>
|
|
|
|
inline TrackedType operator >>= (RightHandType);
|
2012-11-09 22:31:02 +00:00
|
|
|
|
|
|
|
inline operator TrackedType() const;
|
2012-11-26 08:26:04 +00:00
|
|
|
|
|
|
|
inline TrackedType cast() const;
|
2012-11-05 04:34:23 +00:00
|
|
|
};
|
|
|
|
|
2014-11-22 12:32:56 +00:00
|
|
|
#ifndef tracker_hpp_
|
|
|
|
#define tracker_hpp_
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2012-11-05 04:34:23 +00:00
|
|
|
enum {
|
2014-11-22 12:32:56 +00:00
|
|
|
TRACKER_NOOP_RIGHTHAND_EQUAL_ = 0,
|
|
|
|
TRACKER_NOOP_RIGHTHAND_ZERO_,
|
|
|
|
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
|
|
|
#include "tracker_operators.hpp"
|
|
|
|
|
|
|
|
template<typename TrackedType>
|
2014-11-22 12:32:56 +00:00
|
|
|
inline TRACKER_NAME_<TrackedType>::operator TrackedType() const
|
2012-11-05 04:34:23 +00:00
|
|
|
{
|
|
|
|
return this->TrackedValue;
|
|
|
|
}
|
2012-11-26 08:26:04 +00:00
|
|
|
|
|
|
|
template<typename TrackedType>
|
2014-11-22 12:32:56 +00:00
|
|
|
inline TrackedType TRACKER_NAME_<TrackedType>::cast() const
|
2012-11-26 08:26:04 +00:00
|
|
|
{
|
|
|
|
return this->TrackedValue;
|
|
|
|
}
|
2018-01-13 22:15:07 +00:00
|
|
|
|
|
|
|
template <typename TrackedType>
|
|
|
|
struct is_signed<TRACKER_NAME_<TrackedType>>
|
|
|
|
{
|
|
|
|
static constexpr bool value = std::is_signed<TrackedType>::value;
|
|
|
|
};
|
|
|
|
template <typename TrackedType>
|
|
|
|
struct is_unsigned<TRACKER_NAME_<TrackedType>>
|
|
|
|
{
|
|
|
|
static constexpr bool value = std::is_unsigned<TrackedType>::value;
|
|
|
|
};
|