BitChanged Filter

template<typename T, uint32_t BitPosition>
struct BitChanged

Filter that accepts changes when a specific bit changes.

This filter monitors a specific bit position and propagates changes only when that bit’s value differs between old and new values.

Since

v0.1.0

// Example: Monitor bit 3 for changes
Signal<uint8_t, 10, BitChanged<uint8_t, 3>> flags(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 monitor (0-based).

Public Functions

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

See Also