BitwiseMask Filter

template<typename T, uint32_t Mask, uint32_t Expected>
struct BitwiseMask

Filter that accepts values matching a bitwise mask pattern.

This filter applies a bitwise AND mask to the new value and propagates only when the result matches the expected pattern.

Since

v0.1.0

// Example: Check if lower 4 bits equal 0x0A
Signal<uint8_t, 10, BitwiseMask<uint8_t, 0x0F, 0x0A>> data(0);

Warning

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

  • Mask must fit within type T’s range.

  • Expected value must not exceed Mask.

Template Parameters:
typename T

Integral type.

uint32_t Mask

Bit mask to apply.

uint32_t Expected

Expected result after applying mask.

Public Functions

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

See Also