11 #ifndef __GA_PrimitiveTracker__
12 #define __GA_PrimitiveTracker__
48 if (that.myEntries > myEntries)
50 for (
int id = 0;
id < that.myEntries; ++
id)
51 myCounts[
id] += that.myCounts[
id];
65 int maxentries =
SYSmax(orig.myEntries, changed.myEntries);
66 if (maxentries > myEntries)
68 for (
int id = 0;
id < maxentries; ++
id)
69 myCounts[
id] += ((
id < changed.myEntries) ? changed.myCounts[
id] : 0)
70 - ((
id < orig.myEntries) ? orig.myCounts[
id] : 0);
87 return id >= myEntries ?
false : myCounts[
id] > 0;
91 for (
int id = 0;
id < myEntries;
id++)
98 for (
auto && allow : allowed)
100 if (allow.get() ==
id)
114 return id >= myEntries ? 0 : myCounts[
id];
171 if (myEntries != that.myEntries)
173 grow(that.myEntries);
175 for (
int i = 0,
n = myEntries; i <
n; ++i)
177 myCounts[i] = that.myCounts[i];
196 int64 mem = inclusive ?
sizeof(*this) : 0;
198 mem += myEntries *
sizeof(myCounts[0]);
SYS_FORCE_INLINE ~GA_PrimitiveTracker()
void add(const GA_PrimitiveTracker &that)
SYS_FORCE_INLINE GA_PrimitiveTracker()
GA_Size count(const GA_PrimitiveTypeId &type) const
SYS_FORCE_INLINE void add(int id)
exint GA_Size
Defines the bit width for index and offset types in GA.
GA_Size countFamily(GA_PrimitiveFamilyMask family) const
Class which keeps counts of each type of primitive.
SYS_FORCE_INLINE void addMultiple(int id, GA_Size n)
SYS_FORCE_INLINE void del(int id)
SYS_FORCE_INLINE int get() const
bool contains(const GA_PrimitiveTypeId &type) const
GA_PrimitiveTracker & operator=(const GA_PrimitiveTracker &that)
void applyDiff(const GA_PrimitiveTracker &orig, const GA_PrimitiveTracker &changed)
bool containsOnly(const UT_Array< GA_PrimitiveTypeId > &allowed) const
int64 getMemoryUsage(bool inclusive) const