IoT::Devices

class DeviceTree

File Information

Library: IoT/Devices
Package: Devices
Header: IoT/Devices/DeviceTree.h

Description

This class manages a hierarchical structure of devices, consisting of Composite and leaf Device objects.

Inheritance

Known Derived Classes: DeviceTreeImpl

Member Summary

Member Functions: deviceById, deviceByPath, findDeviceById, findDeviceByPath

Constructors

DeviceTree

DeviceTree();

Creates the DeviceTree.

Destructor

~DeviceTree virtual

virtual ~DeviceTree();

Destroys the DeviceTree.

Member Functions

deviceById virtual

virtual DeviceNode deviceById(
    const std::string & id
) const = 0;

Returns the DeviceNode of the device with the given device identifier.

Throws a Poco::NotFoundException if no DeviceNode is available for the given device identifier.

deviceByPath virtual

virtual DeviceNode deviceByPath(
    const std::string & path
) const = 0;

Returns the DeviceNode of the device with the given path. The path name is composed of the instance names of all parent composite devices, as well as the device's instance name, separated by "/".

To obtain the root device, which is always a Composite, specify "/" or "" as pathName.

Throws a Poco::NotFoundException if no DeviceNode is available for the given pathName.

findDeviceById virtual

virtual Poco::Optional < DeviceNode > findDeviceById(
    const std::string & id
) const = 0;

Returns the DeviceNode of the device with the given device identifier, if it exists.

findDeviceByPath virtual

virtual Poco::Optional < DeviceNode > findDeviceByPath(
    const std::string & path
) const = 0;

Returns the DeviceNode of the device with the given path, if it exists. The path name is composed of the instance names of all parent composite devices, as well as the device's instance name, separated by "/".

To obtain the root device, which is always a Composite, specify "/" or "" as pathName.

Securely control IoT edge devices from anywhere   Connect a Device