File Information
Library: IoT/Devices
Package: Generated
Header: IoT/Devices/CompositeRemoteObject.h
Description
A composite device consists of one or more sub devices or device fragments.
Composites are used to build hierarchies of devices, also known as device trees. This is intended to represent the hierarchical structure of a more complex device.
For example, for an electric vehicle, the (simplified) device tree may look like:
/ (root) Battery/ Voltage Temperature ChargeLevel Motor/ Switch PowerUsage RPM Temperature ... ...
The DeviceTree class can be used to conveniently find a device in the tree.
Inheritance
Direct Base Classes: IComposite, Poco::RemotingNG::RemoteObject
All Base Classes: IComposite, IDevice, Poco::OSP::Service, Poco::RefCountedObject, Poco::RemotingNG::Identifiable, Poco::RemotingNG::RemoteObject
Member Summary
Member Functions: event__statusChanged, fragmentByName, fragments, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, remoting__enableEvents, remoting__enableRemoteEvents, remoting__hasEvents, remoting__typeId, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp
Inherited Functions: duplicate, fragmentByName, fragments, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, isA, mutex, referenceCount, release, remoting__enableEvents, remoting__enableRemoteEvents, remoting__getURI, remoting__hasEvents, remoting__objectId, remoting__setURI, remoting__typeId, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, type
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < CompositeRemoteObject >;
Constructors
CompositeRemoteObject
CompositeRemoteObject(
const Poco::RemotingNG::Identifiable::ObjectId & oid,
Poco::SharedPtr < IoT::Devices::Composite > pServiceObject
);
Creates a CompositeRemoteObject.
Destructor
~CompositeRemoteObject
virtual ~CompositeRemoteObject();
Destroys the CompositeRemoteObject.
Member Functions
fragmentByName
Poco::Optional < std::string > fragmentByName(
const std::string & nodeName
) const;
Returns the device identifier of the direct sub device with the given node name (property "io.macchina.nodeName"), or an empty optional if no such device node exists.
Note: if multiple child nodes with the same node name exist, which of these nodes is returned is undefined.
fragments
std::vector < std::string > fragments() const;
Returns a vector containing the device identifiers of all direct sub devices owned by this device.
See also: IoT::Devices::IComposite::fragments()
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()
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;
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()
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.
event__statusChanged
void event__statusChanged(
const IoT::Devices::DeviceStatusChange & data
);