File Information
Library: IoT/Devices
Package: Generated
Header: IoT/Devices/FlagsDatapointRemoteObject.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: IFlagsDatapoint, Poco::RemotingNG::RemoteObject
All Base Classes: IDatapoint, IDevice, IFlagsDatapoint, Poco::OSP::Service, Poco::RefCountedObject, Poco::RemotingNG::Identifiable, Poco::RemotingNG::RemoteObject
Member Summary
Member Functions: definedFlags, event__invalidated, event__statusChanged, event__validated, event__valueChanged, event__valueUpdated, flags, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, invalidate, remoting__enableEvents, remoting__enableRemoteEvents, remoting__hasEvents, remoting__typeId, reset, resetFlags, set, setFeature, setFlags, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, toggle, toggleFlags, unset, unsetFlags, valid, validFlags, validValue, value
Inherited Functions: definedFlags, duplicate, flags, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, invalidate, isA, mutex, referenceCount, release, remoting__enableEvents, remoting__enableRemoteEvents, remoting__getURI, remoting__hasEvents, remoting__objectId, remoting__setURI, remoting__typeId, reset, resetFlags, set, setFeature, setFlags, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, toggle, toggleFlags, type, unset, unsetFlags, valid, validFlags, validValue, value
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < FlagsDatapointRemoteObject >;
Constructors
FlagsDatapointRemoteObject
FlagsDatapointRemoteObject(
const Poco::RemotingNG::Identifiable::ObjectId & oid,
Poco::SharedPtr < IoT::Devices::FlagsDatapoint > pServiceObject
);
Creates a FlagsDatapointRemoteObject.
Destructor
~FlagsDatapointRemoteObject
virtual ~FlagsDatapointRemoteObject();
Destroys the FlagsDatapointRemoteObject.
Member Functions
definedFlags
std::vector < IoT::Devices::FlagValue > definedFlags() const;
Returns a vector containing the possible flags and mappings to symbolic names.
flags
std::vector < std::string > flags() const;
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.
See also: IoT::Devices::IFlagsDatapoint::flags()
getFeature
virtual bool getFeature(
const std::string & name
) const;
Returns true if the feature with the given name is enabled, or false otherwise.
See also: IoT::Devices::IDevice::getFeature()
getPropertyBool
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.
See also: IoT::Devices::IDevice::getPropertyBool()
getPropertyDouble
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 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.
See also: IoT::Devices::IDevice::getPropertyInt()
getPropertyInt16
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 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 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 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 bool hasFeature(
const std::string & name
) const;
Returns true if the feature with the given name is known, or false otherwise.
See also: IoT::Devices::IDevice::hasFeature()
hasProperty
virtual bool hasProperty(
const std::string & name
) const;
Returns true if the property with the given name exists, or false otherwise.
See also: IoT::Devices::IDevice::hasProperty()
invalidate
virtual void invalidate();
Invalidates the datapoint's value.
Subsequent calls to valid() will return false, until a new value has been set.
See also: IoT::Devices::IDatapoint::invalidate()
remoting__enableEvents
virtual std::string remoting__enableEvents(
Poco::RemotingNG::Listener::Ptr pListener,
bool enable = bool (true)
);
remoting__enableRemoteEvents
virtual void remoting__enableRemoteEvents(
const std::string & protocol
);
remoting__hasEvents
virtual bool remoting__hasEvents() const;
remoting__typeId
virtual const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId() const;
reset
std::vector < bool > reset(
std::vector < bool > value = std::vector < bool > ()
);
Resets all flags to zero or the given value. Also makes the datapoint valid.
Returns the previously set flags.
See also: IoT::Devices::IFlagsDatapoint::reset()
resetFlags
virtual void resetFlags(
const std::vector < std::string > & flags = std::vector < std::string > ()
);
Resets all flags to the given set of flags and makes the datapoint valid.
set
std::vector < bool > set(
std::vector < bool > flags
);
Sets flags by logically OR-ing the currently set flags with the given ones.
Returns the previously set flags.
See also: IoT::Devices::IFlagsDatapoint::set()
setFeature
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.
See also: IoT::Devices::IDevice::setFeature()
setFlags
virtual void setFlags(
const std::vector < std::string > & flags
);
Sets flags by logically OR-ing the currently set flags with the given ones.
setPropertyBool
virtual void setPropertyBool(
const std::string & name,
bool value
);
Sets a device property.
Which properties are supported is defined by the actual device implementation.
See also: IoT::Devices::IDevice::setPropertyBool()
setPropertyDouble
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 void setPropertyInt(
const std::string & name,
int value
);
Sets a device property.
Which properties are supported is defined by the actual device implementation.
See also: IoT::Devices::IDevice::setPropertyInt()
setPropertyInt16
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 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 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 void setPropertyTimestamp(
const std::string & name,
Poco::Timestamp value
);
Sets a device property.
Which properties are supported is defined by the actual device implementation.
toggle
std::vector < bool > toggle(
std::vector < bool > flags
);
Sets flags by logically XOR-ing the currently set flags with the given ones.
Returns the previously set flags.
See also: IoT::Devices::IFlagsDatapoint::toggle()
toggleFlags
virtual void toggleFlags(
const std::vector < std::string > & flags
);
Sets flags by logically XOR-ing the currently set flags with the given ones.
unset
std::vector < bool > unset(
std::vector < bool > flags
);
Unsets flags by logically AND-ing the currently set flags with the inverted given ones.
Returns the previously set flags.
See also: IoT::Devices::IFlagsDatapoint::unset()
unsetFlags
virtual void unsetFlags(
const std::vector < std::string > & flags
);
Unsets flags by logically AND-ing the currently set flags with the inverted given ones.
valid
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.
See also: IoT::Devices::IDatapoint::valid()
validFlags
Poco::Optional < std::vector < std::string >> validFlags() const;
Returns a vector containing the symbolic names of all flags currently set if the datapoint is valid, otherwise an empty value.
validValue
Poco::Optional < std::vector < bool >> validValue() const;
Returns the bit vector value of the datapoint if it is valid, otherwise an empty value.
value
std::vector < bool > value() const;
Returns the bit vector value of the datapoint, even if the datapoint has been invalidated.
Use validValue() to get a valid value only.
See also: IoT::Devices::IFlagsDatapoint::value()
event__invalidated
void event__invalidated();
event__statusChanged
void event__statusChanged(
const IoT::Devices::DeviceStatusChange & data
);
event__validated
void event__validated(
const std::vector < bool > & data
);
event__valueChanged
void event__valueChanged(
const std::vector < bool > & data
);
event__valueUpdated
void event__valueUpdated(
const std::vector < bool > & data
);