File Information
Library: IoT/Devices
Package: Datapoints
Header: IoT/Devices/StringDatapoint.h
Description
The base class for datapoints holding a string value.
In addition to the methods defined in this interface, a StringDatapoint 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
Member Summary
Member Functions: 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
StringDatapoint
Creates the StringDatapoint.
Destructor
~StringDatapoint
~StringDatapoint();
Destroys the StringDatapoint.
Member Functions
update
virtual void update(
const std::string & value
) = 0;
Updates the value of the datapoint and makes it valid.
Not all Datapoint implementations may support this method.
validValue
virtual Poco::Optional < std::string > validValue() const = 0;
Returns the current value of the datapoint if it is valid, otherwise an empty value.
value
virtual std::string 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 std::string > 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 std::string > 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 std::string > 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.