ScanDeduplicator class
The duplicate filter used by ScanSession, as a small synchronous state machine.
Times are Durations on any monotonic clock (for example microseconds since the epoch, or a Stopwatch). Calls must be made in time order; a read that is earlier than the previous read of the same code is treated as simultaneous.
Constructors
- ScanDeduplicator({DedupePolicy policy = const DedupePolicy.leaveAndReturn(), FrameConfirmation confirmation = FrameConfirmation.none})
- Creates a filter.
Properties
- confirmation ↔ FrameConfirmation
-
The frame confirmation rule.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- policy ↔ DedupePolicy
-
The duplicate policy. Changing it keeps the tracked codes.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trackedCount → int
-
Number of codes currently tracked (for diagnostics and tests).
no setter
Methods
-
check(
String key, Duration time, {required bool continuous}) → DedupeDecision -
Classifies a read of
keyattime. -
forget(
String key) → void -
Forgets
key, so its next read is a new scan (for example after it was removed from a count). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Forgets all codes.
-
resolve(
String key, Duration time, {required bool accepted}) → void -
Records the outcome of a DedupeDecision.candidate read of
keyattime. -
sinceAccepted(
String key, Duration time) → Duration? -
The time since
keylast counted, ornullif it has not counted (or was forgotten). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited