IoT::Devices

class IFlagsDatapoint

File Information

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

Description

The base class for datapoints holding a variable number of flag bits, internally stored as a std::vector<bool>.

An implementation should handle conversion between a flag bit and the corresponding symbolic name of a flag.

In addition to the methods defined in this interface, a FlagsDatapoint 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: FlagsDatapointRemoteObject

Member Summary

Member Functions: definedFlags, flags, isA, remoting__enableEvents, remoting__typeId, reset, resetFlags, set, setFlags, toggle, toggleFlags, type, unset, unsetFlags, validFlags, 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 < IFlagsDatapoint >;

Constructors

IFlagsDatapoint

IFlagsDatapoint();

Creates a IFlagsDatapoint.

Destructor

~IFlagsDatapoint virtual

virtual ~IFlagsDatapoint();

Destroys the IFlagsDatapoint.

Member Functions

definedFlags virtual

virtual std::vector < IoT::Devices::FlagValue > definedFlags() const = 0;

Returns a vector containing the possible flags and mappings to symbolic names.

flags virtual

virtual std::vector < std::string > flags() const = 0;

Returns a vector containing the symbolic names of all flags currently set, even if the datapoint has been invalidated.

Use validFlags() to get a valid value only.

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.

reset virtual

virtual std::vector < bool > reset(
    std::vector < bool > value = std::vector < bool > ()
) = 0;

Resets all flags to zero or the given value. Also makes the datapoint valid.

Returns the previously set flags.

resetFlags virtual

virtual void resetFlags(
    const std::vector < std::string > & flags = std::vector < std::string > ()
) = 0;

Resets all flags to the given set of flags and makes the datapoint valid.

set virtual

virtual std::vector < bool > set(
    std::vector < bool > flags
) = 0;

Sets flags by logically OR-ing the currently set flags with the given ones.

Returns the previously set flags.

setFlags virtual

virtual void setFlags(
    const std::vector < std::string > & flags
) = 0;

Sets flags by logically OR-ing the currently set flags with the given ones.

toggle virtual

virtual std::vector < bool > toggle(
    std::vector < bool > flags
) = 0;

Sets flags by logically XOR-ing the currently set flags with the given ones.

Returns the previously set flags.

toggleFlags virtual

virtual void toggleFlags(
    const std::vector < std::string > & flags
) = 0;

Sets flags by logically XOR-ing the currently set flags with the given ones.

type virtual

const std::type_info & type() const;

Returns the type information for the object's class.

unset virtual

virtual std::vector < bool > unset(
    std::vector < bool > flags
) = 0;

Unsets flags by logically AND-ing the currently set flags with the inverted given ones.

Returns the previously set flags.

unsetFlags virtual

virtual void unsetFlags(
    const std::vector < std::string > & flags
) = 0;

Unsets flags by logically AND-ing the currently set flags with the inverted given ones.

validFlags virtual

virtual Poco::Optional < std::vector < std::string >> validFlags() const = 0;

Returns a vector containing the symbolic names of all flags currently set if the datapoint is valid, otherwise an empty value.

validValue virtual

virtual Poco::Optional < std::vector < bool >> validValue() const = 0;

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

value virtual

virtual std::vector < bool > value() const = 0;

Returns the bit vector 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::vector < bool >> validated;

valueChanged

Poco::BasicEvent < const std::vector < bool >> valueChanged;

valueUpdated

Poco::BasicEvent < const std::vector < bool >> valueUpdated;

Securely control IoT edge devices from anywhere   Connect a Device