27 #if !SYS_IS_GCC_GE(4,7)
32 #endif // GCC 4.7+ crashes in some cases with UT_Hash as a small object.
38 UT_Hash(
const UT_Hash &) =
delete;
39 UT_Hash &
operator=(
const UT_Hash &) =
delete;
50 virtual int compare(
const UT_Hash &
a)
const = 0;
53 virtual void copy(
const UT_Hash &a) = 0;
57 virtual unsigned hash()
const = 0;
59 virtual UT_Hash*
copy()
const = 0;
85 void copy(
const UT_Hash &
a)
override
88 myData = strdup(static_cast<const UT_Hash_String &>(a).myData);
91 unsigned hash()
const override
96 UT_Hash*
copy()
const override
103 return (inclusive ?
sizeof(*
this) : 0)
104 + (::strlen(myData) + 1) *
sizeof(
char);
121 myKey = (unsigned) a;
122 myKey = SYSwang_inthash(myKey);
134 void copy(
const UT_Hash &
a)
override
152 return inclusive ?
sizeof(*this) : 0;
166 myKey = SYSwang_inthash64(myKey);
178 void copy(
const UT_Hash &
a)
override
196 return inclusive ?
sizeof(*this) : 0;
202 class SYS_DEPRECATED_REPLACE(16.0, "SYShash<
void *>
") UT_API UT_Hash_Ptr : public UT_Hash {
206 UT_Hash_Ptr( const void *p )
211 ~UT_Hash_Ptr() override
215 int compare(const UT_Hash &a) const override
217 return !(myData==((const UT_Hash_Ptr&)a).myData);
220 void copy(const UT_Hash &a) override
222 myData = static_cast<const UT_Hash_Ptr &>(a).myData;
225 unsigned hash() const override
228 key = SYSpointerHash(myData);
229 key = SYSwang_inthash(key);
233 UT_Hash* copy() const override
235 return new UT_Hash_Ptr(myData);
238 int64 getMemoryUsage(bool inclusive) const override
240 return inclusive ? sizeof(*this) : 0;
244 template <typename T>
245 const T *asPointer() const { return (const T *)(myData); }
248 operator const void *() const
252 operator void *() const
254 return const_cast<void *>(myData);
258 class SYS_DEPRECATED_REPLACE(16.0, "SYShash<const void *>
") UT_API
259 UT_Hash_Const_Ptr : public UT_Hash {
263 UT_Hash_Const_Ptr( const void *p ) : myData(p)
267 ~UT_Hash_Const_Ptr() override
271 int compare(const UT_Hash &a) const override
273 return !(myData==((const UT_Hash_Const_Ptr&)a).myData);
276 void copy(const UT_Hash &a) override
278 myData = static_cast<const UT_Hash_Const_Ptr &>(a).myData;
281 unsigned hash() const override
284 key = SYSpointerHash(myData);
285 key = SYSwang_inthash(key);
289 UT_Hash* copy() const override
291 return new UT_Hash_Const_Ptr(myData);
294 int64 getMemoryUsage(bool inclusive) const override
296 return inclusive ? sizeof(*this) : 0;
300 SYS_DEPRECATED_POP_DISABLE()
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
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()
GLsizei const GLchar *const * string
UT_Hash_String(const char *s)
void copy(const UT_Hash &a) override
GLboolean GLboolean GLboolean GLboolean a
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
unsigned hash() const override
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
LeafData & operator=(const LeafData &)=delete
virtual ~UT_Hash()=default
~UT_Hash_String() override
int compare(const UT_Hash &a) const override
int64 getMemoryUsage(bool inclusive) const override