IoT::Devices

class IDatapoint

File Information

Library: IoT/Devices
Package: Generated
Header: IoT/Devices/IDatapoint.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: IDevice

All Base Classes: IDevice, Poco::OSP::Service, Poco::RefCountedObject

Known Derived Classes: IFlagsDatapoint, BooleanDatapointRemoteObject, FlagsDatapointRemoteObject, ICounterDatapoint, VectorDatapointRemoteObject, IBooleanDatapoint, EnumDatapointRemoteObject, ScalarDatapointRemoteObject, CounterDatapointRemoteObject, DatapointRemoteObject, IVectorDatapoint, IScalarDatapoint, IStringDatapoint, IEnumDatapoint, StringDatapointRemoteObject

Member Summary

Member Functions: invalidate, isA, remoting__enableEvents, remoting__typeId, type, valid

Inherited Functions: duplicate, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, isA, referenceCount, release, remoting__enableEvents, remoting__typeId, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, type

Types Aliases

Ptr

using Ptr = Poco::AutoPtr < IDatapoint >;

Constructors

IDatapoint

IDatapoint();

Creates a IDatapoint.

Destructor

~IDatapoint virtual

virtual ~IDatapoint();

Destroys the IDatapoint.

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.

isA virtual

bool isA(
    const std::type_info & otherType
) const;

Returns true if the class is a subclass of the class given by otherType.

remoting__enableEvents virtual

virtual std::string remoting__enableEvents(
    Poco::RemotingNG::Listener::Ptr pListener,
    bool enable = bool (true)
) = 0;

Enable or disable delivery of remote events.

The given Listener instance must implement the Poco::RemotingNG::EventListener interface, otherwise this method will fail with a RemotingException.

This method is only used with Proxy objects; calling this method on a RemoteObject will do nothing.

remoting__typeId static

static const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId();

Returns the TypeId of the class.

type virtual

const std::type_info & type() const;

Returns the type information for the object's class.

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;

Securely control IoT edge devices from anywhere   Connect a Device