|
enum | { Bits = MSB + 1 - LSB
, Lsb = LSB
, Msb = MSB
} |
enum | Masks : Base_type { Low_mask = static_cast<Base_type>(~0ULL) >> (sizeof(Base_type)*8 - Bits)
, Mask = Low_mask << Lsb
} |
| Masks for bitswise operation on internal parts of a bitfield. More...
|
typedef Best_type< Bits >::Type | Bits_type |
| Type to hold at least Bits bits.
|
typedef Best_type< Bits+Lsb >::Type | Shift_type |
| Type to hold at least Bits + Lsb bits.
|
typedef Value< Base_type & > | Ref |
| Reference type to access the bits inside a raw bit field.
|
typedef Value< Base_type volatile & > | Ref_volatile |
| Volatile reference type to access the bits inside a raw bit field.
|
typedef Value< Base_type const > | Val |
| Value type to access the bits inside a raw bit field.
|
typedef Value_unshifted< Base_type & > | Ref_unshifted |
| Reference type to access the bits inside a raw bit field (in place).
|
typedef Value_unshifted< Base_type volatile & > | Ref_unshifted_volatile |
| Volatile reference type to access the bits inside a raw bit field (in place).
|
typedef Value_unshifted< Base_type const > | Val_unshifted |
| Value type to access the bits inside a raw bit field (in place).
|
template<typename T, unsigned LSB, unsigned MSB>
class cxx::Bitfield< T, LSB, MSB >
Definition for a member (part) of a bit field.
- Parameters
-
T | The underlying type of the bit field. |
LSB | The least significant bit of our bits. |
MSB | The most significant bit of our bits. |
Definition at line 24 of file bitfield.
template<typename T, unsigned LSB, unsigned MSB>
Type to hold at least Bits + Lsb bits.
This type can handle all values that can be stored in this part of the bit field when they are at the target location (Lsb bits shifted to the left).
Definition at line 82 of file bitfield.
template<typename T, unsigned LSB, unsigned MSB>
Get the bits in place out of val.
- Parameters
-
val | The raw value of the whole bit field. |
- Returns
- The bits from Lsb to Msb (unshifted).
This means other bits are masked out, however the result is not shifted to the right.
Definition at line 112 of file bitfield.
template<typename T, unsigned LSB, unsigned MSB>
Set the bits corresponding to val.
- Parameters
-
dest | The current value of the whole bit field. |
val | The value to set into the bits. |
- Returns
- The new value of the whole bit field.
- Precondition
- val must not contain more than Bits bits.
- Note
- This function does not mask val to the right number of bits.
Definition at line 127 of file bitfield.
Referenced by cxx::Bitfield< decltype(raw), 0, 0 >::set().
template<typename T, unsigned LSB, unsigned MSB>
Set the bits corresponding to val.
- Parameters
-
dest | The current value of the whole bit field. |
val | The value shifted Lsb bits to the left that shall be set into the bits. |
- Returns
- The new value of the whole bit field.
- Precondition
- val must not contain more than Bits bits shifted Lsb bits to the left.
- Note
- This function does not mask val to the right number of bits.
Definition at line 147 of file bitfield.
Referenced by cxx::Bitfield< decltype(raw), 0, 0 >::set_unshifted().