Embedded Template Library 1.0
Loading...
Searching...
No Matches
bitset

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 >
 Bitset forward declaration. More...
 
struct  etl::bitset_storage_model
 
class  etl::bitset_string_too_small
 
class  etl::bitset_invalid_buffer
 
class  etl::bitset_impl< TElement, Bitset_Layout >
 
class  etl::bitset_impl< TElement, etl::bitset_storage_model::Single >
 
class  etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >
 

Functions

template<size_t MaxN>
bitset< MaxNetl::operator& (const bitset< MaxN > &lhs, const bitset< MaxN > &rhs)
 
template<size_t MaxN>
bitset< MaxNetl::operator| (const bitset< MaxN > &lhs, const bitset< MaxN > &rhs)
 
template<size_t MaxN>
bitset< MaxNetl::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 >
ETL_CONSTEXPR14 bitset< Active_Bits > etl::operator& (const bitset< Active_Bits, TElement > &lhs, const bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bitset< Active_Bits > etl::operator| (const bitset< Active_Bits, TElement > &lhs, const bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bitset< Active_Bits > etl::operator^ (const bitset< Active_Bits, TElement > &lhs, const bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator!= (const etl::bitset< Active_Bits, TElement > &lhs, const etl::bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator!= (const etl::bitset_ext< Active_Bits, TElement > &lhs, const etl::bitset_ext< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator== (const etl::bitset< Active_Bits, TLhsElement > &lhs, const etl::bitset< Active_Bits, TRhsElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator!= (const etl::bitset< Active_Bits, TLhsElement > &lhs, const etl::bitset< Active_Bits, TRhsElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator== (const etl::bitset_ext< Active_Bits, TLhsElement > &lhs, const etl::bitset_ext< Active_Bits, TRhsElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator!= (const etl::bitset_ext< Active_Bits, TLhsElement > &lhs, const etl::bitset_ext< Active_Bits, TRhsElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator== (const etl::bitset< Active_Bits, TElement > &lhs, const etl::bitset_ext< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator!= (const etl::bitset< Active_Bits, TElement > &lhs, const etl::bitset_ext< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator== (const etl::bitset_ext< Active_Bits, TElement > &lhs, const etl::bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator!= (const etl::bitset_ext< Active_Bits, TElement > &lhs, const etl::bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator== (const etl::bitset< Active_Bits, TLhsElement > &lhs, const etl::bitset_ext< Active_Bits, TRhsElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator!= (const etl::bitset< Active_Bits, TLhsElement > &lhs, const etl::bitset_ext< Active_Bits, TRhsElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator== (const etl::bitset_ext< Active_Bits, TLhsElement > &lhs, const etl::bitset< Active_Bits, TRhsElement > &rhs) ETL_NOEXCEPT
 
template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator!= (const etl::bitset_ext< Active_Bits, TLhsElement > &lhs, const etl::bitset< Active_Bits, TRhsElement > &rhs) ETL_NOEXCEPT
 

Detailed Description

Similar to std::bitset but without requiring std::string.


Class Documentation

◆ etl::bitset_exception

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_)
 
- Public Member Functions inherited from etl::exception
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

- Public Types inherited from etl::exception
typedef const charstring_type
 
typedef int numeric_type
 

◆ etl::bitset_nullptr

class etl::bitset_nullptr

Bitset null pointer exception.

Public Member Functions

 bitset_nullptr (string_type file_name_, numeric_type line_number_)
 
- Public Member Functions inherited from etl::bitset_exception
 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_)
 
- Public Member Functions inherited from etl::exception
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

- Public Types inherited from etl::exception
typedef const charstring_type
 
typedef int numeric_type
 

◆ etl::bitset_type_too_small

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_)
 
- Public Member Functions inherited from etl::bitset_exception
 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_)
 
- Public Member Functions inherited from etl::exception
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

- Public Types inherited from etl::exception
typedef const charstring_type
 
typedef int numeric_type
 

◆ etl::bitset_overflow

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_)
 
- Public Member Functions inherited from etl::bitset_exception
 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_)
 
- Public Member Functions inherited from etl::exception
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

- Public Types inherited from etl::exception
typedef const charstring_type
 
typedef int numeric_type
 

◆ etl::ibitset

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
 
ibitsetset ()
 Set all bits.
 
ibitsetset (size_t position, bool value=true)
 Set the bit at the position.
 
ibitsetfrom_string (const char *text)
 Set from a string.
 
ibitsetfrom_string (const wchar_t *text)
 Set from a wide string.
 
ibitsetfrom_string (const char16_t *text)
 Set from a u16 string.
 
ibitsetfrom_string (const char32_t *text)
 Set from a u32 string.
 
ibitsetset (const char *text)
 Set from a string.
 
ibitsetset (const wchar_t *text)
 Set from a wstring.
 
ibitsetset (const char16_t *text)
 Set from a u16string.
 
ibitsetset (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.
 
ibitsetreset ()
 Resets the bitset.
 
ibitsetreset (size_t position)
 Reset the bit at the position.
 
ibitsetflip ()
 Flip all of the bits.
 
ibitsetflip (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.
 
ibitsetoperator&= (const ibitset &other)
 operator &=
 
ibitsetoperator|= (const ibitset &other)
 operator |=
 
ibitsetoperator^= (const ibitset &other)
 operator ^=
 
ibitsetoperator<<= (size_t shift)
 operator <<=
 
ibitsetoperator>>= (size_t shift)
 operator >>=
 
ibitsetoperator= (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

ibitsetinitialise (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
 

Member Function Documentation

◆ find_first()

size_t etl::ibitset::find_first ( bool  state) const
inline

Finds the first bit in the specified state.

Parameters
stateThe state to search for.
Returns
The position of the bit or Number_Of_Elements if none were found.

◆ find_next()

size_t etl::ibitset::find_next ( bool  state,
size_t  position 
) const
inline

Finds the next bit in the specified state.

Parameters
stateThe state to search for.
positionThe position to start from.
Returns
The position of the bit or ibitset::npos if none were found.

◆ test()

bool etl::ibitset::test ( size_t  position) const
inline

Tests a bit at a position. Positions greater than the number of configured bits will return false.

◆ etl::bitset

class etl::bitset
template<size_t MaxN>
class etl::bitset< MaxN >

Bitset forward declaration.

The bitset top level template.

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
MaxNThe number of bits.

Public Types

typedef etl::private_bitset::bitset_common< Active_Bits, TElement >::element_type element_type
 
typedef etl::private_bitset::bitset_common< Active_Bits, TElement >::span_type span_type
 
typedef etl::private_bitset::bitset_common< Active_Bits, TElement >::const_span_type const_span_type
 
- Public Types inherited from etl::ibitset
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 Types inherited from etl::private_bitset::bitset_common< Active_Bits, TElement >
typedef etl::private_bitset::bitset_impl_common< TElement >::element_type element_type
 
typedef etl::span< element_type, Number_Of_Elements > span_type
 
typedef etl::span< const element_type, Number_Of_Elements > const_span_type
 
- Public Types inherited from etl::private_bitset::bitset_impl_common< TElement >
typedef TElement element_type
 
typedef TElementpointer
 
typedef const TElementconst_pointer
 

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< MaxNoperator~ () const
 operator ~
 
bitset< MaxNoperator<< (size_t shift) const
 operator <<
 
bitset< MaxN > & operator<<= (size_t shift)
 operator <<=
 
bitset< MaxNoperator>> (size_t shift) const
 operator >>
 
bitset< MaxN > & operator>>= (size_t shift)
 operator >>=
 
 ETL_STATIC_ASSERT (etl::is_unsigned< TElement >::value, "The element type must be unsigned")
 
ETL_CONSTEXPR14 bitset () ETL_NOEXCEPT
 Default constructor.
 
ETL_CONSTEXPR14 bitset (const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
 Copy constructor.
 
template<typename TValue >
ETL_CONSTEXPR14 bitset (TValue value, typename etl::enable_if< is_integral< TValue >::value >::type *=0) ETL_NOEXCEPT
 Construct from a value.
 
template<typename TPString >
ETL_CONSTEXPR14 bitset (TPString text, typename etl::enable_if< is_same< TPString, const char * >::value >::type *=0) ETL_NOEXCEPT
 Construct from a string.
 
template<typename TPString >
ETL_CONSTEXPR14 bitset (TPString text, typename etl::enable_if< is_same< TPString, const wchar_t * >::value >::type *=0) ETL_NOEXCEPT
 Construct from a string.
 
template<typename TPString >
ETL_CONSTEXPR14 bitset (TPString text, typename etl::enable_if< is_same< TPString, const char16_t * >::value >::type *=0) ETL_NOEXCEPT
 Construct from a string.
 
template<typename TPString >
ETL_CONSTEXPR14 bitset (TPString text, typename etl::enable_if< is_same< TPString, const char32_t * >::value >::type *=0) ETL_NOEXCEPT
 Construct from a string.
 
ETL_CONSTEXPR14 bitsetoperator= (const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
 Assignment operator.
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set () ETL_NOEXCEPT
 Set all of the bits.
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set (size_t position, bool value=true)
 Set the bit at the position.
 
template<size_t Position>
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set (bool value=true)
 Set the bit at the position.
 
template<size_t Position, bool Value>
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set ()
 Set the bit at the position.
 
template<typename TPString >
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constchar * >::value, bitset< Active_Bits, TElement > & >::type set (TPString text) ETL_NOEXCEPT
 Set from a string.
 
template<typename TPString >
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constwchar_t * >::value, bitset< Active_Bits, TElement > & >::type set (TPString text) ETL_NOEXCEPT
 Set from a wide string.
 
template<typename TPString >
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constchar16_t * >::value, bitset< Active_Bits, TElement > & >::type set (TPString text) ETL_NOEXCEPT
 Set from a char16 string.
 
template<typename TPString >
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constchar32_t * >::value, bitset< Active_Bits, TElement > & >::type set (TPString text) ETL_NOEXCEPT
 Set from a char32 string.
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string (const char *text) ETL_NOEXCEPT
 Set from a string.
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string (const wchar_t *text) ETL_NOEXCEPT
 Set from a wide string.
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string (const char16_t *text) ETL_NOEXCEPT
 Set from a u16 string.
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string (const char32_t *text) ETL_NOEXCEPT
 Set from a u32 string.
 
template<typename T >
ETL_CONSTEXPR14 etl::enable_if< etl::is_integral< T >::value, T >::type value () const ETL_NOEXCEPT
 Get as an integral value.
 
template<typename T >
ETL_CONSTEXPR14 T extract (size_t position, size_t length=etl::integral_limits< T >::bits) const
 
template<typename T , size_t Position, size_t Length>
ETL_CONSTEXPR14 T extract () const
 
unsigned long to_ulong () const
 Get as an unsigned long.
 
unsigned long long to_ullong () const
 Get as an unsigned long long.
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & reset () ETL_NOEXCEPT
 Reset all of the bits.
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & reset (size_t position)
 Reset the bit at the position.
 
ETL_CONSTEXPR14 bool test (size_t position) const
 
template<size_t Position>
ETL_CONSTEXPR14 bool test () const
 
ETL_CONSTEXPR14 size_t count () const ETL_NOEXCEPT
 Count the number of bits set.
 
ETL_CONSTEXPR14 bool all () const ETL_NOEXCEPT
 
ETL_CONSTEXPR14 bool all (element_type mask) const ETL_NOEXCEPT
 
ETL_CONSTEXPR14 bool none () const ETL_NOEXCEPT
 Are none of the bits set?
 
ETL_CONSTEXPR14 bool none (element_type mask) const ETL_NOEXCEPT
 Are none of the mask bits set?
 
ETL_CONSTEXPR14 bool any () const ETL_NOEXCEPT
 Are any of the bits set?
 
ETL_CONSTEXPR14 bool any (element_type mask) const ETL_NOEXCEPT
 Are any of the mask bits set?
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & flip () ETL_NOEXCEPT
 Flip all of the bits.
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & flip (size_t position)
 Flip the bit at the position.
 
ETL_CONSTEXPR14 bool operator[] (size_t position) const ETL_NOEXCEPT
 Read [] operator.
 
ETL_CONSTEXPR14 bit_reference operator[] (size_t position) ETL_NOEXCEPT
 Write [] operator.
 
template<typename TString >
ETL_CONSTEXPR14 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.
 
ETL_CONSTEXPR14 size_t find_first (bool state) const ETL_NOEXCEPT
 
ETL_CONSTEXPR14 size_t find_next (bool state, size_t position) const ETL_NOEXCEPT
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElementoperator& (const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
 operator &
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator&= (const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
 operator &=
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElementoperator| (const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
 operator |
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator|= (const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
 operator |=
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElementoperator^ (const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
 operator ^
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator^= (const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
 operator ^=
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElementoperator~ () const ETL_NOEXCEPT
 operator ~
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElementoperator<< (size_t shift) const ETL_NOEXCEPT
 operator <<
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator<<= (size_t shift) ETL_NOEXCEPT
 operator <<=
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElementoperator>> (size_t shift) const ETL_NOEXCEPT
 operator >>
 
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator>>= (size_t shift) ETL_NOEXCEPT
 operator >>=
 
ETL_CONSTEXPR14 void swap (etl::bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
 swap
 
ETL_CONSTEXPR14 span_type span () ETL_NOEXCEPT
 
ETL_CONSTEXPR14 const_span_type span () const ETL_NOEXCEPT
 
- Public Member Functions inherited from etl::ibitset
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
 
ibitsetset ()
 Set all bits.
 
ibitsetset (size_t position, bool value=true)
 Set the bit at the position.
 
ibitsetfrom_string (const char *text)
 Set from a string.
 
ibitsetfrom_string (const wchar_t *text)
 Set from a wide string.
 
ibitsetfrom_string (const char16_t *text)
 Set from a u16 string.
 
ibitsetfrom_string (const char32_t *text)
 Set from a u32 string.
 
ibitsetset (const char *text)
 Set from a string.
 
ibitsetset (const wchar_t *text)
 Set from a wstring.
 
ibitsetset (const char16_t *text)
 Set from a u16string.
 
ibitsetset (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.
 
ibitsetreset ()
 Resets the bitset.
 
ibitsetreset (size_t position)
 Reset the bit at the position.
 
ibitsetflip ()
 Flip all of the bits.
 
ibitsetflip (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.
 
ibitsetoperator&= (const ibitset &other)
 operator &=
 
ibitsetoperator|= (const ibitset &other)
 operator |=
 
ibitsetoperator^= (const ibitset &other)
 operator ^=
 
ibitsetoperator<<= (size_t shift)
 operator <<=
 
ibitsetoperator>>= (size_t shift)
 operator >>=
 
ibitsetoperator= (const ibitset &other)
 operator =
 
void swap (ibitset &other)
 swap
 

Static Public Member Functions

static ETL_CONSTEXPR size_t size () ETL_NOEXCEPT
 The number of bits in the bitset.
 
static ETL_CONSTEXPR size_t number_of_elements () ETL_NOEXCEPT
 The number of storage elements in the bitset.
 
static ETL_CONSTEXPR element_type all_set_element () ETL_NOEXCEPT
 The value of a set element.
 
static ETL_CONSTEXPR element_type all_clear_element () ETL_NOEXCEPT
 The value of a clear element.
 
static ETL_CONSTEXPR size_t bits_per_element () ETL_NOEXCEPT
 The number of bits in an element.
 
static ETL_CONSTEXPR element_type top_mask () ETL_NOEXCEPT
 The mask for the msb element.
 
static ETL_CONSTEXPR size_t allocated_bits () ETL_NOEXCEPT
 The total number of bits of storage, including unused.
 
static ETL_CONSTEXPR etl::bitset_storage_model storage_model () ETL_NOEXCEPT
 

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 Public Attributes inherited from etl::ibitset
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
 
- Static Public Attributes inherited from etl::private_bitset::bitset_common< Active_Bits, TElement >
static ETL_CONSTANT size_t Number_Of_Elements = (Active_Bits % Bits_Per_Element == 0) ? Active_Bits / Bits_Per_Element : Active_Bits / Bits_Per_Element + 1
 
static ETL_CONSTANT size_t Size = Active_Bits
 
static ETL_CONSTANT size_t Allocated_Bits = Number_Of_Elements * Bits_Per_Element
 
static ETL_CONSTANT etl::bitset_storage_model Storage_Model = (bitset_common<Active_Bits, TElement>::Number_Of_Elements == 1U) ? etl::bitset_storage_model::Single : etl::bitset_storage_model::Multi
 
static ETL_CONSTANT TElement Top_Mask = element_type(Top_Mask_Shift == 0 ? All_Set_Element : ~(All_Set_Element << Top_Mask_Shift))
 
- Static Public Attributes inherited from etl::private_bitset::bitset_impl_common< TElement >
static ETL_CONSTANT size_t npos = etl::integral_limits<size_t>::max
 
static ETL_CONSTANT size_t Bits_Per_Element = etl::integral_limits<TElement>::bits
 
static ETL_CONSTANT TElement All_Set_Element = etl::integral_limits<TElement>::max
 
static ETL_CONSTANT TElement All_Clear_Element = element_type(0)
 

Friends

bool operator== (const bitset< MaxN > &lhs, const bitset< MaxN > &rhs)
 operator ==
 
ETL_CONSTEXPR14 bool operator== (const bitset< Active_Bits, TElement > &lhs, const bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 operator ==
 
ETL_CONSTEXPR14 bool operator!= (const bitset< Active_Bits, TElement > &lhs, const bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
 operator !=
 

Additional Inherited Members

- Protected Member Functions inherited from etl::ibitset
ibitsetinitialise (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 inherited from etl::ibitset
static bool is_equal (const ibitset &lhs, const ibitset &rhs)
 Compare bitsets.
 
- Protected Attributes inherited from etl::ibitset
element_type Top_Mask
 

Member Function Documentation

◆ extract() [1/2]

template<size_t MaxN>
template<typename T , size_t Position, size_t Length>
ETL_CONSTEXPR14 T etl::bitset< MaxN >::extract ( ) const
inline

Extract an integral value from an arbitrary position and length. Compile time position and length.

◆ extract() [2/2]

template<size_t MaxN>
template<typename T >
ETL_CONSTEXPR14 T etl::bitset< MaxN >::extract ( size_t  position,
size_t  length = etl::integral_limits<T>::bits 
) const
inline

Extract an integral value from an arbitrary position and length. Run time position and length.

◆ find_first()

template<size_t MaxN>
ETL_CONSTEXPR14 size_t etl::bitset< MaxN >::find_first ( bool  state) const
inline

Finds the first bit in the specified state.

Parameters
stateThe state to search for.
Returns
The position of the bit or npos if none were found.

◆ find_next()

template<size_t MaxN>
ETL_CONSTEXPR14 size_t etl::bitset< MaxN >::find_next ( bool  state,
size_t  position 
) const
inline

Finds the next bit in the specified state.

Parameters
stateThe state to search for.
positionThe position to start from.
Returns
The position of the bit or npos if none were found.

◆ span() [1/2]

template<size_t MaxN>
ETL_CONSTEXPR14 const_span_type etl::bitset< MaxN >::span ( ) const
inline

span Returns a const span of the underlying buffer.

◆ span() [2/2]

template<size_t MaxN>
ETL_CONSTEXPR14 span_type etl::bitset< MaxN >::span ( )
inline

span Returns a span of the underlying buffer.

◆ storage_model()

template<size_t MaxN>
static ETL_CONSTEXPR etl::bitset_storage_model etl::bitset< MaxN >::storage_model ( )
inlinestatic

The storage model for the bitset. etl::bitset_storage_model::Single etl::bitset_storage_model::Multi

◆ test() [1/2]

template<size_t MaxN>
template<size_t Position>
ETL_CONSTEXPR14 bool etl::bitset< MaxN >::test ( ) const
inline

Tests a bit at a position. Positions greater than the number of configured bits will not compile.

◆ test() [2/2]

template<size_t MaxN>
ETL_CONSTEXPR14 bool etl::bitset< MaxN >::test ( size_t  position) const
inline

Tests a bit at a position. Positions greater than the number of configured bits will return false.

Friends And Related Symbol Documentation

◆ operator!=

template<size_t MaxN>
ETL_CONSTEXPR14 bool operator!= ( const bitset< Active_Bits, TElement > &  lhs,
const bitset< Active_Bits, TElement > &  rhs 
)
friend

operator !=

operator !=

◆ etl::bitset_storage_model

struct etl::bitset_storage_model

Flags to indicate whether the bitset is contained in a single element or spread over an array of elements.

Public Types

enum  enum_type { Undefined = 0 , Single = 1 , Multi = 2 }
 

◆ etl::bitset_string_too_small

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_)
 
- Public Member Functions inherited from etl::bitset_exception
 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_)
 
- Public Member Functions inherited from etl::exception
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

- Public Types inherited from etl::exception
typedef const charstring_type
 
typedef int numeric_type
 

◆ etl::bitset_invalid_buffer

class etl::bitset_invalid_buffer

Bitset nullptr buffer exception.

Public Member Functions

 bitset_invalid_buffer (string_type file_name_, numeric_type line_number_)
 
- Public Member Functions inherited from etl::bitset_exception
 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_)
 
- Public Member Functions inherited from etl::exception
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

- Public Types inherited from etl::exception
typedef const charstring_type
 
typedef int numeric_type
 

◆ etl::bitset_impl

class etl::bitset_impl
template<typename TElement, char Bitset_Layout>
class etl::bitset_impl< TElement, Bitset_Layout >

Bitset implementation declaration.

◆ etl::bitset_impl< TElement, etl::bitset_storage_model::Single >

class etl::bitset_impl< TElement, etl::bitset_storage_model::Single >
template<typename TElement>
class etl::bitset_impl< TElement, etl::bitset_storage_model::Single >

The implementation class for single element etl::bitset

Static Public Member Functions

static ETL_CONSTEXPR14 void set_all (pointer pbuffer, size_t, element_type top_mask) ETL_NOEXCEPT
 Set all of the bits.
 
static ETL_CONSTEXPR14 void set_position (pointer pbuffer, size_t position, bool value=true)
 Set the bit at the position.
 
template<size_t Position>
static ETL_CONSTEXPR14 void set_position (pointer pbuffer, bool value=true)
 Set the bit at the position.
 
template<size_t Position, bool Value>
static ETL_CONSTEXPR14 void set_position (pointer pbuffer)
 Set the bit at the position.
 
static ETL_CONSTEXPR14 void reset_all (pointer pbuffer, size_t) ETL_NOEXCEPT
 Reset all of the bits.
 
static ETL_CONSTEXPR14 void reset_position (pointer pbuffer, size_t position)
 Reset the bit at the position.
 
static ETL_CONSTEXPR14 void from_string (pointer pbuffer, size_t, size_t active_bits, const char *text) ETL_NOEXCEPT
 Set from a string.
 
static ETL_CONSTEXPR14 void from_string (pointer pbuffer, size_t, size_t active_bits, const wchar_t *text) ETL_NOEXCEPT
 Set from a wide string.
 
static ETL_CONSTEXPR14 void from_string (pointer pbuffer, size_t, size_t active_bits, const char16_t *text) ETL_NOEXCEPT
 Set from a u16 string.
 
static ETL_CONSTEXPR14 void from_string (pointer pbuffer, size_t, size_t active_bits, const char32_t *text) ETL_NOEXCEPT
 Set from a u32 string.
 
template<typename T >
static ETL_CONSTEXPR14 T value (const_pointer pbuffer, size_t) ETL_NOEXCEPT
 Get as an integral value.
 
template<typename T >
static ETL_CONSTEXPR14 T extract (const_pointer pbuffer, size_t position, size_t length=etl::integral_limits< T >::bits)
 Extract an integral value from an arbitrary position and length.
 
template<typename T , size_t Position, size_t Length>
static ETL_CONSTEXPR14 T extract (const_pointer pbuffer)
 Extract an integral value from an arbitrary position and length.
 
static ETL_CONSTEXPR14 bool test (const_pointer pbuffer, size_t position)
 
static ETL_CONSTEXPR14 size_t count (const_pointer pbuffer, size_t) ETL_NOEXCEPT
 Count the number of bits set.
 
static ETL_CONSTEXPR14 bool all (const_pointer pbuffer, size_t, element_type top_mask) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 bool all (const_pointer pbuffer, size_t, element_type top_mask, element_type mask) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 bool none (const_pointer pbuffer, size_t) ETL_NOEXCEPT
 Are none of the bits set?
 
static ETL_CONSTEXPR14 bool none (const_pointer pbuffer, size_t, element_type mask) ETL_NOEXCEPT
 Are none of the mask bits set?
 
static ETL_CONSTEXPR14 bool any (const_pointer pbuffer, size_t) ETL_NOEXCEPT
 Are any of the bits set?
 
static ETL_CONSTEXPR14 bool any (const_pointer pbuffer, size_t, element_type mask) ETL_NOEXCEPT
 Are any of the mask bits set?
 
static ETL_CONSTEXPR14 void flip_all (pointer pbuffer, size_t) ETL_NOEXCEPT
 Flip all of the bits.
 
static ETL_CONSTEXPR14 void flip_bits (pointer pbuffer, element_type mask=etl::integral_limits< element_type >::max) ETL_NOEXCEPT
 Flip some of the bits.
 
static ETL_CONSTEXPR14 void flip_position (pointer pbuffer, size_t position)
 Flip the bit at the position.
 
template<typename TString >
static ETL_CONSTEXPR14 TString to_string (const_pointer pbuffer, size_t active_bits, typename TString::value_type zero=typename TString::value_type('0'), typename TString::value_type one=typename TString::value_type('1'))
 Returns a string representing the bitset.
 
static ETL_CONSTEXPR14 size_t find_next (const_pointer pbuffer, size_t, size_t active_bits, bool state, size_t position) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 void operator_assignment (pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 void operator_and (pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 void operator_or (pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 void operator_xor (pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 void operator_not (pointer pbuffer, size_t) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 void operator_shift_left (pointer pbuffer, size_t, size_t active_bits, size_t shift) ETL_NOEXCEPT
 operator_shift_left
 
static ETL_CONSTEXPR14 void operator_shift_right (pointer pbuffer, size_t, size_t active_bits, size_t shift) ETL_NOEXCEPT
 operator_shift_right
 
static ETL_CONSTEXPR14 bool operator_equality (const_pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
 operator_equality
 
template<typename TElementType >
static ETL_CONSTEXPR14 void initialise (pointer pbuffer, size_t, unsigned long long value) ETL_NOEXCEPT
 Initialise from an unsigned long long.
 
static ETL_CONSTEXPR14 void swap (pointer lhs_pbuffer, pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
 swap
 

Additional Inherited Members

- Public Types inherited from etl::private_bitset::bitset_impl_common< TElement >
typedef TElement element_type
 
typedef TElementpointer
 
typedef const TElementconst_pointer
 
- Static Public Attributes inherited from etl::private_bitset::bitset_impl_common< TElement >
static ETL_CONSTANT size_t npos = etl::integral_limits<size_t>::max
 
static ETL_CONSTANT size_t Bits_Per_Element = etl::integral_limits<TElement>::bits
 
static ETL_CONSTANT TElement All_Set_Element = etl::integral_limits<TElement>::max
 
static ETL_CONSTANT TElement All_Clear_Element = element_type(0)
 

Member Function Documentation

◆ find_next()

template<typename TElement >
static ETL_CONSTEXPR14 size_t etl::bitset_impl< TElement, etl::bitset_storage_model::Single >::find_next ( const_pointer  pbuffer,
size_t  ,
size_t  active_bits,
bool  state,
size_t  position 
)
inlinestatic

Finds the next bit in the specified state.

Parameters
stateThe state to search for.
positionThe position to start from.
Returns
The position of the bit or npos if none were found.

◆ operator_and()

template<typename TElement >
static ETL_CONSTEXPR14 void etl::bitset_impl< TElement, etl::bitset_storage_model::Single >::operator_and ( pointer  lhs_pbuffer,
const_pointer  rhs_pbuffer,
size_t   
)
inlinestatic

operator and AND lhs and rhs and put the result in lhs

◆ operator_assignment()

template<typename TElement >
static ETL_CONSTEXPR14 void etl::bitset_impl< TElement, etl::bitset_storage_model::Single >::operator_assignment ( pointer  lhs_pbuffer,
const_pointer  rhs_pbuffer,
size_t   
)
inlinestatic

operator assignment Assigns rhs to lhs

◆ operator_not()

template<typename TElement >
static ETL_CONSTEXPR14 void etl::bitset_impl< TElement, etl::bitset_storage_model::Single >::operator_not ( pointer  pbuffer,
size_t   
)
inlinestatic

operator ~ NOT the value in the buffer

◆ operator_or()

template<typename TElement >
static ETL_CONSTEXPR14 void etl::bitset_impl< TElement, etl::bitset_storage_model::Single >::operator_or ( pointer  lhs_pbuffer,
const_pointer  rhs_pbuffer,
size_t   
)
inlinestatic

operator or OR lhs and rhs and put the result in lhs

◆ operator_xor()

template<typename TElement >
static ETL_CONSTEXPR14 void etl::bitset_impl< TElement, etl::bitset_storage_model::Single >::operator_xor ( pointer  lhs_pbuffer,
const_pointer  rhs_pbuffer,
size_t   
)
inlinestatic

operator xor XOR lhs and rhs and put the result in lhs

◆ test()

template<typename TElement >
static ETL_CONSTEXPR14 bool etl::bitset_impl< TElement, etl::bitset_storage_model::Single >::test ( const_pointer  pbuffer,
size_t  position 
)
inlinestatic

Tests a bit at a position. Positions greater than the number of configured bits will return false.

◆ etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >

class etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >
template<typename TElement>
class etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >

The implementation class for multi element etl::bitset

Static Public Member Functions

static ETL_CONSTEXPR14 bool test (const_pointer pbuffer, size_t position) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 size_t count (const_pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 Count the number of bits set.
 
static ETL_CONSTEXPR14 bool all (const_pointer pbuffer, size_t number_of_elements, element_type top_mask) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 bool none (const_pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 Are none of the bits set?
 
static ETL_CONSTEXPR14 bool any (const_pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 Are any of the bits set?
 
static ETL_CONSTEXPR14 void set_all (pointer pbuffer, size_t number_of_elements, element_type top_mask) ETL_NOEXCEPT
 Set all bits.
 
static ETL_CONSTEXPR14 void set_position (pointer pbuffer, size_t position, bool value=true) ETL_NOEXCEPT
 Set the bit at the position.
 
template<size_t Position>
static ETL_CONSTEXPR14 void set_position (pointer pbuffer, bool value=true)
 Set the bit at the position.
 
template<size_t Position, bool Value>
static ETL_CONSTEXPR14 void set_position (pointer pbuffer)
 Set the bit at the position.
 
static 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.
 
static 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.
 
static 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.
 
static 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.
 
static ETL_CONSTEXPR14 void reset_all (pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 Reset all of the bits.
 
static ETL_CONSTEXPR14 void reset_position (pointer pbuffer, size_t position) ETL_NOEXCEPT
 Reset the bit at the position.
 
template<typename T >
static ETL_CONSTEXPR14 T value (const_pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 Get as a value.
 
template<typename T >
static ETL_CONSTEXPR14 etl::make_unsigned< T >::type extract_from_multiple_elements (const element_type *pbuffer, int element_index, size_t active_bits_in_msb, size_t length) ETL_NOEXCEPT
 Extract an value from multiple elements.
 
template<typename T >
static ETL_CONSTEXPR14 etl::make_unsigned< T >::type extract_from_buffer (const_pointer pbuffer, size_t position, size_t length) ETL_NOEXCEPT
 
template<typename T , size_t Position, size_t Length>
static ETL_CONSTEXPR14 etl::enable_if< value_is_in_one_element< Position, Length, Bits_Per_Element >::value, typenameetl::make_unsigned< T >::type >::type extract_from_buffer (const_pointer pbuffer)
 
template<typename T , size_t Position, size_t Length>
static ETL_CONSTEXPR14 etl::enable_if<!value_is_in_one_element< Position, Length, Bits_Per_Element >::value, typenameetl::make_unsigned< T >::type >::type extract_from_buffer (const_pointer pbuffer)
 
template<typename T >
static ETL_CONSTEXPR14 T extract (const_pointer pbuffer, size_t position, size_t length=etl::integral_limits< T >::bits)
 Extract an integral value from an arbitrary position and length.
 
template<typename T , size_t Position, size_t Length>
static ETL_CONSTEXPR14 T extract (const_pointer pbuffer)
 Extract an integral value from an arbitrary position and length.
 
static ETL_CONSTEXPR14 void flip_all (pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 Flip all of the bits.
 
static ETL_CONSTEXPR14 void flip_position (pointer pbuffer, size_t position) ETL_NOEXCEPT
 Flip the bit at the position.
 
static ETL_CONSTEXPR14 size_t find_next (const_pointer pbuffer, size_t number_of_elements, size_t total_bits, bool state, size_t position) ETL_NOEXCEPT
 
template<typename TString >
static ETL_CONSTEXPR14 TString to_string (const_pointer pbuffer, size_t active_bits, typename TString::value_type zero, typename TString::value_type one)
 Returns a string representing the bitset.
 
static ETL_CONSTEXPR14 void operator_assignment (pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 operator assignment
 
static ETL_CONSTEXPR14 void operator_and (pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 operator and
 
static ETL_CONSTEXPR14 void operator_or (pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 operator or
 
static ETL_CONSTEXPR14 void operator_xor (pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 operator xor
 
static ETL_CONSTEXPR14 void operator_not (pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 operator not
 
static ETL_CONSTEXPR14 void operator_shift_left (pointer pbuffer, size_t number_of_elements, size_t active_bits, size_t shift) ETL_NOEXCEPT
 operator_shift_left
 
static ETL_CONSTEXPR14 void operator_shift_right (pointer pbuffer, size_t number_of_elements, size_t active_bits, size_t shift) ETL_NOEXCEPT
 operator_shift_right
 
static ETL_CONSTEXPR14 bool operator_equality (const_pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t number_of_elements) ETL_NOEXCEPT
 operator_equality
 
template<typename TElementType >
static ETL_CONSTEXPR14 etl::enable_if< etl::integral_limits< TElementType >::bits==etl::integral_limits< unsignedlonglong >::bits, void >::type initialise (pointer pbuffer, size_t number_of_elements, unsigned long long value) ETL_NOEXCEPT
 
template<typename TElementType >
static ETL_CONSTEXPR14 etl::enable_if< etl::integral_limits< TElementType >::bits!=etl::integral_limits< unsignedlonglong >::bits, void >::type initialise (pointer pbuffer, size_t number_of_elements, unsigned long long value) ETL_NOEXCEPT
 
static ETL_CONSTEXPR14 void swap (pointer pbuffer1, pointer pbuffer2, size_t number_of_elements)
 Swap bitset buffers.
 

Additional Inherited Members

- Public Types inherited from etl::private_bitset::bitset_impl_common< TElement >
typedef TElement element_type
 
typedef TElementpointer
 
typedef const TElementconst_pointer
 
- Static Public Attributes inherited from etl::private_bitset::bitset_impl_common< TElement >
static ETL_CONSTANT size_t npos = etl::integral_limits<size_t>::max
 
static ETL_CONSTANT size_t Bits_Per_Element = etl::integral_limits<TElement>::bits
 
static ETL_CONSTANT TElement All_Set_Element = etl::integral_limits<TElement>::max
 
static ETL_CONSTANT TElement All_Clear_Element = element_type(0)
 

Member Function Documentation

◆ extract_from_buffer() [1/3]

template<typename TElement >
template<typename T , size_t Position, size_t Length>
static ETL_CONSTEXPR14 etl::enable_if< value_is_in_one_element< Position, Length, Bits_Per_Element >::value, typenameetl::make_unsigned< T >::type >::type etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >::extract_from_buffer ( const_pointer  pbuffer)
inlinestatic

Extract an integral value when the value fits in one element. Compile time position and length.

◆ extract_from_buffer() [2/3]

template<typename TElement >
template<typename T , size_t Position, size_t Length>
static ETL_CONSTEXPR14 etl::enable_if<!value_is_in_one_element< Position, Length, Bits_Per_Element >::value, typenameetl::make_unsigned< T >::type >::type etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >::extract_from_buffer ( const_pointer  pbuffer)
inlinestatic

Extract an integral value when the value spans more than one element. Compile time position and length.

◆ extract_from_buffer() [3/3]

template<typename TElement >
template<typename T >
static ETL_CONSTEXPR14 etl::make_unsigned< T >::type etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >::extract_from_buffer ( const_pointer  pbuffer,
size_t  position,
size_t  length 
)
inlinestatic

Extract an integral value from an arbitrary position and length. Run time position and length.

◆ find_next()

template<typename TElement >
static ETL_CONSTEXPR14 size_t etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >::find_next ( const_pointer  pbuffer,
size_t  number_of_elements,
size_t  total_bits,
bool  state,
size_t  position 
)
inlinestatic

Finds the next bit in the specified state.

Parameters
stateThe state to search for.
positionThe position to start from.
Returns
The position of the bit or npos if none were found.

◆ initialise() [1/2]

template<typename TElement >
template<typename TElementType >
static ETL_CONSTEXPR14 etl::enable_if< etl::integral_limits< TElementType >::bits==etl::integral_limits< unsignedlonglong >::bits, void >::type etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >::initialise ( pointer  pbuffer,
size_t  number_of_elements,
unsigned long long  value 
)
inlinestatic

Initialise from an unsigned long long. Enabled if the number of bits in the element equals the number of bits in an unsigned long long.

◆ initialise() [2/2]

template<typename TElement >
template<typename TElementType >
static ETL_CONSTEXPR14 etl::enable_if< etl::integral_limits< TElementType >::bits!=etl::integral_limits< unsignedlonglong >::bits, void >::type etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >::initialise ( pointer  pbuffer,
size_t  number_of_elements,
unsigned long long  value 
)
inlinestatic

Initialise from an unsigned long long. Enabled if the number of bits in the element doesn't equal the number of bits in an unsigned long long.

◆ test()

template<typename TElement >
static ETL_CONSTEXPR14 bool etl::bitset_impl< TElement, etl::bitset_storage_model::Multi >::test ( const_pointer  pbuffer,
size_t  position 
)
inlinestatic

Tests a bit at a position. Positions greater than the number of configured bits will return false.

Function Documentation

◆ operator!=() [1/9]

template<size_t MaxN>
bool etl::operator!= ( const bitset< MaxN > &  lhs,
const bitset< MaxN > &  rhs 
)

operator !=

◆ operator!=() [2/9]

template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator!= ( const etl::bitset< Active_Bits, TElement > &  lhs,
const etl::bitset< Active_Bits, TElement > &  rhs 
)

operator !=

◆ operator!=() [3/9]

template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator!= ( const etl::bitset< Active_Bits, TElement > &  lhs,
const etl::bitset_ext< Active_Bits, TElement > &  rhs 
)

operator != bitset compared with bitset_ext, same element types.

◆ operator!=() [4/9]

template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator!= ( const etl::bitset< Active_Bits, TLhsElement > &  lhs,
const etl::bitset< Active_Bits, TRhsElement > &  rhs 
)

operator != bitset Different element types

◆ operator!=() [5/9]

template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator!= ( const etl::bitset< Active_Bits, TLhsElement > &  lhs,
const etl::bitset_ext< Active_Bits, TRhsElement > &  rhs 
)

operator != bitset compared with bitset_ext, different element types.

◆ operator!=() [6/9]

template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator!= ( const etl::bitset_ext< Active_Bits, TElement > &  lhs,
const etl::bitset< Active_Bits, TElement > &  rhs 
)

operator != bitset_ext compared with bitset, same element types.

◆ operator!=() [7/9]

template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator!= ( const etl::bitset_ext< Active_Bits, TElement > &  lhs,
const etl::bitset_ext< Active_Bits, TElement > &  rhs 
)

operator !=

◆ operator!=() [8/9]

template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator!= ( const etl::bitset_ext< Active_Bits, TLhsElement > &  lhs,
const etl::bitset< Active_Bits, TRhsElement > &  rhs 
)

operator != bitset_ext compared with bitset, different element types.

◆ operator!=() [9/9]

template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator!= ( const etl::bitset_ext< Active_Bits, TLhsElement > &  lhs,
const etl::bitset_ext< Active_Bits, TRhsElement > &  rhs 
)

operator != bitset_ext Different element types

◆ operator&() [1/2]

template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bitset< Active_Bits > etl::operator& ( const bitset< Active_Bits, TElement > &  lhs,
const bitset< Active_Bits, TElement > &  rhs 
)

operator &

◆ operator&() [2/2]

template<size_t MaxN>
bitset< MaxN > etl::operator& ( const bitset< MaxN > &  lhs,
const bitset< MaxN > &  rhs 
)

operator &

◆ operator==() [1/6]

template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator== ( const etl::bitset< Active_Bits, TElement > &  lhs,
const etl::bitset_ext< Active_Bits, TElement > &  rhs 
)

operator == bitset compared with bitset_ext, same element types.

◆ operator==() [2/6]

template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator== ( const etl::bitset< Active_Bits, TLhsElement > &  lhs,
const etl::bitset< Active_Bits, TRhsElement > &  rhs 
)

operator == bitset Different element types

◆ operator==() [3/6]

template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator== ( const etl::bitset< Active_Bits, TLhsElement > &  lhs,
const etl::bitset_ext< Active_Bits, TRhsElement > &  rhs 
)

operator == bitset compared with bitset_ext, different element types.

◆ operator==() [4/6]

template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bool operator== ( const etl::bitset_ext< Active_Bits, TElement > &  lhs,
const etl::bitset< Active_Bits, TElement > &  rhs 
)

operator == bitset_ext compared with bitset, same element types.

◆ operator==() [5/6]

template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator== ( const etl::bitset_ext< Active_Bits, TLhsElement > &  lhs,
const etl::bitset< Active_Bits, TRhsElement > &  rhs 
)

operator == bitset_ext compared with bitset, different element types.

◆ operator==() [6/6]

template<size_t Active_Bits, typename TLhsElement , typename TRhsElement >
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator== ( const etl::bitset_ext< Active_Bits, TLhsElement > &  lhs,
const etl::bitset_ext< Active_Bits, TRhsElement > &  rhs 
)

operator == bitset_ext Different element types

◆ operator^() [1/2]

template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bitset< Active_Bits > etl::operator^ ( const bitset< Active_Bits, TElement > &  lhs,
const bitset< Active_Bits, TElement > &  rhs 
)

operator ^

◆ operator^() [2/2]

template<size_t MaxN>
bitset< MaxN > etl::operator^ ( const bitset< MaxN > &  lhs,
const bitset< MaxN > &  rhs 
)

operator ^

◆ operator|() [1/2]

template<size_t Active_Bits, typename TElement >
ETL_CONSTEXPR14 bitset< Active_Bits > etl::operator| ( const bitset< Active_Bits, TElement > &  lhs,
const bitset< Active_Bits, TElement > &  rhs 
)

operator |

◆ operator|() [2/2]

template<size_t MaxN>
bitset< MaxN > etl::operator| ( const bitset< MaxN > &  lhs,
const bitset< MaxN > &  rhs 
)

operator |