« Back to documentation index
bitset< MAXN > Class Template Reference
The class emulates an array of bool elements, but optimized for space allocation.
More...
#include <bitset.h >
Inherits etl::ibitset .
Detailed Description
template<const size_t MAXN>
class etl::bitset< MAXN >
The class emulates an array of bool elements, but optimized for space allocation.
Will accommodate any number of bits. Does not use std::string.
Template Parameters:
Definition at line 731 of file bitset.h .
Constructor & Destructor Documentation
Default constructor.
Definition at line 745 of file bitset.h .
Copy constructor.
Definition at line 754 of file bitset.h .
bitset
(
unsigned long long
value )
Construct from a value.
Definition at line 763 of file bitset.h .
Construct from a string.
Definition at line 772 of file bitset.h .
Member Function Documentation
bool any
(
)
const [inherited]
Are any of the bits set?
Definition at line 412 of file bitset.h .
size_t count
(
)
const [inherited]
Count the number of bits set.
Definition at line 209 of file bitset.h .
size_t find_first
(
bool
state )
const [inherited]
Finds the first bit in the specified state.
Parameters:
state The state to search for.
Returns: The position of the bit or SIZE if none were found.
Definition at line 438 of file bitset.h .
size_t find_next
(
bool
state ,
size_t
position
)
const [inherited]
Finds the next bit in the specified state.
Parameters:
state The state to search for.
position The position to start from.
Returns: The position of the bit or SIZE if none were found.
Definition at line 449 of file bitset.h .
Flip all of the bits.
Reimplemented from ibitset .
Definition at line 828 of file bitset.h .
bitset <MAXN>& flip
(
size_t
position )
Flip the bit at the position.
Reimplemented from ibitset .
Definition at line 837 of file bitset.h .
bit_reference get_bit_reference
(
size_t
position )
[protected, inherited]
Gets a reference to the specified bit.
Definition at line 685 of file bitset.h .
ibitset & initialise
(
unsigned long long
value )
[protected, inherited]
Initialise from an unsigned long long.
Definition at line 644 of file bitset.h .
void invert
(
)
[protected, inherited]
static bool is_equal
(
const ibitset &
lhs ,
const ibitset &
rhs
)
[static, protected, inherited]
Compare bitsets.
Definition at line 706 of file bitset.h .
bool none
(
)
const [inherited]
Are none of the bits set?
Definition at line 420 of file bitset.h .
bitset <MAXN> operator<<
(
size_t
shift )
const
bitset <MAXN>& operator<<=
(
size_t
shift )
bitset <MAXN> operator>>
(
size_t
shift )
const
bitset <MAXN>& operator>>=
(
size_t
shift )
bool operator[]
(
size_t
position )
const [inherited]
Read [] operator.
Definition at line 510 of file bitset.h .
Write [] operator.
Definition at line 518 of file bitset.h .
bitset <MAXN> operator~
(
)
const
Reset all of the bits.
Reimplemented from ibitset .
Definition at line 810 of file bitset.h .
bitset <MAXN>& reset
(
size_t
position )
Reset the bit at the position.
Reimplemented from ibitset .
Definition at line 819 of file bitset.h .
bitset <MAXN>& set
(
size_t
position ,
bool
value = true
)
Set the bit at the position.
Reimplemented from ibitset .
Definition at line 790 of file bitset.h .
size_t size
(
)
const [inherited]
The size of the bitset.
Definition at line 201 of file bitset.h .
void swap
(
ibitset &
other )
[inherited]
bool test
(
size_t
position )
const [inherited]
Tests a bit at a position.
Positions greater than the number of configured bits will return false .
Definition at line 225 of file bitset.h .
Friends And Related Function Documentation
bool operator==
(
const bitset < MAXN > &
lhs ,
const bitset < MAXN > &
rhs
)
[friend]