12#ifndef BELFEM_CL_BITSET_HPP
13#define BELFEM_CL_BITSET_HPP
30 template < index_t N >
36 std::bitset< N > mBitset;
54 mBitset( aBitset.mBitset )
64 mBitset( std::move( aBitset.mBitset ) )
94 mBitset.set( aIndex );
105 mBitset.reset( aIndex );
129 mBitset.flip( aIndex );
140 return mBitset.test( aIndex );
151 return mBitset.count();
159 inline std::bitset< N > &
170 inline const std::bitset< N > &
184 if(
this != & aBitset )
186 mBitset = aBitset.mBitset ;
199 if(
this != & aBitset )
201 mBitset = std::move( aBitset.mBitset ) ;
214 return mBitset == aBitset.mBitset ;
225 return mBitset != aBitset.mBitset ;
Compile-time fixed-size bitset.
Definition cl_Bitset.hpp:32
std::bitset< N > & data()
expose data container
Definition cl_Bitset.hpp:160
void reset(const index_t aIndex)
set a bit to false
Definition cl_Bitset.hpp:103
bool operator==(const Bitset< N > &aBitset) const
equality operator
Definition cl_Bitset.hpp:212
Bitset(const Bitset< N > &aBitset)
copy constructor
Definition cl_Bitset.hpp:53
index_t size() const
the size of the bitset
Definition cl_Bitset.hpp:81
Bitset(Bitset< N > &&aBitset)
move constructor
Definition cl_Bitset.hpp:63
void flip(const index_t aIndex)
invert a bit
Definition cl_Bitset.hpp:127
bool operator!=(const Bitset< N > &aBitset) const
inequality operator
Definition cl_Bitset.hpp:223
void set(const index_t aIndex)
set a bit to true
Definition cl_Bitset.hpp:92
bool test(const index_t aIndex) const
test if a bit is set
Definition cl_Bitset.hpp:138
Bitset< N > & operator=(const Bitset< N > &aBitset)
copy assignment operator
Definition cl_Bitset.hpp:182
const std::bitset< N > & data() const
expose data container (const)
Definition cl_Bitset.hpp:171
void reset()
set all bits to false
Definition cl_Bitset.hpp:115
Bitset< N > & operator=(Bitset< N > &&aBitset)
move assignment operator
Definition cl_Bitset.hpp:197
index_t count() const
count the number of true bits
Definition cl_Bitset.hpp:149
Bitset()=default
trivial constructor
~Bitset()=default
tivial destructor
USER GUIDES:
Definition cl_Capacitor.cpp:16
uint32_t index_t
Definition typedefs.hpp:52