ImagingTools Core SDK
Public Member Functions | List of all members
imtdev::ICompositeDeviceInstanceabstract

Interface for composite (hierarchical) device instances. More...

#include <ICompositeDeviceInstance.h>

Inheritance diagram for imtdev::ICompositeDeviceInstance:
imtdev::IDeviceInstance imtdev::IEditableCompositeDeviceInstance imtdev::CCompositeDeviceInstanceBase

Public Member Functions

virtual const ICompositeDeviceSpecificationGetCompositeDeviceSpecification () const =0
 Get composite device specification.
 
virtual QSet< QByteArray > GetSupportedSubDeviceTypeIds () const =0
 Get supported sub-device type IDs.
 
virtual const imtbase::ICollectionInfoGetSubDeviceList () const =0
 Get the list of available sub-devices.
 
virtual const IDeviceInstanceGetSubDeviceInstance (const QByteArray &subDeviceId) const =0
 Get device instance info of specific sub-device.
 
- Public Member Functions inherited from imtdev::IDeviceInstance
virtual const IDeviceSpecificationGetDeviceSpecification () const =0
 Get device static info associated with device instance.
 
virtual QByteArray GetIdentifier (int identifierType) const =0
 Get the device identifier of the given type.
 
virtual const iser::IVersionInfo & GetVersion () const =0
 Get device instance version information.
 
virtual const iattr::IAttributesProvider * GetAttributes () const =0
 Get device instance attributes provider.
 

Additional Inherited Members

- Public Types inherited from imtdev::IDeviceInstance
enum  IdentifierTypes { IT_SERIAL }
 Types of device identifiers. More...
 
enum  VersionIds {
  VI_FIRMWARE_VERSION_MAJOR = iser::IVersionInfo::UserVersionId , VI_FIRMWARE_VERSION_MINOR , VI_FIRMWARE_VERSION_PATCH , VI_HARDWARE_VERSION_MAJOR ,
  VI_HARDWARE_VERSION_MINOR , VI_HARDWARE_VERSION_PATCH
}
 Version information identifiers. More...
 

Detailed Description

Interface for composite (hierarchical) device instances.

ICompositeDeviceInstance extends IDeviceInstance to support hierarchical device structures where a parent device contains one or more sub-devices. This enables modeling of complex hardware systems where a single physical unit contains multiple logical devices.

This interface implements the Composite Pattern, allowing devices to be organized in tree structures with parent-child relationships. Sub-devices can themselves be composite devices, enabling multi-level hierarchies.

Use Cases:
  • Multi-sensor systems (e.g., camera array with multiple sensors)
  • Modular hardware platforms (e.g., controller with plug-in modules)
  • Integrated systems (e.g., multi-function printer with scanner/printer/fax)
  • Device clusters (e.g., distributed sensor network with local controller)
Key Features:
  • Sub-Device Management: Access to child devices within the composite
  • Type Filtering: Query supported sub-device types
  • Hierarchical Navigation: Traverse device tree structure
  • Unified Interface: Sub-devices use same IDeviceInstance interface
Usage Example:
// Get composite device instance
CompositeDeviceInstancePtr pComposite =
std::dynamic_pointer_cast<ICompositeDeviceInstance>(pDeviceInstance);
if (pComposite)
{
// Get composite device specification
pComposite->GetCompositeDeviceSpecification();
// Check supported sub-device types
QSet<QByteArray> supportedTypes = pComposite->GetSupportedSubDeviceTypeIds();
for (const QByteArray& typeId : supportedTypes)
{
qDebug() << "Supports sub-device type:" << typeId;
}
// Get list of available sub-devices
const imtbase::ICollectionInfo& subDevices = pComposite->GetSubDeviceList();
// Access specific sub-device
for (int i = 0; i < subDevices.GetCount(); ++i)
{
QByteArray subDeviceId = GetSubDeviceId(subDevices, i);
const IDeviceInstance* pSubDevice =
pComposite->GetSubDeviceInstance(subDeviceId);
if (pSubDevice)
{
// Work with sub-device as a regular device instance
const IDeviceSpecification& subSpec =
pSubDevice->GetDeviceSpecification();
// Sub-device might also be composite - check recursively
auto pSubComposite =
dynamic_cast<const ICompositeDeviceInstance*>(pSubDevice);
if (pSubComposite)
{
// Handle nested composite device
}
}
}
}
Interface for composite (hierarchical) device instances.
Interface for composite device static information.
Interface for describing runtime information about a device instance.
virtual const IDeviceSpecification & GetDeviceSpecification() const =0
Get device static info associated with device instance.
Interface for describing static information about a device type/class.
Device Hierarchy Example:
CameraArray (Composite Device)
├── Camera1 (Simple Device)
├── Camera2 (Simple Device)
└── SensorHub (Composite Device)
├── TemperatureSensor (Simple Device)
└── HumiditySensor (Simple Device)
See also
IDeviceInstance
ICompositeDeviceSpecification
IEditableCompositeDeviceInstance
CCompositeDeviceInstanceBase

Definition at line 107 of file ICompositeDeviceInstance.h.

Member Function Documentation

◆ GetCompositeDeviceSpecification()

virtual const ICompositeDeviceSpecification * imtdev::ICompositeDeviceInstance::GetCompositeDeviceSpecification ( ) const
pure virtual

Get composite device specification.

Returns the composite device specification that describes static properties of this composite device type, including sub-device specifications.

Returns
Pointer to composite device specification, or nullptr if not available
See also
ICompositeDeviceSpecification

Implemented in imtdev::CCompositeDeviceInstanceBase.

◆ GetSubDeviceInstance()

virtual const IDeviceInstance * imtdev::ICompositeDeviceInstance::GetSubDeviceInstance ( const QByteArray &  subDeviceId) const
pure virtual

Get device instance info of specific sub-device.

Retrieves the device instance information for a sub-device with the given identifier.

Parameters
subDeviceIdUnique identifier of the sub-device within this composite
Returns
Pointer to sub-device instance, or nullptr if not found
See also
GetSubDeviceList()
IDeviceInstance

Implemented in imtdev::CCompositeDeviceInstanceBase.

◆ GetSubDeviceList()

virtual const imtbase::ICollectionInfo & imtdev::ICompositeDeviceInstance::GetSubDeviceList ( ) const
pure virtual

Get the list of available sub-devices.

Returns a collection containing information about all sub-devices currently available within this composite device. The collection supports iteration and provides change notifications when sub-devices are added or removed.

Returns
Reference to collection info containing sub-device instances
See also
GetSubDeviceInstance()
imtbase::ICollectionInfo

Implemented in imtdev::CCompositeDeviceInstanceBase.

◆ GetSupportedSubDeviceTypeIds()

virtual QSet< QByteArray > imtdev::ICompositeDeviceInstance::GetSupportedSubDeviceTypeIds ( ) const
pure virtual

Get supported sub-device type IDs.

Returns a set of device type identifiers that are supported as sub-devices within this composite device. Only devices of these types can be added as sub-devices.

Returns
Set of supported sub-device type identifiers
See also
IDeviceSpecification::GetTypeId()

Implemented in imtdev::CCompositeDeviceInstanceBase.