BitClear Filter

template<typename T, uint32_t BitPosition>
struct BitClear

Filter that only accepts values when a specific bit is clear (0).

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

Since

v0.1.0

// Example: Only propagate when bit 7 is clear
Signal<uint8_t, 10, BitClear<uint8_t, 7>> ready(0xFF);

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