ImagingTools Core SDK
List of all members
imtdev::CDeviceControllerProxyComp

Proxy controller component aggregating multiple device controllers. More...

#include <CDeviceControllerProxyComp.h>

Inheritance diagram for imtdev::CDeviceControllerProxyComp:
imtdev::IDeviceController imtdev::IDeviceEnumerator::IResultHandler imtdev::IDeviceEnumerator

Additional Inherited Members

- Public Types inherited from imtdev::IDeviceEnumerator
enum  StartResult { SR_OK , SR_PREVIOUS_ENUMERATION_NOT_FINISHED , SR_FAILED }
 Start enumeration result codes. More...
 
- Public Types inherited from imtdev::IDeviceEnumerator::IResultHandler
enum  EnumerationResult { ER_OK , ER_CANCELED , ER_FAILED }
 Enumeration result codes. More...
 

Detailed Description

Proxy controller component aggregating multiple device controllers.

CDeviceControllerProxyComp implements the Proxy Pattern to aggregate multiple IDeviceController instances into a unified interface. It provides seamless access to devices from different controllers through a single entry point.

This component is essential for systems with multiple device types managed by different controllers, enabling:

Key Features:
  • Multi-Controller Aggregation: Manages multiple IDeviceController instances
  • Automatic Enumeration: Configurable periodic enumeration (default: 5 seconds)
  • Smart Routing: Routes device operations to correct underlying controller
  • Unified Device List: Combines devices from all controllers
  • State Aggregation: Unified state provider across all controllers
  • Change Tracking: Multi-model dispatcher for tracking all controller changes
Component Structure:
The component exposes multiple sub-elements:
  • DeviceTypeList: Collection of all supported device types from all controllers
  • DeviceList: Aggregated list of devices from all controllers (ICollectionInfo)
  • DeviceStateProvider: Unified state provider (IDeviceStateProvider)
  • OverriddenDeviceInfo: Collection of custom names/descriptions
Configuration:
  • DeviceControllers: Multi-reference to IDeviceController instances to aggregate
  • EnableEnumerationControl: Enable automatic enumeration (default: false)
  • EnumerationInterval: Time between enumeration cycles in seconds (default: 5, 0 = continuous)
Enumeration Control:
When enabled, the proxy automatically:
  1. Enumerates all controllers periodically
  2. Updates aggregated device lists
  3. Handles enumeration failures gracefully
  4. Respects the configured interval
Usage Pattern:
// Obtain proxy controller instance (created via component system)
CDeviceControllerProxyComp* pProxy = // get from component system
// Obtain controller references (configured via component system)
IDeviceController* pController1 = // USB device controller reference
IDeviceController* pController2 = // Network device controller reference
pProxy->AddDeviceController(pController1);
pProxy->AddDeviceController(pController2);
// Enable automatic enumeration every 5 seconds
pProxy->SetEnumerationControl(true);
pProxy->SetEnumerationInterval(5);
// Use as unified controller
const ICollectionInfo& allDevices = pProxy->GetDeviceInstanceList();
DeviceAccessorPtr pAccessor = pProxy->OpenDevice(deviceId, nullptr);
Proxy controller component aggregating multiple device controllers.
Common interface for controlling devices.
Thread Safety:
  • Inherits thread safety from CMultiModelDispatcherBase
  • Uses Qt timer for periodic enumeration (thread-safe signal/slot)
  • Controller operations are delegated with proper synchronization
See also
IDeviceController
CDeviceControllerCompBase
imod::CMultiModelDispatcherBase

Definition at line 100 of file CDeviceControllerProxyComp.h.