nlib
nn::nlib::SmartBitmapPtr< N, BIT > Class Template Referencefinal

The data structure holding bit data operated on by Rank and Select. More...

#include "nn/nlib/SmartBitmap.h"

+ Inheritance diagram for nn::nlib::SmartBitmapPtr< N, BIT >:

Public Types

enum  { kArraySize = CrtpBase::kWordCount }
 

Public Member Functions

void Init (BIT *bitmap) noexcept
 Sets a pointer to the bit data. More...
 
- Public Member Functions inherited from nn::nlib::SmartBitmapCrtp< N, SmartBitmapPtr< N, BIT >, BIT >
unsigned int GetBitVectorSize () const noexcept
 Returns the size of the bit data. More...
 
const BIT * GetBitVector () const noexcept
 Returns the pointer to the bit data. More...
 
bool Has (unsigned int idx) const noexcept
 Tests to determine whether a particular value is contained in the set. More...
 
bool operator[] (const unsigned int idx) const noexcept
 Tests to determine whether a particular value is contained in the set. More...
 
unsigned int Rank1 (unsigned int idx) const noexcept
 Performs a Rank operation. More...
 
unsigned int Rank0 (unsigned int idx) const noexcept
 Performs a Rank operation. More...
 
int Select1 (unsigned int nth) const noexcept
 Returns the position of the nth 1 bit. nth starts from 0. More...
 
int Select0 (unsigned int nth) const noexcept
 Returns the position of the nth 0 bit. nth starts from 0. More...
 
bool Set (unsigned int idx) noexcept
 Adds a 32-bit unsigned integer to the set. More...
 
bool Set (unsigned int idx, bool value) noexcept
 Sets bits in the bit data. More...
 
bool TurnOn (unsigned int idx) noexcept
 Adds a 32-bit unsigned integer to the set. More...
 
bool Unset (unsigned int idx) noexcept
 Removes a 32-bit unsigned integer from the set. More...
 
void Reset () noexcept
 Returns the object to the state immediately after the constructor is called.
 

Detailed Description

template<size_t N, class BIT = uint64_t>
class nn::nlib::SmartBitmapPtr< N, BIT >

The data structure holding bit data operated on by Rank and Select.

Template Parameters
NThe size of the bit data (N bits).
Description
Holds the pointer to the bit data in a data member. Suited for situations where you want to use bit data that is statically present elsewhere. Note that the bit data in words must be arranged in order from the least significant bit.

Definition at line 177 of file SmartBitmap.h.

Member Enumeration Documentation

◆ anonymous enum

template<size_t N, class BIT = uint64_t>
anonymous enum

anonymous enum

Enumerator
kArraySize 

The size required for the bit data (in number of words).

Definition at line 182 of file SmartBitmap.h.

Member Function Documentation

◆ Init()

template<size_t N, class BIT = uint64_t>
nn::nlib::SmartBitmapPtr< N, BIT >::Init ( BIT *  bitmap)
inlinenoexcept

Sets a pointer to the bit data.

Parameters
[in]bitmapA pointer to the bit data. The size must be SmartBitmapPtr::kArraySize words.

Definition at line 187 of file SmartBitmap.h.


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