class RawBitmapBase

Defined at line 34 of file ../../zircon/system/ulib/bitmap/include/bitmap/raw-bitmap.h

Base class for RawGenericBitmap, to reduce what needs to be templated.

Protected Members

size_t size_
size_t * data_

Public Methods

size_t size ()

Returns the size of this bitmap.

Defined at line 37 of file ../../zircon/system/ulib/bitmap/include/bitmap/raw-bitmap.h

zx_status_t Shrink (size_t size)

Shrinks the accessible portion of the bitmap, without re-allocating

the underlying storage.

This is useful for programs which require underlying bitmap storage

to be aligned to a certain size (initialized via Reset), but want to

restrict access to a smaller portion of the bitmap (via Shrink).

Defined at line 75 of file ../../zircon/system/ulib/bitmap/raw-bitmap.cc

bool Scan (size_t bitoff, size_t bitmax, bool is_set, size_t * out)

Returns true if all bits in the range [*bitoff*, *bitmax*) match

*is_set*, otherwise returns false and sets *out* (if provided) to the

first (or last, in the case of ReverseScan) bit that doesn't match. An

empty region (i.e. *bitoff* is greater than *bitmax*, or *bitoff* is

outside the range of the bitmap) will return true.

Defined at line 83 of file ../../zircon/system/ulib/bitmap/raw-bitmap.cc

bool ReverseScan (size_t bitoff, size_t bitmax, bool is_set, size_t * out)

Defined at line 104 of file ../../zircon/system/ulib/bitmap/raw-bitmap.cc

zx_status_t Find (bool is_set, size_t bitoff, size_t bitmax, size_t run_len, size_t * out)

Finds the first (or last, in the case of ReverseFind) run of *run_len*

*is_set* bits, in [*bitoff*, *bitmax*). Returns the start of the run in

*out* and returns ZX_OK if a run is found, otherwise returns

ZX_ERR_NO_RESOURCES.

Defined at line 125 of file ../../zircon/system/ulib/bitmap/raw-bitmap.cc

zx_status_t ReverseFind (bool is_set, size_t bitoff, size_t bitmax, size_t run_len, size_t * out)

Defined at line 142 of file ../../zircon/system/ulib/bitmap/raw-bitmap.cc

bool Get (size_t bitoff, size_t bitmax, size_t * first_unset)

Returns true if all the bits in [*bitoff*, *bitmax*) are set. Afterwards,

*first_unset* will be set to the lesser of bitmax and the index of the

first unset bit after *bitoff*.

Defined at line 164 of file ../../zircon/system/ulib/bitmap/raw-bitmap.cc

zx_status_t Set (size_t bitoff, size_t bitmax)

Sets all bits in the range [*bitoff*, *bitmax*). Returns an error if

bitmax

<

bitoff or size_

<

bitmax, and ZX_OK otherwise.

Defined at line 172 of file ../../zircon/system/ulib/bitmap/raw-bitmap.cc

zx_status_t Clear (size_t bitoff, size_t bitmax)

Clears all bits in the range [*bitoff*, *bitmax*). Returns an error if

bitmax

<

bitoff or size_

<

bitmax, and ZX_OK otherwise.

Defined at line 187 of file ../../zircon/system/ulib/bitmap/raw-bitmap.cc

void ClearAll ()

Clear all bits in the bitmap.

Defined at line 202 of file ../../zircon/system/ulib/bitmap/raw-bitmap.cc