27 #if !SYS_IS_GCC_GE(4,7)
32 #endif // GCC 4.7+ crashes in some cases with UT_Hash as a small object.
46 virtual int compare(
const UT_Hash &
a)
const = 0;
49 virtual void copy(
const UT_Hash &
a) = 0;
53 virtual unsigned hash()
const = 0;
55 virtual UT_Hash*
copy()
const = 0;
81 void copy(
const UT_Hash &
a)
override
84 myData = strdup(static_cast<const UT_Hash_String &>(a).myData);
87 unsigned hash()
const override
92 UT_Hash*
copy()
const override
99 return (inclusive ?
sizeof(*
this) : 0)
100 + (::strlen(myData) + 1) *
sizeof(
char);
117 myKey = (unsigned) a;
118 myKey = SYSwang_inthash(myKey);
130 void copy(
const UT_Hash &
a)
override
148 return inclusive ?
sizeof(*this) : 0;
162 myKey = SYSwang_inthash64(myKey);
174 void copy(
const UT_Hash &
a)
override
192 return inclusive ?
sizeof(*this) : 0;
198 class SYS_DEPRECATED_REPLACE(16.0, "SYShash<
void *>
") UT_API UT_Hash_Ptr : public UT_Hash {
202 UT_Hash_Ptr( const void *p )
207 ~UT_Hash_Ptr() override
211 int compare(const UT_Hash &a) const override
213 return !(myData==((const UT_Hash_Ptr&)a).myData);
216 void copy(const UT_Hash &a) override
218 myData = static_cast<const UT_Hash_Ptr &>(a).myData;
221 unsigned hash() const override
224 key = SYSpointerHash(myData);
225 key = SYSwang_inthash(key);
229 UT_Hash* copy() const override
231 return new UT_Hash_Ptr(myData);
234 int64 getMemoryUsage(bool inclusive) const override
236 return inclusive ? sizeof(*this) : 0;
240 template <typename T>
241 const T *asPointer() const { return (const T *)(myData); }
244 operator const void *() const
248 operator void *() const
250 return const_cast<void *>(myData);
254 class SYS_DEPRECATED_REPLACE(16.0, "SYShash<const void *>
") UT_API
255 UT_Hash_Const_Ptr : public UT_Hash {
259 UT_Hash_Const_Ptr( const void *p ) : myData(p)
263 ~UT_Hash_Const_Ptr() override
267 int compare(const UT_Hash &a) const override
269 return !(myData==((const UT_Hash_Const_Ptr&)a).myData);
272 void copy(const UT_Hash &a) override
274 myData = static_cast<const UT_Hash_Const_Ptr &>(a).myData;
277 unsigned hash() const override
280 key = SYSpointerHash(myData);
281 key = SYSwang_inthash(key);
285 UT_Hash* copy() const override
287 return new UT_Hash_Const_Ptr(myData);
290 int64 getMemoryUsage(bool inclusive) const override
292 return inclusive ? sizeof(*this) : 0;
296 SYS_DEPRECATED_POP_DISABLE()
UT_Hash * copy() const override
#define UT_SMALLOBJECT_PAGESIZE_DEFAULT
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
void copy(const UT_Hash &a) override
~UT_Hash_Int64() override
unsigned hash() const override
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
#define SYS_DEPRECATED_PUSH_DISABLE()
UT_Hash_String(const char *s)
void copy(const UT_Hash &a) override
const char * getString() const
int64 getMemoryUsage(bool inclusive) const override
unsigned long long uint64
UT_Hash * copy() const override
unsigned hash() const override
int compare(const UT_Hash &a) const override
#define SYS_DEPRECATED_REPLACE(__V__, __R__)
CompareResults OIIO_API compare(const ImageBuf &A, const ImageBuf &B, float failthresh, float warnthresh, ROI roi={}, int nthreads=0)
SYS_FORCE_INLINE uint32 hash() const
#define UT_SMALLOBJECT_THREADSAFE_ON
UT_Hash * copy() const override
GLboolean GLboolean GLboolean GLboolean a
GLsizei const GLchar *const * string
unsigned hash() const override
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
int compare(const UT_Hash &a) const override
int64 getMemoryUsage(bool inclusive) const override
int64 getMemoryUsage(bool inclusive) const override
unsigned hash() const override
void copy(const UT_Hash &a) override
#define UT_SMALLOBJECT_CLEANPAGES_DEFAULT
~UT_Hash_String() override
int compare(const UT_Hash &a) const override
int64 getMemoryUsage(bool inclusive) const override