ImagingTools Core SDK
List of all members
imtdev::CDeviceControllerCompBase

Base controller component implementing IDeviceController interface. More...

#include <CDeviceControllerCompBase.h>

Inheritance diagram for imtdev::CDeviceControllerCompBase:
imtdev::IDeviceController 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 Member Functions inherited from imtdev::IDeviceController
virtual const QByteArrayList & GetSupportedDeviceTypeIds () const =0
 Get IDs of device types supported by the controller.
 
virtual const IDeviceSpecificationGetDeviceStaticInfo (const QByteArray &deviceTypeId) const =0
 Get device static info for the given device type ID.
 
virtual DeviceInstancePtr GetDeviceInstance (const QByteArray &deviceId) const =0
 Get device instance info for the given device ID.
 
virtual DeviceAccessorPtr OpenDevice (const QByteArray &deviceId, const iprm::IParamsSet *paramsPtr)=0
 Open a device and start its processing loop.
 
virtual bool CloseDevice (const QByteArray &deviceId)=0
 Close a device and stop its processing loop.
 
- Public Member Functions inherited from imtdev::IDeviceEnumerator
virtual StartResult StartEnumeration (IResultHandler *resultHandlerPtr)=0
 Start device enumeration process.
 
virtual void CancelEnumeration ()=0
 Cancel device enumeration process.
 

Detailed Description

Base controller component implementing IDeviceController interface.

CDeviceControllerCompBase provides a complete, reusable implementation of the IDeviceController interface with thread-safe device management, enumeration support, and state tracking capabilities.

This class serves as the foundation for device controller implementations throughout the system, handling common concerns like device list management, device name/description overrides, and state provider functionality.

Key Features:
  • Thread-Safe Device Management: Mutex-protected device list and opened devices map
  • Device Enumeration: Support for asynchronous device discovery
  • State Tracking: Built-in device state provider for monitoring device states
  • Name/Description Overrides: Customizable device names and descriptions
  • Auto-Close: Automatically close devices not found during enumeration
  • Collection Info: Provides device list as ICollectionInfo for UI binding
  • Logging Support: Integrated with logging framework (CLoggerComponentBase)
Component Structure:
The component exposes multiple sub-elements:
  • DeviceInfoList: Collection of discovered devices (ICollectionInfo)
  • OverriddenDeviceInfo: Collection of custom names/descriptions
  • DeviceStateProvider: State tracking for all devices (IDeviceStateProvider)
Configuration:
  • AutoClose: Boolean attribute to enable/disable automatic device closing (default: true)
Thread Safety:
Uses QMutex (Qt5) or QRecursiveMutex (Qt6) to protect:
  • Device list updates
  • Opened devices map
  • State queries
Usage Pattern:
Derived classes should:
  1. Implement device-specific enumeration logic
  2. Call UpdateDeviceList() with discovered devices
  3. Override OpenDevice() and CloseDevice() for device-specific operations
  4. Provide device specifications via GetDeviceStaticInfo()
See also
IDeviceController
CDeviceControllerProxyComp

Definition at line 72 of file CDeviceControllerCompBase.h.