Flutter Engine
minikin::SparseBitSet Class Reference

#include <SparseBitSet.h>

Public Member Functions

 SparseBitSet ()
 
 SparseBitSet (const uint32_t *ranges, size_t nRanges)
 
 SparseBitSet (SparseBitSet &&)=default
 
SparseBitSetoperator= (SparseBitSet &&)=default
 
bool get (uint32_t ch) const
 
uint32_t length () const
 
uint32_t nextSetBit (uint32_t fromIndex) const
 

Static Public Attributes

static const uint32_t kNotFound = ~0u
 

Detailed Description

Definition at line 34 of file SparseBitSet.h.

Constructor & Destructor Documentation

◆ SparseBitSet() [1/3]

minikin::SparseBitSet::SparseBitSet ( )
inline

Definition at line 37 of file SparseBitSet.h.

Referenced by SparseBitSet().

37 : mMaxVal(0) {}

◆ SparseBitSet() [2/3]

minikin::SparseBitSet::SparseBitSet ( const uint32_t *  ranges,
size_t  nRanges 
)
inline

Definition at line 42 of file SparseBitSet.h.

References operator=(), and SparseBitSet().

42  : SparseBitSet() {
43  initFromRanges(ranges, nRanges);
44  }

◆ SparseBitSet() [3/3]

minikin::SparseBitSet::SparseBitSet ( SparseBitSet &&  )
default

Member Function Documentation

◆ get()

bool minikin::SparseBitSet::get ( uint32_t  ch) const
inline

Definition at line 50 of file SparseBitSet.h.

50  {
51  if (ch >= mMaxVal)
52  return false;
53  const uint32_t* bitmap = &mBitmaps[mIndices[ch >> kLogValuesPerPage]];
54  uint32_t index = ch & kPageMask;
55  return (bitmap[index >> kLogBitsPerEl] & (kElFirst >> (index & kElMask))) !=
56  0;
57  }

◆ length()

uint32_t minikin::SparseBitSet::length ( ) const
inline

Definition at line 60 of file SparseBitSet.h.

References nextSetBit().

60 { return mMaxVal; }

◆ nextSetBit()

uint32_t minikin::SparseBitSet::nextSetBit ( uint32_t  fromIndex) const

Referenced by length().

◆ operator=()

SparseBitSet& minikin::SparseBitSet::operator= ( SparseBitSet &&  )
default

Referenced by SparseBitSet().

Member Data Documentation

◆ kNotFound

const uint32_t minikin::SparseBitSet::kNotFound = ~0u
static

Definition at line 66 of file SparseBitSet.h.


The documentation for this class was generated from the following file: