IoT::Devices

class CounterDatapointRemoteObject

File Information

Library: IoT/Devices
Package: Generated
Header: IoT/Devices/CounterDatapointRemoteObject.h

Description

The base class for datapoints holding a counter (a 64-bit unsigned integer).

In addition to the methods defined in this interface, a CounterDatapoint 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: ICounterDatapoint, Poco::RemotingNG::RemoteObject

All Base Classes: ICounterDatapoint, IDatapoint, IDevice, Poco::OSP::Service, Poco::RefCountedObject, Poco::RemotingNG::Identifiable, Poco::RemotingNG::RemoteObject

Member Summary

Member Functions: event__invalidated, event__statusChanged, event__validated, event__valueChanged, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, increment, invalidate, remoting__enableEvents, remoting__enableRemoteEvents, remoting__hasEvents, remoting__typeId, reset, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, valid, validValue, value

Inherited Functions: duplicate, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, increment, invalidate, isA, mutex, referenceCount, release, remoting__enableEvents, remoting__enableRemoteEvents, remoting__getURI, remoting__hasEvents, remoting__objectId, remoting__setURI, remoting__typeId, reset, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, type, valid, validValue, value

Types Aliases

Ptr

using Ptr = Poco::AutoPtr < CounterDatapointRemoteObject >;

Constructors

CounterDatapointRemoteObject

CounterDatapointRemoteObject(
    const Poco::RemotingNG::Identifiable::ObjectId & oid,
    Poco::SharedPtr < IoT::Devices::CounterDatapoint > pServiceObject
);

Destructor

~CounterDatapointRemoteObject virtual

virtual ~CounterDatapointRemoteObject();

Member Functions

getFeature virtual inline

virtual bool getFeature(
    const std::string & name
) const;

Returns true if the feature with the given name is enabled, or false otherwise.

getPropertyBool virtual inline

virtual bool getPropertyBool(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyDouble virtual inline

virtual double getPropertyDouble(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyInt virtual inline

virtual int getPropertyInt(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyInt16 virtual inline

virtual Poco::Int16 getPropertyInt16(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyInt64 virtual inline

virtual Poco::Int64 getPropertyInt64(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyString virtual inline

virtual std::string getPropertyString(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyTimestamp virtual inline

virtual Poco::Timestamp getPropertyTimestamp(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

hasFeature virtual inline

virtual bool hasFeature(
    const std::string & name
) const;

Returns true if the feature with the given name is known, or false otherwise.

hasProperty virtual inline

virtual bool hasProperty(
    const std::string & name
) const;

Returns true if the property with the given name exists, or false otherwise.

increment virtual inline

Poco::Int64 increment(
    Poco::Int64 delta = Poco::Int64 (1)
);

Updates the counter and returns the new value.

Not all CounterDatapoint implementations may support this method.

invalidate virtual inline

virtual void invalidate();

Invalidates the datapoint's value.

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

remoting__enableEvents virtual

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

remoting__enableRemoteEvents virtual

virtual void remoting__enableRemoteEvents(
    const std::string & protocol
);

remoting__hasEvents virtual

virtual bool remoting__hasEvents() const;

remoting__typeId virtual inline

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

reset virtual inline

Poco::Int64 reset(
    Poco::Int64 value = Poco::Int64 (0)
);

Resets the counter to zero or the given value and returns the previous value. Also makes the datapoint valid.

Not all CounterDatapoint implementations may support this method.

setFeature virtual inline

virtual void setFeature(
    const std::string & name,
    bool enable
);

Enables or disables the feature with the given name.

Which features are supported is defined by the actual device implementation.

setPropertyBool virtual inline

virtual void setPropertyBool(
    const std::string & name,
    bool value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyDouble virtual inline

virtual void setPropertyDouble(
    const std::string & name,
    double value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyInt virtual inline

virtual void setPropertyInt(
    const std::string & name,
    int value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyInt16 virtual inline

virtual void setPropertyInt16(
    const std::string & name,
    Poco::Int16 value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyInt64 virtual inline

virtual void setPropertyInt64(
    const std::string & name,
    Poco::Int64 value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyString virtual inline

virtual void setPropertyString(
    const std::string & name,
    const std::string & value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyTimestamp virtual inline

virtual void setPropertyTimestamp(
    const std::string & name,
    Poco::Timestamp value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

valid virtual inline

virtual bool valid() const;

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.

validValue virtual inline

Poco::Optional < Poco::Int64 > validValue() const;

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

value virtual inline

Poco::Int64 value() const;

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

Use validValue() to get a valid value only.

event__invalidated protected

void event__invalidated();

event__statusChanged protected

void event__statusChanged(
    const IoT::Devices::DeviceStatusChange & data
);

event__validated protected

void event__validated(
    const Poco::Int64 & data
);

event__valueChanged protected

void event__valueChanged(
    const Poco::Int64 & data
);

Securely control IoT edge devices from anywhere   Connect a Device