Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
thorin::BitSet Class Reference

#include <thorin/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
 Is any bit in [begin, end[ set?
 
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
 Is no bit in [begin, end[ set?
 
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]

thorin::BitSet::BitSet ( )
inlinenoexcept

Definition at line 43 of file bitset.h.

◆ BitSet() [2/3]

thorin::BitSet::BitSet ( const BitSet other)
inline

Definition at line 46 of file bitset.h.

References padding.

◆ BitSet() [3/3]

thorin::BitSet::BitSet ( BitSet &&  other)
inlinenoexcept

Definition at line 52 of file bitset.h.

References swap().

◆ ~BitSet()

thorin::BitSet::~BitSet ( )
inline

Definition at line 56 of file bitset.h.

Member Function Documentation

◆ any()

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

Definition at line 102 of file bitset.h.

References any_range().

◆ any_begin()

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

Is any bit in [begin, ∞[ set?

Definition at line 101 of file bitset.h.

References any_range().

◆ any_end()

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

Is any bit in [0, end[ set?

Definition at line 99 of file bitset.h.

References any_range().

◆ any_range()

bool thorin::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 thorin::BitSet::clear ( )
inline

clears all bits

Definition at line 73 of file bitset.h.

Referenced by operator>>=().

◆ clear() [2/2]

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

Definition at line 70 of file bitset.h.

◆ count()

size_t thorin::BitSet::count ( ) const

number of bits set

Definition at line 18 of file bitset.cpp.

◆ none()

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

Definition at line 115 of file bitset.h.

References none_range().

◆ none_begin()

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

Is no bit in [begin, ∞[ set?

Definition at line 114 of file bitset.h.

References none_range().

◆ none_end()

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

Is no bit in [0, end[ set?

Definition at line 112 of file bitset.h.

References none_range().

◆ none_range()

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

Is no bit in [begin, end[ set?

Definition at line 110 of file bitset.h.

References any_range().

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

◆ operator!=()

bool thorin::BitSet::operator!= ( const BitSet other) const
inline

Definition at line 89 of file bitset.h.

◆ operator&()

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

Definition at line 134 of file bitset.h.

◆ operator&=()

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

Definition at line 131 of file bitset.h.

◆ operator=()

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

Definition at line 57 of file bitset.h.

References swap().

◆ operator==()

bool thorin::BitSet::operator== ( const BitSet other) const

Definition at line 25 of file bitset.cpp.

◆ operator>>()

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

Definition at line 121 of file bitset.h.

◆ operator>>=()

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

Definition at line 68 of file bitset.cpp.

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

◆ operator[]() [1/2]

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

Definition at line 79 of file bitset.h.

◆ operator[]() [2/2]

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

Definition at line 83 of file bitset.h.

◆ operator^()

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

Definition at line 136 of file bitset.h.

◆ operator^=()

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

Definition at line 133 of file bitset.h.

◆ operator|()

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

Definition at line 135 of file bitset.h.

◆ operator|=()

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

Definition at line 132 of file bitset.h.

◆ set()

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

Definition at line 68 of file bitset.h.

◆ swap()

void friend thorin::BitSet::swap ( BitSet b1,
BitSet b2 
)
inlinenoexcept

Definition at line 143 of file bitset.h.

References swap().

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

◆ test()

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

Definition at line 62 of file bitset.h.

◆ toggle()

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

Definition at line 69 of file bitset.h.

Member Data Documentation

◆ padding

uint32_t thorin::BitSet::padding = 0

Unused; do whatever you want with this.

Definition at line 175 of file bitset.h.

Referenced by BitSet().


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