Embedded Template Library 1.0
Loading...
Searching...
No Matches
etl::bitset< 0U, unsigned char > Class Reference

Specialisation for zero bits. More...

#include <bitset_new.h>

Public Types

typedef etl::private_bitset::bitset_common< 0U, unsignedchar >::element_type element_type
typedef etl::private_bitset::bitset_common< 0U, unsignedchar >::span_type span_type
typedef etl::private_bitset::bitset_common< 0U, unsignedchar >::const_span_type const_span_type
Public Types inherited from etl::ibitset
enum  { npos = etl::integral_limits<size_t>::max }
typedef size_t size_type
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 TElement * pointer
typedef const TElement * const_pointer
typedef size_t size_type
Public Types inherited from etl::private_bitset::bitset_common< 0U, unsigned char >
typedef etl::private_bitset::bitset_impl_common< unsigned char >::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< unsigned char >
typedef unsigned char element_type
typedef unsigned char * pointer
typedef const unsigned char * const_pointer
typedef size_t size_type

Public Member Functions

 bitset ()
 Default constructor.
bitset< MaxN > & set ()
 Set all of the bits.
bitset< MaxN > & from_string (const char *text)
 Set from a string.
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 > & flip ()
 Flip all of the bits.
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 >>=
 ETL_STATIC_ASSERT (etl::is_unsigned< TElement >::value, "The element type must be unsigned")
ETL_CONSTEXPR14 T extract (size_t position, size_t length=etl::integral_limits< T >::bits) 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 bool test (size_t position) 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 none () const ETL_NOEXCEPT
 Are none of the bits set?
ETL_CONSTEXPR14 bool any () const ETL_NOEXCEPT
 Are any of the bits set?
ETL_CONSTEXPR14 bool operator[] (size_t position) const ETL_NOEXCEPT
 Read [] operator.
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, TElement > operator& (const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
 operator &
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator| (const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
 operator |
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator^ (const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
 operator ^
ETL_CONSTEXPR14 void swap (etl::bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
 swap
ETL_CONSTEXPR14 span_type span () 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
static ETL_CONSTANT size_t 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
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)
Static Public Attributes inherited from etl::private_bitset::bitset_common< 0U, unsigned char >
static ETL_CONSTANT size_t Number_Of_Elements
static ETL_CONSTANT size_t Size
static ETL_CONSTANT size_t Allocated_Bits
static ETL_CONSTANT etl::bitset_storage_model Storage_Model
static ETL_CONSTANT unsigned char Top_Mask
Static Public Attributes inherited from etl::private_bitset::bitset_impl_common< unsigned char >
static ETL_CONSTANT size_t npos
static ETL_CONSTANT size_t Bits_Per_Element
static ETL_CONSTANT unsigned char All_Set_Element
static ETL_CONSTANT unsigned char All_Clear_Element

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)
 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

Detailed Description

Specialisation for zero bits.

Member Function Documentation

◆ extract()

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

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

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

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

span Returns a span of the underlying buffer.

◆ storage_model()

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

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.

◆ operator!=

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

operator !=

operator !=


The documentation for this class was generated from the following file: