File Information
Library: IoT/Devices
Package: Generated
Header: IoT/Devices/ICounterDatapoint.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: IDatapoint
All Base Classes: IDatapoint, IDevice, Poco::OSP::Service, Poco::RefCountedObject
Known Derived Classes: CounterDatapointRemoteObject
Member Summary
Member Functions: increment, isA, remoting__enableEvents, remoting__typeId, reset, type, validValue, value
Inherited Functions: duplicate, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, invalidate, isA, referenceCount, release, remoting__enableEvents, remoting__typeId, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, type, valid
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < ICounterDatapoint >;
Constructors
ICounterDatapoint
Creates a ICounterDatapoint.
Destructor
~ICounterDatapoint
virtual ~ICounterDatapoint();
Destroys the ICounterDatapoint.
Member Functions
increment
virtual Poco::Int64 increment(
Poco::Int64 delta = Poco::Int64 (1)
) = 0;
Updates the counter and returns the new value.
Not all CounterDatapoint implementations may support this method.
isA
bool isA(
const std::type_info & otherType
) const;
Returns true if the class is a subclass of the class given by otherType.
See also: IoT::Devices::IDatapoint::isA()
remoting__enableEvents
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 const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId();
Returns the TypeId of the class.
reset
virtual Poco::Int64 reset(
Poco::Int64 value = Poco::Int64 (0)
) = 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.
type
const std::type_info & type() const;
Returns the type information for the object's class.
See also: IoT::Devices::IDatapoint::type()
validValue
virtual Poco::Optional < Poco::Int64 > validValue() const = 0;
Returns the current value of the datapoint if it is valid, otherwise an empty value.
value
virtual Poco::Int64 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 Poco::Int64 > validated;
valueChanged
Poco::BasicEvent < const Poco::Int64 > valueChanged;