Embedded Template Library 1.0
|
Classes | |
class | etl::bitset_exception |
class | etl::bitset_nullptr |
class | etl::bitset_type_too_small |
class | etl::bitset_overflow |
class | etl::ibitset |
class | etl::bitset< MaxN > |
class | etl::bitset_string_too_small |
class | etl::bitset_impl< TElement > |
Functions | |
template<size_t MaxN> | |
bitset< MaxN > | etl::operator& (const bitset< MaxN > &lhs, const bitset< MaxN > &rhs) |
template<size_t MaxN> | |
bitset< MaxN > | etl::operator| (const bitset< MaxN > &lhs, const bitset< MaxN > &rhs) |
template<size_t MaxN> | |
bitset< MaxN > | etl::operator^ (const bitset< MaxN > &lhs, const bitset< MaxN > &rhs) |
template<size_t MaxN> | |
bool | etl::operator!= (const bitset< MaxN > &lhs, const bitset< MaxN > &rhs) |
template<size_t Active_Bits, typename TElement , bool IsSingleElement> | |
ETL_CONSTEXPR14 bitset< Active_Bits > | etl::operator& (const bitset< Active_Bits, TElement, IsSingleElement > &lhs, const bitset< Active_Bits, TElement, IsSingleElement > &rhs) ETL_NOEXCEPT |
template<size_t Active_Bits, typename TElement , bool IsSingleElement> | |
ETL_CONSTEXPR14 bitset< Active_Bits > | etl::operator| (const bitset< Active_Bits, TElement, IsSingleElement > &lhs, const bitset< Active_Bits, TElement, IsSingleElement > &rhs) ETL_NOEXCEPT |
template<size_t Active_Bits, typename TElement , bool IsSingleElement> | |
ETL_CONSTEXPR14 bitset< Active_Bits > | etl::operator^ (const bitset< Active_Bits, TElement, IsSingleElement > &lhs, const bitset< Active_Bits, TElement, IsSingleElement > &rhs) ETL_NOEXCEPT |
template<size_t Active_Bits, typename TElement , bool IsSingleElement> | |
ETL_CONSTEXPR14 bool | etl::operator!= (const bitset< Active_Bits, TElement, IsSingleElement > &lhs, const bitset< Active_Bits, TElement, IsSingleElement > &rhs) ETL_NOEXCEPT |
template<size_t Active_Bits, typename TElement , bool IsSingleElement> | |
ETL_CONSTEXPR14 bool | etl::operator!= (const bitset_ext< Active_Bits, TElement, IsSingleElement > &lhs, const bitset_ext< Active_Bits, TElement, IsSingleElement > &rhs) ETL_NOEXCEPT |
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_) | |
bitset_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
ETL_CONSTEXPR | exception (string_type reason_, string_type, numeric_type line_) |
Constructor. | |
ETL_CONSTEXPR string_type | what () const |
ETL_CONSTEXPR string_type | file_name () const |
ETL_CONSTEXPR 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_) | |
bitset_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
ETL_CONSTEXPR | exception (string_type reason_, string_type, numeric_type line_) |
Constructor. | |
ETL_CONSTEXPR string_type | what () const |
ETL_CONSTEXPR string_type | file_name () const |
ETL_CONSTEXPR 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_) | |
bitset_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
ETL_CONSTEXPR | exception (string_type reason_, string_type, numeric_type line_) |
Constructor. | |
ETL_CONSTEXPR string_type | what () const |
ETL_CONSTEXPR string_type | file_name () const |
ETL_CONSTEXPR numeric_type | line_number () const |
Additional Inherited Members | |
![]() | |
typedef const char * | string_type |
typedef int | numeric_type |
class etl::bitset_overflow |
Bitset overflow exception.
Public Member Functions | |
bitset_overflow (string_type file_name_, numeric_type line_number_) | |
bitset_overflow (string_type file_name_, numeric_type line_number_) | |
![]() | |
bitset_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
bitset_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
ETL_CONSTEXPR | exception (string_type reason_, string_type, numeric_type line_) |
Constructor. | |
ETL_CONSTEXPR string_type | what () const |
ETL_CONSTEXPR string_type | file_name () const |
ETL_CONSTEXPR 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::make_unsigned< ETL_BITSET_ELEMENT_TYPE >::type | element_type |
typedef element_type | element_t |
Public Member Functions | |
size_t | size () const |
The number of bits in the bitset. | |
size_t | count () const |
Count the number of bits set. | |
bool | test (size_t position) const |
ibitset & | set () |
Set all bits. | |
ibitset & | set (size_t position, bool value=true) |
Set the bit at the position. | |
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. | |
ibitset & | set (const char *text) |
Set from a string. | |
ibitset & | set (const wchar_t *text) |
Set from a wstring. | |
ibitset & | set (const char16_t *text) |
Set from a u16string. | |
ibitset & | set (const char32_t *text) |
Set from a u32string. | |
template<typename T > | |
etl::enable_if< etl::is_integral< T >::value, T >::type | value () const |
Put to a value. | |
unsigned long | to_ulong () const |
Put to a unsigned long. | |
unsigned long long | to_ullong () const |
Put to a unsigned long long. | |
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 | |
Static Public Attributes | |
static ETL_CONSTANT element_type | ALL_SET = etl::integral_limits<element_type>::max |
static ETL_CONSTANT element_type | ALL_CLEAR = 0 |
static ETL_CONSTANT size_t | Bits_Per_Element = etl::integral_limits<element_type>::bits |
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_type *pdata_) | |
Constructor. | |
~ibitset () | |
Destructor. | |
Static Protected Member Functions | |
static bool | is_equal (const ibitset &lhs, const ibitset &rhs) |
Compare bitsets. | |
Protected Attributes | |
element_type | 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 |
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 (const wchar_t *text) | |
Construct from a string. | |
bitset (const char16_t *text) | |
Construct from a string. | |
bitset (const char32_t *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 > & | set (const wchar_t *text) |
Set from a string. | |
bitset< MaxN > & | set (const char16_t *text) |
Set from a string. | |
bitset< MaxN > & | set (const char32_t *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. | |
template<typename TString > | |
TString | to_string (typename TString::value_type zero=typename TString::value_type('0'), typename TString::value_type one=typename TString::value_type('1')) const |
Returns a string representing the bitset. | |
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 number of bits in the bitset. | |
size_t | count () const |
Count the number of bits set. | |
bool | test (size_t position) const |
ibitset & | set () |
Set all bits. | |
ibitset & | set (size_t position, bool value=true) |
Set the bit at the position. | |
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. | |
ibitset & | set (const char *text) |
Set from a string. | |
ibitset & | set (const wchar_t *text) |
Set from a wstring. | |
ibitset & | set (const char16_t *text) |
Set from a u16string. | |
ibitset & | set (const char32_t *text) |
Set from a u32string. | |
template<typename T > | |
etl::enable_if< etl::is_integral< T >::value, T >::type | value () const |
Put to a value. | |
unsigned long | to_ulong () const |
Put to a unsigned long. | |
unsigned long long | to_ullong () const |
Put to a unsigned long long. | |
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 | |
Static Public Attributes | |
static ETL_CONSTANT size_t | ALLOCATED_BITS = Array_Size * Bits_Per_Element |
static ETL_CONSTANT size_t | Allocated_Bits = ALLOCATED_BITS |
![]() | |
static ETL_CONSTANT element_type | ALL_SET = etl::integral_limits<element_type>::max |
static ETL_CONSTANT element_type | ALL_CLEAR = 0 |
static ETL_CONSTANT size_t | Bits_Per_Element = etl::integral_limits<element_type>::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::make_unsigned< ETL_BITSET_ELEMENT_TYPE >::type | element_type |
typedef element_type | 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_type *pdata_) | |
Constructor. | |
~ibitset () | |
Destructor. | |
![]() | |
static bool | is_equal (const ibitset &lhs, const ibitset &rhs) |
Compare bitsets. | |
![]() | |
element_type | Top_Mask |
class etl::bitset_string_too_small |
Bitset type_too_small exception.
Public Member Functions | |
bitset_string_too_small (string_type file_name_, numeric_type line_number_) | |
![]() | |
bitset_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
bitset_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
ETL_CONSTEXPR | exception (string_type reason_, string_type, numeric_type line_) |
Constructor. | |
ETL_CONSTEXPR string_type | what () const |
ETL_CONSTEXPR string_type | file_name () const |
ETL_CONSTEXPR numeric_type | line_number () const |
Additional Inherited Members | |
![]() | |
typedef const char * | string_type |
typedef int | numeric_type |
class etl::bitset_impl |
The implementation class for multi-element etl::bitset
Public Types | |
typedef etl::make_unsigned< TElement >::type | element_type |
typedef element_type * | pointer |
typedef const element_type * | const_pointer |
Public Member Functions | |
ETL_CONSTEXPR14 size_t | count (const_pointer pbuffer, size_t number_of_elements) const ETL_NOEXCEPT |
Count the number of bits set. | |
ETL_CONSTEXPR14 bool | test (const_pointer pbuffer, size_t number_of_elements, size_t position) const ETL_NOEXCEPT |
ETL_CONSTEXPR14 void | set (pointer pbuffer, size_t number_of_elements, size_t position, bool value=true) ETL_NOEXCEPT |
Set the bit at the position. | |
ETL_CONSTEXPR14 void | from_string (pointer pbuffer, size_t number_of_elements, size_t total_bits, const char *text) ETL_NOEXCEPT |
Set from a string. | |
ETL_CONSTEXPR14 void | from_string (pointer pbuffer, size_t number_of_elements, size_t total_bits, const wchar_t *text) ETL_NOEXCEPT |
Set from a wide string. | |
ETL_CONSTEXPR14 void | from_string (pointer pbuffer, size_t number_of_elements, size_t total_bits, const char16_t *text) ETL_NOEXCEPT |
Set from a u16 string. | |
ETL_CONSTEXPR14 void | from_string (pointer pbuffer, size_t number_of_elements, size_t total_bits, const char32_t *text) ETL_NOEXCEPT |
Set from a u32 string. | |
ETL_CONSTEXPR14 void | set (pointer pbuffer, size_t number_of_elements, size_t total_bits, const char *text) ETL_NOEXCEPT |
Set from a string. | |
ETL_CONSTEXPR14 void | set (pointer pbuffer, size_t number_of_elements, size_t total_bits, const wchar_t *text) ETL_NOEXCEPT |
Set from a wstring. | |
ETL_CONSTEXPR14 void | set (pointer pbuffer, size_t number_of_elements, size_t total_bits, const char16_t *text) ETL_NOEXCEPT |
Set from a u16string. | |
ETL_CONSTEXPR14 void | set (pointer pbuffer, size_t number_of_elements, size_t total_bits, const char32_t *text) ETL_NOEXCEPT |
Set from a u32string. | |
template<typename T > | |
ETL_CONSTEXPR14 etl::enable_if< etl::is_integral< T >::value, T >::type | value (const_pointer pbuffer, size_t number_of_elements) const ETL_NOEXCEPT |
Get as a value. | |
ETL_CONSTEXPR14 void | reset (pointer pbuffer, size_t number_of_elements, size_t position) ETL_NOEXCEPT |
Reset the bit at the position. | |
ETL_CONSTEXPR14 void | flip (pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT |
Flip all of the bits. | |
ETL_CONSTEXPR14 void | flip (pointer pbuffer, size_t number_of_elements, size_t position) ETL_NOEXCEPT |
Flip the bit at the position. | |
ETL_CONSTEXPR14 bool | all (const_pointer pbuffer, size_t number_of_elements, element_type top_mask) const ETL_NOEXCEPT |
ETL_CONSTEXPR14 bool | none (const_pointer pbuffer, size_t number_of_elements) const ETL_NOEXCEPT |
Are none of the bits set? | |
ETL_CONSTEXPR14 size_t | find_first (const_pointer pbuffer, size_t number_of_elements, size_t total_bits, bool state) const ETL_NOEXCEPT |
ETL_CONSTEXPR14 size_t | find_next (const_pointer pbuffer, size_t number_of_elements, size_t total_bits, bool state, size_t position) const ETL_NOEXCEPT |
template<typename TString > | |
ETL_CONSTEXPR14 TString | to_string (const_pointer pbuffer, size_t number_of_elements, size_t active_bits, typename TString::value_type zero, typename TString::value_type one) const |
Returns a string representing the bitset. | |
ETL_CONSTEXPR14 void | shift_left_equals (pointer pbuffer, size_t number_of_elements, size_t shift) ETL_NOEXCEPT |
shift_left_equals | |
ETL_CONSTEXPR14 void | shift_right_equals (pointer pbuffer, size_t number_of_elements, size_t shift) ETL_NOEXCEPT |
shift_right_equals | |
ETL_CONSTEXPR14 void | and_equals (pointer pbuffer, const_pointer pbuffer2, size_t number_of_elements) ETL_NOEXCEPT |
and_equals | |
ETL_CONSTEXPR14 void | or_equals (pointer pbuffer, const_pointer pbuffer2, size_t number_of_elements) ETL_NOEXCEPT |
or_equals | |
ETL_CONSTEXPR14 void | xor_equals (pointer pbuffer, const_pointer pbuffer2, size_t number_of_elements) ETL_NOEXCEPT |
xor_equals | |
ETL_CONSTEXPR14 void | initialise (pointer pbuffer, size_t number_of_elements, unsigned long long value) ETL_NOEXCEPT |
Initialise from an unsigned long long. | |
ETL_CONSTEXPR14 void | swap (pointer pbuffer1, pointer pbuffer2, size_t number_of_elements) |
Swap bitset buffers. | |
Static Public Attributes | |
static ETL_CONSTANT size_t | Bits_Per_Element = etl::integral_limits<element_type>::bits |
static ETL_CONSTANT element_type | All_Set_Element = etl::integral_limits<element_type>::max |
static ETL_CONSTANT element_type | All_Clear_Element = element_type(0) |
![]() | |
static ETL_CONSTANT size_t | npos = etl::integral_limits<size_t>::max |
|
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 |
Tests a bit at a position. Positions greater than the number of configured bits will return false.
ETL_CONSTEXPR14 bool etl::operator!= | ( | const bitset< Active_Bits, TElement, IsSingleElement > & | lhs, |
const bitset< Active_Bits, TElement, IsSingleElement > & | rhs | ||
) |
operator !=
bool etl::operator!= | ( | const bitset< MaxN > & | lhs, |
const bitset< MaxN > & | rhs | ||
) |
operator !=
ETL_CONSTEXPR14 bool etl::operator!= | ( | const bitset_ext< Active_Bits, TElement, IsSingleElement > & | lhs, |
const bitset_ext< Active_Bits, TElement, IsSingleElement > & | rhs | ||
) |
operator !=
ETL_CONSTEXPR14 bitset< Active_Bits > etl::operator& | ( | const bitset< Active_Bits, TElement, IsSingleElement > & | lhs, |
const bitset< Active_Bits, TElement, IsSingleElement > & | rhs | ||
) |
operator &
bitset< MaxN > etl::operator& | ( | const bitset< MaxN > & | lhs, |
const bitset< MaxN > & | rhs | ||
) |
operator &
ETL_CONSTEXPR14 bitset< Active_Bits > etl::operator^ | ( | const bitset< Active_Bits, TElement, IsSingleElement > & | lhs, |
const bitset< Active_Bits, TElement, IsSingleElement > & | rhs | ||
) |
operator ^
bitset< MaxN > etl::operator^ | ( | const bitset< MaxN > & | lhs, |
const bitset< MaxN > & | rhs | ||
) |
operator ^
ETL_CONSTEXPR14 bitset< Active_Bits > etl::operator| | ( | const bitset< Active_Bits, TElement, IsSingleElement > & | lhs, |
const bitset< Active_Bits, TElement, IsSingleElement > & | rhs | ||
) |
operator |