DataDeliveryPolicy class Sensor Data Source

Controls how often a sensor listener receives updates.

Attach a policy when registering a listener. Samples the policy declines never reach the listener. This base class limits the update rate and nothing else, which suits continuous data types that have no specific thresholds.

Settings can be changed at any time and apply from the next sample. The same policy object may be attached to several listener registrations, in which case a change affects all of them.

A policy applies to one listener and one data type. Registering the same DataSourceListener on two DataSource objects for the same data type makes both registrations share the policy, and detaching from either one removes it. Use a separate listener per data source when the two need different policies.

See also:

Implementers

Properties

dataType DataType
The data type this policy applies to.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasRegisteredAutoReleaseObject bool
getter/setter pairinherited
pointerId int
The pointer ID of the native object
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
throttleInterval Duration
Get the minimum time between delivered updates.
getter/setter pair

Methods

dispose() → void
Disposes the native object.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerAutoReleaseObject(int pointerId) → void
Registers an object for auto release.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create({required DataType dataType, Duration throttleInterval = Duration.zero}) DataDeliveryPolicy?
Create a policy for dataType, throttled to throttleInterval.