12 #ifndef __GA_AttributeHash_h__
13 #define __GA_AttributeHash_h__
31 : myIndexMap(indexmap)
34 , myNAttribs(nattribs)
37 , myHash(computeHash())
40 : myIndexMap(that.myIndexMap)
41 , myOffset(that.myOffset)
42 , myAttribs(that.myAttribs)
43 , myNAttribs(that.myNAttribs)
44 , myGroups(that.myGroups)
45 , myNGroups(that.myNGroups)
51 if (!myNGroups && !myNAttribs)
57 (myNGroups == 0 && that.myNGroups == 0));
62 if (myNGroups != that.myNGroups)
65 for (
GA_Size i = 0; i < myNGroups; ++i)
67 if (myGroups[i] != that.myGroups[i])
77 for (
GA_Size i = 0; i < myNAttribs; ++i)
82 if (compare && (!compare->
isEqual(
83 result, *attribute, off0, *that.myAttribs[i], off1) || !
result))
89 const size_t &
hash()
const {
return myHash; }
92 size_t computeHash()
const {
93 if (!myNGroups && !myNAttribs)
99 for (
GA_Size i = 0; i < myNGroups; ++i)
101 h ^= SYSwang_inthash(SYSpointerHash(myGroups[i]));
106 for (
GA_Size i = 0; i < myNAttribs; ++i)
111 h ^= SYSwang_inthash(compare->
hash(*attribute, off));
135 template <
typename ToType>
A class to manage an ordered array which has fixed offset handles.
Definition of a geometry attribute.
virtual uint hash(const GA_Attribute &a, const GA_Offset i) const
CompareResults OIIO_API compare(const ImageBuf &A, const ImageBuf &B, float failthresh, float warnthresh, float failrelative, float warnrelative, ROI roi={}, int nthreads=0)
size_t operator()(const GA_AttributeHash &key) const
**But if you need a result
GA_Detail & getDetail() const
Access the detail this index map belongs to.
exint GA_Size
Defines the bit width for index and offset types in GA.
virtual const GA_AIFCompare * getAIFCompare() const
Return the attribute's comparison interface or NULL.
const size_t & hash() const
Attribute Interface class to perform comparisons on attributes.
GLfloat GLfloat GLfloat GLfloat h
virtual bool isEqual(bool &result, const GA_Attribute &a, GA_Offset ai, const GA_Attribute &b, GA_Offset bi) const =0
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
GA_AttributeHash(const GA_AttributeHash &that)
bool operator==(const GA_AttributeHash &that) const
GA_AttributeHash(const GA_IndexMap &indexmap, const GA_Offset offset, const GA_Attribute *const *attribs, const GA_Size nattribs, const GA_ElementGroup *const *groups=NULL, const GA_Size ngroups=0)