Skip to content

FilterOverlap Struct

Two registered CanIdFilter-based subscriptions whose ID spaces intersect, and the range of CAN IDs on which they do (FR-RAW-041) — the result of FindOverlappingFilterSubscriptions().

public readonly record struct FilterOverlap : System.IEquatable<CanKit.Pro.RawCan.FilterOverlap>

Implements IEquatable<FilterOverlap>

Remarks

The relation is symmetric: A and B are the two subscriptions that share ID space, in registration order, and swapping them describes the same overlap. The names deliberately say nothing more than that — an earlier version of this API returned a (First, Second) tuple, whose element names read as if the order carried meaning.

Constructors

FilterOverlap(ISubscription, ISubscription, uint, uint) Constructor

Two registered CanIdFilter-based subscriptions whose ID spaces intersect, and the range of CAN IDs on which they do (FR-RAW-041) — the result of FindOverlappingFilterSubscriptions().

public FilterOverlap(CanKit.Pro.RawCan.ISubscription A, CanKit.Pro.RawCan.ISubscription B, uint LowestSharedId, uint HighestSharedId);

Parameters

A ISubscription

One of the two overlapping subscriptions.

B ISubscription

The other one.

LowestSharedId UInt32

The smallest CAN ID both filters accept.

HighestSharedId UInt32

The largest CAN ID both filters accept. Together with LowestSharedId this is the answer to "where do they collide?", which is what a caller diagnosing a misconfigured set of protocol instances is actually after.

For two range filters every ID in between is shared as well. For acceptance-code/mask filters it is an inclusive hull: every shared ID lies within these bounds, but the IDs in between need not all be shared, because a mask filter accepts a scattered set rather than a contiguous run.

Remarks

The relation is symmetric: A and B are the two subscriptions that share ID space, in registration order, and swapping them describes the same overlap. The names deliberately say nothing more than that — an earlier version of this API returned a (First, Second) tuple, whose element names read as if the order carried meaning.

Properties

FilterOverlap.A Property

One of the two overlapping subscriptions.

public CanKit.Pro.RawCan.ISubscription A { get; init; }

Property Value

ISubscription

FilterOverlap.B Property

The other one.

public CanKit.Pro.RawCan.ISubscription B { get; init; }

Property Value

ISubscription

FilterOverlap.HighestSharedId Property

The largest CAN ID both filters accept. Together with LowestSharedId this is the answer to "where do they collide?", which is what a caller diagnosing a misconfigured set of protocol instances is actually after.

For two range filters every ID in between is shared as well. For acceptance-code/mask filters it is an inclusive hull: every shared ID lies within these bounds, but the IDs in between need not all be shared, because a mask filter accepts a scattered set rather than a contiguous run.

public uint HighestSharedId { get; init; }

Property Value

UInt32

FilterOverlap.LowestSharedId Property

The smallest CAN ID both filters accept.

public uint LowestSharedId { get; init; }

Property Value

UInt32

Methods

FilterOverlap.Deconstruct(ISubscription, ISubscription) Method

Destructures just the two subscriptions, for callers that only want to name the pair: foreach (var (a, b) in service.FindOverlappingFilterSubscriptions()).

public void Deconstruct(out CanKit.Pro.RawCan.ISubscription a, out CanKit.Pro.RawCan.ISubscription b);

Parameters

a ISubscription

Receives A.

b ISubscription

Receives B.