IoT::Devices

class BooleanDatapoint

File Information

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

Description

The base class for datapoints holding a boolean value.

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

  • displayValue (string, optional): The current value of the datapoint, formatted as string for display purposes.

Inheritance

Direct Base Classes: Datapoint

All Base Classes: Datapoint, Device

Member Summary

Member Functions: invert, update, validValue, value

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

Constructors

BooleanDatapoint

BooleanDatapoint();

Creates the BooleanDatapoint.

Destructor

~BooleanDatapoint virtual

~BooleanDatapoint();

Destroys the BooleanDatapoint.

Member Functions

invert virtual

virtual bool invert() = 0;

Inverts the value of the datapoint.

Returns the previous value of the datapoint.

Not all Datapoint implementations may support this method.

update virtual

virtual bool update(
    bool value
) = 0;

Updates the value of the datapoint and makes it valid.

Returns the previous value of the datapoint.

Not all Datapoint implementations may support this method.

validValue virtual

virtual Poco::Optional < bool > validValue() const = 0;

Returns the current value of the datapoint if it is valid, otherwise an empty value.

value virtual

virtual bool value() const = 0;

Returns the current value of the datapoint, even if the datapoint has been invalidated.

Use validValue() to get a valid value only.

Variables

validated

Poco::BasicEvent < const bool > validated;

Fired when an invalid datapoint becomes valid again, by being updated with a new value. The new valud is given as event argument.

valueChanged

Poco::BasicEvent < const bool > valueChanged;

Fired when the value of the datapoint has changed.

Actual behavior of this event (e.g., minimum interval between fires) are implementation specific and can be configured via properties.

valueUpdated

Poco::BasicEvent < const bool > valueUpdated;

Fired when the value of the datapoint has been updated by calling update(). This event is also fired if the actual value has not changed.

Securely control IoT edge devices from anywhere   Connect a Device