![]() |
Embedded Template Library
1.0
|
Classes | |
class | etl::bitset_exception |
class | etl::bitset_nullptr |
class | etl::bitset_type_too_small |
class | etl::ibitset |
class | etl::bitset< MAXN > |
Functions | |
template<const size_t MAXN> | |
bitset< MAXN > | etl::operator& (const bitset< MAXN > &lhs, const bitset< MAXN > &rhs) |
template<const size_t MAXN> | |
bitset< MAXN > | etl::operator| (const bitset< MAXN > &lhs, const bitset< MAXN > &rhs) |
template<const size_t MAXN> | |
bitset< MAXN > | etl::operator^ (const bitset< MAXN > &lhs, const bitset< MAXN > &rhs) |
template<const size_t MAXN> | |
bool | etl::operator!= (const bitset< MAXN > &lhs, const bitset< MAXN > &rhs) |
Similar to std::bitset but without requiring std::string.
class etl::bitset_exception |
Exception base for bitset
Public Member Functions | |
bitset_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
exception (string_type reason_, string_type file_, numeric_type line_) | |
Constructor. | |
string_type | what () const |
string_type | file_name () const |
numeric_type | line_number () const |
Additional Inherited Members | |
![]() | |
typedef const char * | string_type |
typedef int | numeric_type |
class etl::bitset_nullptr |
Bitset null pointer exception.
Public Member Functions | |
bitset_nullptr (string_type file_name_, numeric_type line_number_) | |
![]() | |
bitset_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
exception (string_type reason_, string_type file_, numeric_type line_) | |
Constructor. | |
string_type | what () const |
string_type | file_name () const |
numeric_type | line_number () const |
Additional Inherited Members | |
![]() | |
typedef const char * | string_type |
typedef int | numeric_type |
class etl::bitset_type_too_small |
Bitset type_too_small exception.
Public Member Functions | |
bitset_type_too_small (string_type file_name_, numeric_type line_number_) | |
![]() | |
bitset_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
exception (string_type reason_, string_type file_, numeric_type line_) | |
Constructor. | |
string_type | what () const |
string_type | file_name () const |
numeric_type | line_number () const |
Additional Inherited Members | |
![]() | |
typedef const char * | string_type |
typedef int | numeric_type |
class etl::ibitset |
The base class for etl::bitset
Public Types | |
enum | { npos = etl::integral_limits<size_t>::max } |
typedef etl::span< element_t > | span_type |
typedef etl::span< const element_t > | const_span_type |
Public Member Functions | |
size_t | size () const |
The size of the bitset. | |
size_t | count () const |
Count the number of bits set. | |
bool | test (size_t position) const |
ibitset & | set () |
Set the bit at the position. | |
ibitset & | set (size_t position, bool value=true) |
Set the bit at the position. | |
ibitset & | set (const char *text) |
Set from a string. | |
ibitset & | from_string (const char *text) |
Set from a string. | |
ibitset & | from_string (const wchar_t *text) |
Set from a wide string. | |
ibitset & | from_string (const char16_t *text) |
Set from a u16 string. | |
ibitset & | from_string (const char32_t *text) |
Set from a u32 string. | |
template<typename T > | |
etl::enable_if< etl::is_integral< T >::value, T >::type | value () const |
Put to a value. | |
ibitset & | reset () |
Resets the bitset. | |
ibitset & | reset (size_t position) |
Reset the bit at the position. | |
ibitset & | flip () |
Flip all of the bits. | |
ibitset & | flip (size_t position) |
Flip the bit at the position. | |
bool | all () const |
bool | any () const |
Are any of the bits set? | |
bool | none () const |
Are none of the bits set? | |
size_t | find_first (bool state) const |
size_t | find_next (bool state, size_t position) const |
bool | operator[] (size_t position) const |
Read [] operator. | |
bit_reference | operator[] (size_t position) |
Write [] operator. | |
ibitset & | operator&= (const ibitset &other) |
operator &= | |
ibitset & | operator|= (const ibitset &other) |
operator |= | |
ibitset & | operator^= (const ibitset &other) |
operator ^= | |
ibitset & | operator<<= (size_t shift) |
operator <<= | |
ibitset & | operator>>= (size_t shift) |
operator >>= | |
ibitset & | operator= (const ibitset &other) |
operator = | |
void | swap (ibitset &other) |
swap | |
span_type | span () |
const_span_type | span () const |
Static Public Attributes | |
static const element_t | ALL_SET = etl::integral_limits<element_t>::max |
static const element_t | ALL_CLEAR = 0 |
static const size_t | BITS_PER_ELEMENT = etl::integral_limits<element_t>::bits |
Protected Types | |
typedef uint_least8_t | element_t |
Protected Member Functions | |
ibitset & | initialise (unsigned long long value) |
Initialise from an unsigned long long. | |
void | invert () |
Invert. | |
bit_reference | get_bit_reference (size_t position) |
Gets a reference to the specified bit. | |
ibitset (size_t nbits_, size_t size_, element_t *pdata_) | |
Constructor. | |
~ibitset () | |
Destructor. | |
Static Protected Member Functions | |
static bool | is_equal (const ibitset &lhs, const ibitset &rhs) |
Compare bitsets. | |
Protected Attributes | |
element_t | TOP_MASK |
|
inline |
Finds the first bit in the specified state.
state | The state to search for. |
|
inline |
Finds the next bit in the specified state.
state | The state to search for. |
position | The position to start from. |
|
inline |
span Returns a span of the underlying data.
|
inline |
span Returns a const span of the underlying data.
|
inline |
Tests a bit at a position. Positions greater than the number of configured bits will return false.
class etl::bitset |
The class emulates an array of bool elements, but optimized for space allocation. Will accommodate any number of bits. Does not use std::string.
MAXN | The number of bits. |
Public Member Functions | |
bitset () | |
Default constructor. | |
bitset (const bitset< MAXN > &other) | |
Copy constructor. | |
bitset (unsigned long long value) | |
Construct from a value. | |
bitset (const char *text) | |
Construct from a string. | |
bitset< MAXN > & | set () |
Set all of the bits. | |
bitset< MAXN > & | set (size_t position, bool value=true) |
Set the bit at the position. | |
bitset< MAXN > & | set (const char *text) |
Set from a string. | |
bitset< MAXN > & | from_string (const char *text) |
Set from a string. | |
bitset< MAXN > & | from_string (const wchar_t *text) |
Set from a wide string. | |
bitset< MAXN > & | from_string (const char16_t *text) |
Set from a u16 string. | |
bitset< MAXN > & | from_string (const char32_t *text) |
Set from a u32 string. | |
template<typename T > | |
etl::enable_if< etl::is_integral< T >::value, T >::type | value () const |
Put to a value. | |
bitset< MAXN > & | reset () |
Reset all of the bits. | |
bitset< MAXN > & | reset (size_t position) |
Reset the bit at the position. | |
bitset< MAXN > & | flip () |
Flip all of the bits. | |
bitset< MAXN > & | flip (size_t position) |
Flip the bit at the position. | |
bitset< MAXN > & | operator= (const bitset< MAXN > &other) |
operator = | |
bitset< MAXN > & | operator&= (const bitset< MAXN > &other) |
operator &= | |
bitset< MAXN > & | operator|= (const bitset< MAXN > &other) |
operator |= | |
bitset< MAXN > & | operator^= (const bitset< MAXN > &other) |
operator ^= | |
bitset< MAXN > | operator~ () const |
operator ~ | |
bitset< MAXN > | operator<< (size_t shift) const |
operator << | |
bitset< MAXN > & | operator<<= (size_t shift) |
operator <<= | |
bitset< MAXN > | operator>> (size_t shift) const |
operator >> | |
bitset< MAXN > & | operator>>= (size_t shift) |
operator >>= | |
![]() | |
size_t | size () const |
The size of the bitset. | |
size_t | count () const |
Count the number of bits set. | |
bool | test (size_t position) const |
ibitset & | set () |
Set the bit at the position. | |
ibitset & | set (size_t position, bool value=true) |
Set the bit at the position. | |
ibitset & | set (const char *text) |
Set from a string. | |
ibitset & | from_string (const char *text) |
Set from a string. | |
ibitset & | from_string (const wchar_t *text) |
Set from a wide string. | |
ibitset & | from_string (const char16_t *text) |
Set from a u16 string. | |
ibitset & | from_string (const char32_t *text) |
Set from a u32 string. | |
template<typename T > | |
etl::enable_if< etl::is_integral< T >::value, T >::type | value () const |
Put to a value. | |
ibitset & | reset () |
Resets the bitset. | |
ibitset & | reset (size_t position) |
Reset the bit at the position. | |
ibitset & | flip () |
Flip all of the bits. | |
ibitset & | flip (size_t position) |
Flip the bit at the position. | |
bool | all () const |
bool | any () const |
Are any of the bits set? | |
bool | none () const |
Are none of the bits set? | |
size_t | find_first (bool state) const |
size_t | find_next (bool state, size_t position) const |
bool | operator[] (size_t position) const |
Read [] operator. | |
bit_reference | operator[] (size_t position) |
Write [] operator. | |
ibitset & | operator&= (const ibitset &other) |
operator &= | |
ibitset & | operator|= (const ibitset &other) |
operator |= | |
ibitset & | operator^= (const ibitset &other) |
operator ^= | |
ibitset & | operator<<= (size_t shift) |
operator <<= | |
ibitset & | operator>>= (size_t shift) |
operator >>= | |
ibitset & | operator= (const ibitset &other) |
operator = | |
void | swap (ibitset &other) |
swap | |
span_type | span () |
const_span_type | span () const |
Static Public Attributes | |
static const size_t | ALLOCATED_BITS = ARRAY_SIZE * BITS_PER_ELEMENT |
![]() | |
static const element_t | ALL_SET = etl::integral_limits<element_t>::max |
static const element_t | ALL_CLEAR = 0 |
static const size_t | BITS_PER_ELEMENT = etl::integral_limits<element_t>::bits |
Friends | |
bool | operator== (const bitset< MAXN > &lhs, const bitset< MAXN > &rhs) |
operator == | |
Additional Inherited Members | |
![]() | |
enum | { npos = etl::integral_limits<size_t>::max } |
typedef etl::span< element_t > | span_type |
typedef etl::span< const element_t > | const_span_type |
![]() | |
typedef uint_least8_t | element_t |
![]() | |
ibitset & | initialise (unsigned long long value) |
Initialise from an unsigned long long. | |
void | invert () |
Invert. | |
bit_reference | get_bit_reference (size_t position) |
Gets a reference to the specified bit. | |
ibitset (size_t nbits_, size_t size_, element_t *pdata_) | |
Constructor. | |
~ibitset () | |
Destructor. | |
![]() | |
static bool | is_equal (const ibitset &lhs, const ibitset &rhs) |
Compare bitsets. | |
![]() | |
element_t | TOP_MASK |
bool etl::operator!= | ( | const bitset< MAXN > & | lhs, |
const bitset< MAXN > & | rhs | ||
) |
operator !=
bitset<MAXN> etl::operator& | ( | const bitset< MAXN > & | lhs, |
const bitset< MAXN > & | rhs | ||
) |
operator &
bitset<MAXN> etl::operator^ | ( | const bitset< MAXN > & | lhs, |
const bitset< MAXN > & | rhs | ||
) |
operator ^