IoT::Devices

class Datapoint

File Information

Library: IoT/Devices
Package: Datapoints
Header: IoT/Devices/Datapoint.h

Description

The base class for datapoints. Datapoints typically represent the result of sensor measurements, or data obtained from monitoring processes.

The main difference between a Datapoint and a Sensor is that a Sensor is typically an interface to a specific device (i.e., a temperature sensor), whereas a Datapoint holds a value that has been acquired from another device (via a network or bus system) or computed from other data points.

In addition to the methods defined in this interface, a Sensor implementation should expose the following properties:

  • displayValue (string, optional): The current value of the datapoint, formatted as string for display purposes.
  • updated (timestamp, optional): The point in time when the datapoint's value was last updated.
  • access (string, optional): Access permissions ("rw" - read/write, "ro" - read-only, "wo" - write-only).

Subclasses of Datapoint implement specific value types.

Inheritance

Direct Base Classes: Device

All Base Classes: Device

Known Derived Classes: FlagsDatapoint, ScalarDatapoint, VectorDatapoint, EnumDatapoint, StringDatapoint, CounterDatapoint, BooleanDatapoint

Member Summary

Member Functions: invalidate, valid

Inherited Functions: getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp

Constructors

Datapoint

Datapoint();

Creates the Datapoint.

Destructor

~Datapoint virtual

~Datapoint();

Destroys the Datapoint.

Member Functions

invalidate virtual

virtual void invalidate() = 0;

Invalidates the datapoint's value.

Subsequent calls to valid() will return false, until a new value has been set.

valid virtual

virtual bool valid() const = 0;

Returns true if a valid value is available.

Note that between the time valid() is called and a subsequent call to value() or similar method, the validity may change. Use validValue() or similar methods of subclasses to atomically get validity and value.

Variables

invalidated

Poco::BasicEvent < void > invalidated;

Fired when the datapoint has been invalidated.

Securely control IoT edge devices from anywhere   Connect a Device