File Information
Library: IoT/Devices
Package: Generated
Header: IoT/Devices/IEnumDatapoint.h
Description
The base class for datapoints holding an enumeration value (based on an int).
An implementation should handle conversion between an integer value and the corresponding symbolic name.
In addition to the methods defined in this interface, a EnumDatapoint 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: EnumDatapointRemoteObject
Member Summary
Member Functions: definedValues, isA, remoting__enableEvents, remoting__typeId, stringValue, type, update, updateString, validStringValue, 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 < IEnumDatapoint >;
Constructors
IEnumDatapoint
Creates a IEnumDatapoint.
Destructor
~IEnumDatapoint
virtual ~IEnumDatapoint();
Destroys the IEnumDatapoint.
Member Functions
definedValues
virtual std::vector < IoT::Devices::EnumValue > definedValues() const = 0;
Returns a vector containing the possible values and mappings to symbolic names.
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.
stringValue
virtual std::string stringValue() const = 0;
Returns the symbolic name corresponding to the datapoint's current value, even if the datapoint has been invalidated.
Use validStringValue() to get a valid value only.
type
const std::type_info & type() const;
Returns the type information for the object's class.
See also: IoT::Devices::IDatapoint::type()
update
virtual void update(
int value
) = 0;
Updates the value of the enumeration.
Throws a Poco::InvalidArgumentException if the given value is not in the range of defined values.
updateString
virtual void updateString(
const std::string & symbolicName
) = 0;
Updates the value of the enumeration from the given symbolic name.
Throws a Poco::InvalidArgumentException if the given symbolicName is not in the range of defined values and their symbolic names.
validStringValue
virtual Poco::Optional < std::string > validStringValue() const = 0;
Returns the symbolic name corresponding to the datapoint's current value if the datapoint is valid, otherwise an empty value.
validValue
virtual Poco::Optional < int > validValue() const = 0;
Returns the current integer value of the datapoint if it is valid, otherwise an empty value.
value
virtual int value() const = 0;
Returns the current integer value of the datapoint, even if the datapoint has been invalidated.
Use validValue() to get a valid value only.
Variables
validated
Poco::BasicEvent < const int > validated;
valueChanged
Poco::BasicEvent < const int > valueChanged;
valueUpdated
Poco::BasicEvent < const int > valueUpdated;