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

Interface for modifying composite device instance information. More...

#include <IEditableCompositeDeviceInstance.h>

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

Public Member Functions

virtual QByteArray AddSubDevice (const QByteArray &deviceTypeId, const QString &name, const QString &description=QString(), const istd::IChangeable *defaultValuePtr=nullptr, const QByteArray &proposedId=QByteArray())=0
 Add new sub-device to the composite.
 
virtual bool RemoveSubDevice (const QByteArray &subDeviceId)=0
 Remove sub-device from the composite.
 
- Public Member Functions inherited from imtdev::ICompositeDeviceInstance
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 modifying composite device instance information.

IEditableCompositeDeviceInstance extends ICompositeDeviceInstance to provide mutable access to the hierarchical device structure. It enables dynamic addition and removal of sub-devices within a composite device instance at runtime.

This interface is essential for:

Dynamic Operations:
  • Add Sub-Device: Create new sub-device instances within the composite
  • Remove Sub-Device: Remove existing sub-devices from the composite
  • Type Validation: Ensure sub-devices match supported types
Usage Pattern:
// Obtain or create editable composite device instance
CCompositeDeviceInstanceBase* pComposite = // your composite instance
// Add a camera sub-device
QByteArray cameraTypeId = "StandardCamera";
QByteArray cameraId = pComposite->AddSubDevice(
cameraTypeId, // Device type ID
"Front Camera", // Name
"High resolution front camera", // Description
nullptr, // Default value (optional)
"CAMERA_001" // Proposed ID (optional)
);
if (!cameraId.isEmpty())
{
// Sub-device successfully added
const IDeviceInstance* pCamera =
pComposite->GetSubDeviceInstance(cameraId);
}
// Add a sensor hub sub-device
QByteArray sensorHubTypeId = "SensorHub";
QByteArray sensorHubId = pComposite->AddSubDevice(
sensorHubTypeId,
"Environmental Sensors",
"Temperature and humidity sensors"
);
// Remove a sub-device
if (pComposite->RemoveSubDevice(cameraId))
{
// Camera sub-device successfully removed
}
// Verify sub-device list after modifications
const imtbase::ICollectionInfo& subDevices =
pComposite->GetSubDeviceList();
int subDeviceCount = subDevices.GetCount();
Base implementation class for composite device instances.
virtual QByteArray AddSubDevice(const QByteArray &deviceTypeId, const QString &name, const QString &description=QString(), const istd::IChangeable *defaultValuePtr=nullptr, const QByteArray &proposedId=QByteArray()) override
Add new sub-device.
virtual const imtbase::ICollectionInfo & GetSubDeviceList() const override
Get sub-device list.
virtual const IDeviceInstance * GetSubDeviceInstance(const QByteArray &subDeviceId) const override
Get specific sub-device instance.
virtual bool RemoveSubDevice(const QByteArray &id) override
Remove sub-device.
Interface for describing runtime information about a device instance.
Type Safety:
Sub-devices can only be added if their type ID is in the set returned by GetSupportedSubDeviceTypeIds(). Attempting to add unsupported types will fail.
Change Notifications:
Adding or removing sub-devices triggers change notifications through the istd::IChangeable interface, allowing observers to react to structural changes.
See also
ICompositeDeviceInstance
IDeviceSpecification
CCompositeDeviceInstanceBase

Definition at line 89 of file IEditableCompositeDeviceInstance.h.

Member Function Documentation

◆ AddSubDevice()

virtual QByteArray imtdev::IEditableCompositeDeviceInstance::AddSubDevice ( const QByteArray &  deviceTypeId,
const QString &  name,
const QString &  description = QString(),
const istd::IChangeable *  defaultValuePtr = nullptr,
const QByteArray &  proposedId = QByteArray() 
)
pure virtual

Add new sub-device to the composite.

Creates and adds a new sub-device instance with the specified type and properties. The device type must be in the list of supported sub-device types for this composite.

Parameters
deviceTypeIdType identifier of the sub-device to create
nameHuman-readable name for the sub-device
descriptionOptional description of the sub-device
defaultValuePtrOptional default configuration for the sub-device
proposedIdOptional proposed identifier for the sub-device; if empty, an ID will be generated automatically
Returns
Unique identifier of the newly created sub-device, or empty array on failure
See also
RemoveSubDevice()
ICompositeDeviceInstance::GetSupportedSubDeviceTypeIds()

Implemented in imtdev::CCompositeDeviceInstanceBase.

◆ RemoveSubDevice()

virtual bool imtdev::IEditableCompositeDeviceInstance::RemoveSubDevice ( const QByteArray &  subDeviceId)
pure virtual

Remove sub-device from the composite.

Removes an existing sub-device from the composite device structure.

Parameters
subDeviceIdUnique identifier of the sub-device to remove
Returns
true if sub-device was removed successfully, false otherwise
See also
AddSubDevice()

Implemented in imtdev::CCompositeDeviceInstanceBase.