BitSet Filter

template<typename T, uint32_t BitPosition>
struct BitSet

Filter that only accepts values when a specific bit is set (1).

This filter propagates changes only when the specified bit position in the new value is set to 1.

Since

v0.1.0

// Example: Only propagate when bit 0 is set
Signal<uint8_t, 10, BitSet<uint8_t, 0>> status(0);

Warning

  • Only accepts integral types (int, long, etc.).

  • BitPosition must be less than sizeof(T) * 8.

Template Parameters:
typename T

Integral type.

uint32_t BitPosition

Bit position to check (0-based).

Public Functions

inline bool operator()(const T &old_value, const T &new_value) const

See Also