27 #ifndef __AnsiBasedTypes__ 28 #include "AnsiBasedTypes.h" 31 #include "K2TypeTraits.h" 76 typedef int32 difference_type;
77 typedef uint32 value_type;
79 constexpr
IDType() noexcept : fIDInt(0) {}
87 constexpr
IDType(value_type sourceInt) noexcept : fIDInt(sourceInt) {}
88 IDType& operator=(
const value_type& sourceInt) noexcept {fIDInt = sourceInt;
return *
this;}
90 bool operator>(
const IDType& rhs)
const noexcept {
return fIDInt > rhs.fIDInt; }
91 bool operator>(
const value_type& rhs)
const noexcept {
return fIDInt > rhs; }
92 friend bool operator>(
const value_type& lhs,
const IDType<T>& rhs) noexcept {
return lhs > rhs.fIDInt; }
94 bool operator<(
const IDType& rhs)
const noexcept {
return fIDInt < rhs.fIDInt; }
95 bool operator<(
const value_type& rhs)
const noexcept {
return fIDInt < rhs; }
96 friend bool operator<(const value_type& lhs, const IDType<T>& rhs) noexcept {
return lhs < rhs.fIDInt; }
98 bool operator<=(
const IDType& rhs)
const noexcept {
return !(fIDInt > rhs.fIDInt); }
99 bool operator<=(
const value_type& rhs)
const noexcept {
return !(fIDInt > rhs); }
100 friend bool operator<=(const value_type& lhs, const IDType<T>& rhs) noexcept {
return !(lhs > rhs.fIDInt); }
102 bool operator>=(
const IDType& rhs)
const noexcept {
return !(fIDInt < rhs.fIDInt); }
103 bool operator>=(
const value_type& rhs)
const noexcept {
return !(fIDInt < rhs); }
104 friend bool operator>=(
const value_type& lhs,
const IDType<T>& rhs) noexcept {
return !(lhs < rhs.fIDInt); }
106 bool operator==(
const IDType& rhs)
const noexcept {
return fIDInt == rhs.fIDInt; }
107 friend bool operator==(
const value_type& lhs,
const IDType<T>& rhs) noexcept {
return lhs == rhs.fIDInt; }
109 bool operator!=(
const IDType& rhs)
const noexcept {
return !(fIDInt == rhs.fIDInt); }
110 bool operator!=(
const value_type& rhs)
const noexcept {
return !(fIDInt == rhs); }
111 friend bool operator!=(
const value_type& lhs,
const IDType<T>& rhs) noexcept {
return !(lhs == rhs.fIDInt); }
113 IDType& operator+=(
const difference_type& rhs) { fIDInt += rhs;
return *
this; }
119 IDType& operator++() { *
this += 1;
return *
this; }
121 const IDType operator++(
int) {
IDType oldValue = *
this; ++(*this);
return oldValue; }
123 IDType& operator-=(
const IDType& rhs) { fIDInt -= rhs.fIDInt;
return *
this; }
124 IDType& operator-=(
const difference_type& rhs) { fIDInt -= rhs;
return *
this; }
126 friend difference_type operator-(
const IDType<T>& lhs,
const difference_type& rhs) {
return lhs.fIDInt - rhs; }
127 friend difference_type operator-(
const IDType<T>& lhs,
const IDType<T>& rhs) {
return lhs.fIDInt - rhs.fIDInt; }
130 IDType& operator--() { *
this -= 1;
return *
this; }
132 const IDType operator--(
int) {
IDType oldValue = *
this; --(*this);
return oldValue; }
134 value_type operator>>(
const int& rhs)
const {
return fIDInt >> rhs; }
135 value_type operator<<(
const int& rhs)
const {
return fIDInt << rhs; }
137 value_type operator&(
const value_type& rhs)
const {
return fIDInt & rhs; }
138 friend value_type operator&(
const value_type& lhs,
const IDType<T>& rhs) {
return IDType<T>(rhs) & lhs; }
140 value_type operator|(
const value_type& rhs) {
return fIDInt | rhs; }
141 friend value_type operator|(
const value_type& lhs,
const IDType<T>& rhs) {
return IDType<T>(rhs) | lhs; }
143 IDType& operator|=(
const value_type& rhs) { fIDInt |= rhs;
return *
this; }
146 value_type& Get() noexcept {
return fIDInt; }
147 inline const value_type& Get()
const noexcept {
return fIDInt; }
149 bool IsValid()
const noexcept {
return (fIDInt != 0); }
153 return lhs.Get() < rhs.Get();
165 inline bool operator<(const IDType<T>& lhs,
const IDType<T>& rhs) noexcept
167 return lhs.Get() < rhs.Get();
173 return lhs.Get() == rhs.Get();
178 static typename IDType<T>::value_type CONVERT(
IDType<T> arg) {
return arg.Get();}
190 typedef uint32 SBOSID;
192 constexpr SBOSID kInvalidSBOSID = 0;
251 constexpr UID kInvalidUID;
253 constexpr WidgetID kInvalidWidgetID;
255 constexpr ClassID kInvalidClass;
257 constexpr PluginID kInvalidPlugin;
259 constexpr ImplementationID kInvalidImpl;
261 constexpr ServiceID kInvalidService;
263 constexpr PMIID kInvalidInterfaceID;
265 constexpr KitViewID kInvalidKitViewID;
267 constexpr ActionID kInvalidActionID;
269 constexpr FileTypeInfoID kInvalidFileTypeInfoID;
271 constexpr ScriptElementID kInvalidScriptElementID;
273 constexpr ProductID kInvalidProdcutID;
275 constexpr AsyncUIID kInvalidAsyncUIID;
277 constexpr ScriptID kInvalidScriptID;
279 constexpr UserActionCategoryID kInvalidUserActionCategoryID;
281 constexpr InvalHandlerID kInvalidInvHandID;
283 constexpr LinkClientID kInvalidLinkClientID;
285 constexpr SnapshotID kInvalidSnapshotID;
287 constexpr LastRevInfoID kInvalidLastRevInfoID;
289 constexpr DontShowAgainID kInvalidDontShowAgainID;
294 constexpr bool16 kFalse = 0;
296 constexpr bool16 kTrue = 1;
302 #endif // __OMTypes__