MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::BitSet Class Reference

#include <mim/util/bitset.h>

Classes

class  reference
 

Public Member Functions

size_t count () const
 number of bits set
 
void friend swap (BitSet &b1, BitSet &b2) noexcept
 
constructor, destructor & assignment
 BitSet () noexcept
 
 BitSet (const BitSet &other)
 
 BitSet (BitSet &&other) noexcept
 
 ~BitSet ()
 
BitSetoperator= (BitSet other) noexcept
 
get, set, clear, toggle, and test bits
bool test (size_t i) const
 
BitSetset (size_t i)
 
BitSettoggle (size_t i)
 
BitSetclear (size_t i)
 
void clear ()
 clears all bits
 
reference operator[] (size_t i)
 
bool operator[] (size_t i) const
 
relational operators
bool operator== (const BitSet &) const
 
bool operator!= (const BitSet &other) const
 
any

Is any bit range set?

bool any_range (const size_t begin, const size_t end) const
 
bool any_end (const size_t end) const
 Is any bit in [0, end[ set?
 
bool any_begin (const size_t begin) const
 Is any bit in [begin, ∞[ set?
 
bool any () const
 
none

Is no bit in range set?

bool none_range (const size_t begin, const size_t end) const
 
bool none_end (const size_t end) const
 Is no bit in [0, end[ set?
 
bool none_begin (const size_t begin) const
 Is no bit in [begin, ∞[ set?
 
bool none () const
 
shift
BitSetoperator>>= (uint64_t shift)
 
BitSet operator>> (uint64_t shift) const
 
Boolean operators
BitSetoperator&= (const BitSet &other)
 
BitSetoperator|= (const BitSet &other)
 
BitSetoperator^= (const BitSet &other)
 
BitSet operator& (BitSet b) const
 
BitSet operator| (BitSet b) const
 
BitSet operator^ (BitSet b) const
 

Public Attributes

uint32_t padding = 0
 Unused; do whatever you want with this.
 

Detailed Description

Definition at line 11 of file bitset.h.

Constructor & Destructor Documentation

◆ BitSet() [1/3]

mim::BitSet::BitSet ( )
inlinenoexcept

Definition at line 43 of file bitset.h.

◆ BitSet() [2/3]

mim::BitSet::BitSet ( const BitSet & other)
inline

Definition at line 46 of file bitset.h.

References padding.

◆ BitSet() [3/3]

mim::BitSet::BitSet ( BitSet && other)
inlinenoexcept

Definition at line 52 of file bitset.h.

References swap().

◆ ~BitSet()

mim::BitSet::~BitSet ( )
inline

Definition at line 56 of file bitset.h.

Member Function Documentation

◆ any()

bool mim::BitSet::any ( ) const
inline

Definition at line 101 of file bitset.h.

References any_range().

◆ any_begin()

bool mim::BitSet::any_begin ( const size_t begin) const
inline

Is any bit in [begin, ∞[ set?

Definition at line 100 of file bitset.h.

References any_range().

◆ any_end()

bool mim::BitSet::any_end ( const size_t end) const
inline

Is any bit in [0, end[ set?

Definition at line 98 of file bitset.h.

References any_range().

◆ any_range()

bool mim::BitSet::any_range ( const size_t begin,
const size_t end ) const

Is any bit in [begin, end[ set?

Definition at line 46 of file bitset.cpp.

Referenced by any(), any_begin(), any_end(), and none_range().

◆ clear() [1/2]

void mim::BitSet::clear ( )
inline

clears all bits

Definition at line 73 of file bitset.h.

Referenced by operator>>=().

◆ clear() [2/2]

BitSet & mim::BitSet::clear ( size_t i)
inline

Definition at line 70 of file bitset.h.

◆ count()

size_t mim::BitSet::count ( ) const

number of bits set

Definition at line 18 of file bitset.cpp.

◆ none()

bool mim::BitSet::none ( ) const
inline

Definition at line 113 of file bitset.h.

References none_range().

◆ none_begin()

bool mim::BitSet::none_begin ( const size_t begin) const
inline

Is no bit in [begin, ∞[ set?

Definition at line 112 of file bitset.h.

References none_range().

◆ none_end()

bool mim::BitSet::none_end ( const size_t end) const
inline

Is no bit in [0, end[ set?

Definition at line 110 of file bitset.h.

References none_range().

◆ none_range()

bool mim::BitSet::none_range ( const size_t begin,
const size_t end ) const
inline

Is no bit in [begin, end[ set?

Definition at line 108 of file bitset.h.

References any_range().

Referenced by none(), none_begin(), and none_end().

◆ operator!=()

bool mim::BitSet::operator!= ( const BitSet & other) const
inline

Definition at line 89 of file bitset.h.

◆ operator&()

BitSet mim::BitSet::operator& ( BitSet b) const
inline

Definition at line 132 of file bitset.h.

◆ operator&=()

BitSet & mim::BitSet::operator&= ( const BitSet & other)
inline

Definition at line 129 of file bitset.h.

◆ operator=()

BitSet & mim::BitSet::operator= ( BitSet other)
inlinenoexcept

Definition at line 57 of file bitset.h.

References swap().

◆ operator==()

bool mim::BitSet::operator== ( const BitSet & other) const

Definition at line 25 of file bitset.cpp.

◆ operator>>()

BitSet mim::BitSet::operator>> ( uint64_t shift) const
inline

Definition at line 119 of file bitset.h.

◆ operator>>=()

BitSet & mim::BitSet::operator>>= ( uint64_t shift)

Definition at line 68 of file bitset.cpp.

References clear(), and mim::rem().

◆ operator[]() [1/2]

reference mim::BitSet::operator[] ( size_t i)
inline

Definition at line 79 of file bitset.h.

◆ operator[]() [2/2]

bool mim::BitSet::operator[] ( size_t i) const
inline

Definition at line 83 of file bitset.h.

◆ operator^()

BitSet mim::BitSet::operator^ ( BitSet b) const
inline

Definition at line 134 of file bitset.h.

◆ operator^=()

BitSet & mim::BitSet::operator^= ( const BitSet & other)
inline

Definition at line 131 of file bitset.h.

◆ operator|()

BitSet mim::BitSet::operator| ( BitSet b) const
inline

Definition at line 133 of file bitset.h.

◆ operator|=()

BitSet & mim::BitSet::operator|= ( const BitSet & other)
inline

Definition at line 130 of file bitset.h.

◆ set()

BitSet & mim::BitSet::set ( size_t i)
inline

Definition at line 68 of file bitset.h.

◆ swap()

void friend mim::BitSet::swap ( BitSet & b1,
BitSet & b2 )
inlinenoexcept

Definition at line 141 of file bitset.h.

References swap().

Referenced by BitSet(), operator=(), and swap().

◆ test()

bool mim::BitSet::test ( size_t i) const
inline

Definition at line 62 of file bitset.h.

◆ toggle()

BitSet & mim::BitSet::toggle ( size_t i)
inline

Definition at line 69 of file bitset.h.

Member Data Documentation

◆ padding

uint32_t mim::BitSet::padding = 0

Unused; do whatever you want with this.

Definition at line 173 of file bitset.h.

Referenced by BitSet().


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