34 : myNumericValue( id_number ) {}
43 constexpr
explicit operator bool()
const
49 {
return myNumericValue == other.myNumericValue; }
51 {
return myNumericValue != other.myNumericValue; }
58 {
return myNumericValue < other.myNumericValue; }
60 {
return myNumericValue <= other.myNumericValue; }
62 {
return myNumericValue > other.myNumericValue; }
64 {
return myNumericValue >= other.myNumericValue; }
70 return myNumericValue;
77 return static_cast<exint>( myNumericValue );
98 #define UNI_ID_SUBCLASS( SubClass ) \
99 class SubClass : public UNI_ID \
102 constexpr explicit SubClass( NumericType id = INVALID_ID ) \
104 constexpr explicit SubClass( const UNI_ID &id ) \
108 using SubClass##List = UT_Array< SubClass >; \
126 #define UNI_ID_FORMATTER(UniID) \
128 UTformatBuffer(char *buffer, size_t buffer_size, const UniID &v) \
130 UT::Format::Writer w(buffer, buffer_size); \
131 UT::Format::Formatter f; \
132 return f.format(w, #UniID "({})", {v.exintValue()}); \
135 UTformatBuffer(char *buffer, size_t buffer_size, const UT_Array<UniID> &v) \
137 UT::Format::Writer w(buffer, buffer_size); \
138 UT::Format::Formatter f; \
139 size_t bytesWritten = w( \
140 "UT_Array<" #UniID ">([", \
141 sizeof("UT_Array<" #UniID ">([") - 1); \
143 for (auto &&item : v) \
145 bytesWritten += f.format( \
146 w, first ? "{}" : ", {}", {item.exintValue()}); \
149 bytesWritten += w("])", 2); \
150 return bytesWritten; \
168 template <
typename T>
struct DefaultClearer;
176 static const bool clearNeedsDestruction =
false;
179 #define UNI_ID_CLEARER(ID) \
180 template <> struct DefaultClearer<ID> : public DefaultClearer<UNI_ID> {}; \
#define SYS_STATIC_ASSERT(expr)
constexpr size_t SYShash(const SYS_Flicks f)
constexpr void clear()
Resets the ID to an invalid value.
constexpr UNI_ID(NumericType id_number=INVALID_ID)
Explicit constructor.
static void clearConstruct(UNI_ID *p)
exint NumericType
Numerical representation of the ID.
friend size_t hash_value(const UNI_ID &id)
Hash function for use of UNI_ID as a key in the UT_Map class.
constexpr bool operator>(const UNI_ID &other) const
Remaining comparison operators, used for sorting, etc.
#define UNI_ID_CLEARER(ID)
static bool isClear(const UNI_ID &v)
constexpr bool operator<=(const UNI_ID &other) const
Remaining comparison operators, used for sorting, etc.
static void clear(UNI_ID &v)
constexpr bool operator>=(const UNI_ID &other) const
Remaining comparison operators, used for sorting, etc.
#define UNI_ID_FORMATTER(UniID)
String formatting ID for debug printouts, etc:
constexpr bool operator<(const UNI_ID &other) const
Remaining comparison operators, used for sorting, etc.
constexpr bool isValid() const
Returns true if this ID is valid; false otherwise.
constexpr exint exintValue() const
Returns an exint value of this ID.
constexpr bool operator==(const UNI_ID &other) const
Comparison operators.
constexpr NumericType numericValue() const
Returns the numeric value of this ID.
#define UNI_ID_SUBCLASS(SubClass)
An ID for referencing the specific UNI graph elements.
constexpr bool operator!=(const UNI_ID &other) const
Comparison operators.
static constexpr NumericType INVALID_ID