11 #ifndef __GT_CountArray__
12 #define __GT_CountArray__
48 init(counts, mincount, maxcount);
57 : myOffsets(raw_offsets)
58 , myMinCount(mincount)
59 , myMaxCount(maxcount)
65 exint getMemoryUsage()
const;
87 void init(
exint entries,
exint repeated_value);
92 return idx ? myOffsets->getI64(idx-1) : 0;
98 size -= myOffsets->getI64(idx-1);
107 return std::make_pair(offset, size);
113 if (myMinCount != other.myMinCount
114 || myMaxCount != other.myMaxCount)
118 if (!myOffsets || !other.myOffsets)
119 return !myOffsets && !other.myOffsets;
120 return myOffsets->isEqual(*other.myOffsets);
123 {
return isEqual(other); }
125 {
return !isEqual(other); }
bool isEqual(const GT_CountArray &other) const
Test equality.
GT_Offset getOffset(exint idx) const
GT_CountArray(const GT_DataArrayHandle &counts, GT_Size mincount=0, GT_Size maxcount=0)
const GT_DataArrayHandle & rawOffsets() const
Class which writes ASCII or binary JSON streams.
std::pair< GT_Size, GT_Size > getOffsetCount(exint idx) const
bool operator==(const GT_CountArray &other) const
GT_Storage getStorage() const
Return the storage type.
UT_IntrusivePtr< GT_DataArray > GT_DataArrayHandle
GT_Size getMinCount() const
Return the minimum value that getCount() can return.
GT_Size getMaxCount() const
Return the maximum value that getCount() can return.
GT_CountArray(const GT_CountArray &counts, const GT_DataArrayHandle &raw_offsets, GT_Size mincount, GT_Size maxcount)
void clear()
Clear the count array.
bool operator!=(const GT_CountArray &other) const
GLubyte GLubyte GLubyte GLubyte w
GT_Size getCount(exint idx) const
GT_Size sumCounts() const
Return the sum of all the counts.