12 #ifndef __GA_AttributeHash_h__
13 #define __GA_AttributeHash_h__
30 : myIndexMap(indexmap)
33 , myNAttribs(nattribs)
36 , myHash(computeHash())
39 : myIndexMap(that.myIndexMap)
40 , myOffset(that.myOffset)
41 , myAttribs(that.myAttribs)
42 , myNAttribs(that.myNAttribs)
43 , myGroups(that.myGroups)
44 , myNGroups(that.myNGroups)
50 if (!myNGroups && !myNAttribs)
56 (myNGroups == 0 && that.myNGroups == 0));
61 if (myNGroups != that.myNGroups)
64 for (
GA_Size i = 0; i < myNGroups; ++i)
66 if (myGroups[i] != that.myGroups[i])
76 for (
GA_Size i = 0; i < myNAttribs; ++i)
81 if (compare && (!compare->
isEqual(
82 result, *attribute, off0, *that.myAttribs[i], off1) || !
result))
88 const size_t &
hash()
const {
return myHash; }
91 size_t computeHash()
const {
92 if (!myNGroups && !myNAttribs)
98 for (
GA_Size i = 0; i < myNGroups; ++i)
100 h ^= SYSwang_inthash(SYSpointerHash(myGroups[i]));
105 for (
GA_Size i = 0; i < myNAttribs; ++i)
110 h ^= SYSwang_inthash(compare->
hash(*attribute, off));
134 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
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.
CompareResults OIIO_API compare(const ImageBuf &A, const ImageBuf &B, float failthresh, float warnthresh, ROI roi={}, int nthreads=0)
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)