12 #ifndef _OP_Depdency_h_
13 #define _OP_Depdency_h_
36 myRefOpId = ref_op_id;
48 if( myRefCount >=
count )
63 return SYSwang_inthash(myRefOpId);
67 return myRefOpId == other.myRefOpId;
94 myRefOpId = ref_op_id;
96 myInterestType = interest;
97 mySourceRef = source_ref;
109 return myInterestType;
115 return (myRefOpId == ref_op_id && myRef.matches(ref)
116 && hasInterest(
mask));
122 return myRefOpId == ref_op_id && mySourceRef == source_ref &&
123 myRef == ref && hasInterest(
mask);
127 uint h = SYSwang_inthash(myRefOpId);
128 h = h * 37 + SYSwang_inthash(myInterestType);
129 h = h * 37 + mySourceRef.hash();
130 h = h * 37 + myRef.hash();
136 return matches( other.myRefOpId, other.mySourceRef, other.myRef );
142 if (!mySourceRef.isValid())
145 if (mySourceRef.getParmRef() == removed_parm_idx)
148 mySourceRef.setParmRef(-1, -1);
151 else if (mySourceRef.getParmRef() > removed_parm_idx)
153 mySourceRef.setParmRef(mySourceRef.getParmRef() - 1,
154 mySourceRef.getParmSubIndex());
166 {
return (myInterestType & interest) != 0; }
195 int64 mem = inclusive ?
sizeof(*this) : 0;
217 int getRefOpId()
const
220 return myList(0).getRefOpId();
239 bool isEmpty()
const {
return myEntries == 0; }
268 : myOwner(it.myOwner)
269 , myNodeCache(it.myNodeCache)
270 , myNodeIterator(it.myNodeIterator)
271 , myListIterator(it.myListIterator)
278 return *myListIterator;
282 return *myListIterator;
291 myOwner = cmp.myOwner;
292 myNodeCache = cmp.myNodeCache;
293 myNodeIterator = cmp.myNodeIterator;
294 myListIterator = cmp.myListIterator;
309 return myOwner == cmp.myOwner &&
310 myNodeIterator == cmp.myNodeIterator &&
311 myListIterator == cmp.myListIterator &&
312 myNodeCache == cmp.myNodeCache;
316 return !(*
this ==
cmp);
320 myListIterator.advance();
321 while (myListIterator.atEnd())
324 if (myNodeIterator.atEnd())
326 myListIterator = getDependencyNode()->
rbegin();
332 const auto &dep_map = myOwner->myDependencyMap;
335 for (
const auto &node : dep_map.mapped_range())
337 if (!node->isEmpty())
338 myNodeCache.
append(node.get());
340 myNodeIterator = myNodeCache.
begin();
341 if (!myNodeIterator.atEnd())
343 myListIterator = getDependencyNode()->
rbegin();
353 return myNodeIterator.atEnd() && myListIterator.atEnd();
367 return myNodeIterator.item();
371 return myListIterator;
376 NodeCache myNodeCache;
400 #endif // _OP_Depdency_h_
int operator==(const OP_Dependency &other) const
OP_Dependency(int ref_op_id, const PRM_RefId &source_ref, const PRM_RefId &ref, OP_InterestType interest)
reverse_iterator & operator++(int)
const PRM_RefId & getRefId() const
int64 getMemoryUsage(bool inclusive) const
int matches(int ref_op_id, const PRM_RefId &ref, OP_InterestType mask=OP_INTEREST_ALL) const
friend class reverse_iterator
void append(const OP_Dependency &v)
const_iterator end() const
reverse_iterator(const reverse_iterator &it)
reverse_iterator const_iterator
void setRefOpId(int op_id)
int64 getMemoryUsage(bool inclusive=false) const
UT_Array< OP_Dependency >::reverse_iterator reverse_iterator
int hasInterest(OP_InterestType interest) const
const_iterator end() const
OP_Dependency * operator->() const
IMATH_HOSTDEVICE constexpr int cmp(T a, T b) IMATH_NOEXCEPT
void append(const OP_Dependency &v)
void setRefOpId(int op_id)
int removeMatching(int ref_op_id, OP_InterestType mask)
int removeRef(int count=1)
reverse_iterator rbegin()
Begin iterating over the array in reverse.
OP_InterestType getInterestType() const
reverse_iterator rend() const
reverse_iterator & operator++()
base_iterator< OP_DependencyNode *, true > iterator
OP_DependencyList & operator=(const OP_DependencyList &src)
OP_Dependency & operator*() const
void setCapacityIfNeeded(exint min_capacity)
int operator==(const OP_Reference &other)
void removeItem(const reverse_iterator &it)
OP_InterestType getInterest() const
reverse_iterator rend()
End reverse iterator.
bool fixRemovedSourceRefParmIndex(int removed_parm_idx)
reverse_iterator & operator=(const reverse_iterator &cmp)
bool operator!=(const reverse_iterator &cmp) const
exint entries() const
Alias of size(). size() is preferred.
void addInterest(OP_InterestType type)
UT_Array< OP_Dependency >::iterator iterator
GLfloat GLfloat GLfloat GLfloat h
bool operator==(const reverse_iterator &cmp) const
reverse_iterator rbegin()
int64 getMemoryUsage(bool inclusive) const
reverse_iterator rbegin() const
OP_Reference(int ref_op_id)
LeafData & operator=(const LeafData &)=delete
OP_Dependency * find(int ref_op_id, const PRM_RefId &source_ref, const PRM_RefId &ref_id) const
Find a dependency for the given criteria.
void removeItem(const reverse_iterator &it)
Remove item specified by the reverse_iterator.
OP_DependencyNode(const OP_DependencyNode &src)
OP_Dependency & getDependency() const
const PRM_RefId & getSourceRefId() const
const_iterator begin() const
UT_Array< OP_Dependency >::const_iterator const_iterator
void removeItem(const reverse_iterator &it)
UT_Array< OP_Reference > OP_ReferenceList
const_iterator begin() const
iterator end()
End iterator.
int matches(int ref_op_id, const PRM_RefId &source_ref, const PRM_RefId &ref, OP_InterestType mask=OP_INTEREST_ALL) const