IoT::Devices

class IComposite

File Information

Library: IoT/Devices
Package: Generated
Header: IoT/Devices/IComposite.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: IDevice

All Base Classes: IDevice, Poco::OSP::Service, Poco::RefCountedObject

Known Derived Classes: CompositeRemoteObject

Member Summary

Member Functions: fragmentByName, fragments, isA, remoting__typeId, type

Inherited Functions: duplicate, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, isA, referenceCount, release, remoting__enableEvents, remoting__typeId, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, type

Types Aliases

Ptr

using Ptr = Poco::AutoPtr < IComposite >;

Constructors

IComposite

IComposite();

Creates a IComposite.

Destructor

~IComposite virtual

virtual ~IComposite();

Destroys the IComposite.

Member Functions

fragmentByName virtual

virtual Poco::Optional < std::string > fragmentByName(
    const std::string & nodeName
) const = 0;

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 virtual

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

Returns a vector containing the device identifiers of all direct sub devices owned by this device.

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__typeId static

static const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId();

Returns the TypeId of the class.

type virtual

const std::type_info & type() const;

Returns the type information for the object's class.

Securely control IoT edge devices from anywhere   Connect a Device