FastLED 3.9.15
Loading...
Searching...
No Matches
fl::BitsetFixed< N > Class Template Reference

Detailed Description

template<uint32_t N>
class fl::BitsetFixed< N >

A simple fixed-size Bitset implementation similar to std::Bitset.

Definition at line 21 of file bitset.h.

#include <bitset.h>

Classes

struct  Proxy
 

Public Member Functions

constexpr BitsetFixed () noexcept
 Constructs a BitsetFixed with all bits reset.
 
bool all () const noexcept
 
bool any () const noexcept
 Queries.
 
void assign (size_t n, bool value)
 
uint32_t count () const noexcept
 Returns the number of set bits.
 
BitsetFixedflip () noexcept
 Flips all bits.
 
BitsetFixedflip (uint32_t pos)
 Flips (toggles) the bit at position pos.
 
bool none () const noexcept
 
BitsetFixedoperator&= (const BitsetFixed &other) noexcept
 Bitwise AND.
 
Proxy operator[] (uint32_t pos)
 
bool operator[] (uint32_t pos) const noexcept
 Returns the value of the bit at position pos.
 
BitsetFixedoperator^= (const BitsetFixed &other) noexcept
 Bitwise XOR.
 
BitsetFixedoperator|= (const BitsetFixed &other) noexcept
 Bitwise OR.
 
void reset () noexcept
 Resets all bits to zero.
 
BitsetFixedreset (uint32_t pos)
 Clears the bit at position pos.
 
BitsetFixedset (uint32_t pos, bool value=true)
 Sets or clears the bit at position pos.
 
constexpr uint32_t size () const noexcept
 Size of the BitsetFixed (number of bits).
 
bool test (uint32_t pos) const noexcept
 Tests whether the bit at position pos is set.
 

Private Types

using block_type = uint64_t
 

Private Attributes

block_type _blocks [block_count]
 

Static Private Attributes

static constexpr uint32_t bits_per_block = 8 * sizeof(uint64_t)
 
static constexpr uint32_t block_count
 

Friends

BitsetFixed operator& (BitsetFixed lhs, const BitsetFixed &rhs) noexcept
 Friend operators for convenience.
 
BitsetFixed operator^ (BitsetFixed lhs, const BitsetFixed &rhs) noexcept
 
BitsetFixed operator| (BitsetFixed lhs, const BitsetFixed &rhs) noexcept
 
BitsetFixed operator~ (BitsetFixed bs) noexcept
 

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