ImagingTools Core SDK
List of all members
imtdev::CDeviceDataFilePersistenceComp

File persistence adapter for device data. More...

#include <CDeviceDataFilePersistenceComp.h>

Inherits ilog::CLoggerComponentBase, and ifile::IFilePersistence.

Detailed Description

File persistence adapter for device data.

CDeviceDataFilePersistenceComp implements the Adapter Pattern to adapt IDeviceDataPersistence (low-level device storage) to ifile::IFilePersistence (file-based persistence). This enables device data to be saved and loaded using standard file operations.

This component realizes the implementation of the ifile::IFilePersistence interface using an underlying IDeviceDataPersistence instance, bridging device hardware storage with file system operations.

Purpose:
Enables device data to be treated as files by:
  • Converting device storage operations to file load/save operations
  • Supporting progress tracking for long-running operations
  • Providing file type information for UI file dialogs
  • Validating operations against device capabilities
Key Features:
  • Storage Abstraction: Maps device ROM/EEPROM to file operations
  • Progress Support: Tracks read/write progress for UI feedback
  • File Type Info: Provides file extensions and descriptions
  • Operation Validation: Checks if operations are supported before execution
  • Metadata Handling: Preserves device metadata in file operations
Component Configuration:
Supported Operations:
  • LoadFromFile: Reads device data from storage into memory object
  • SaveToFile: Writes memory object to device storage
  • IsOperationSupported: Validates whether operation can be performed
Usage Pattern:
// Obtain file persistence adapter instance (via component system)
CDeviceDataFilePersistenceComp* pFilePersistence = // get from component system
// Component is configured with IDeviceDataPersistence reference
// Access as file persistence interface
ifile::IFilePersistence* pPersistence = pFilePersistence;
// Load device data (provide your own data object and progress manager)
istd::IChangeable* pData = // your data object
ibase::IProgressManager* pProgress = // your progress manager
auto result = pPersistence->LoadFromFile(*pData, "device_data.bin", pProgress);
if (result == ifile::IFilePersistence::OS_SUCCESS)
{
// Process loaded data
}
// Save device data
result = pPersistence->SaveToFile(*pData, "device_data.bin", pProgress);
// Get file type info for file dialog
QStringList extensions;
pPersistence->GetFileExtensions(extensions); // e.g., ["*.bin", "*.dat"]
File persistence adapter for device data.
File Format:
The actual file format depends on the device and storage type (ROM/EEPROM). Typically binary data with optional metadata header.
See also
IDeviceDataPersistence
ifile::IFilePersistence
ibase::IProgressManager

Definition at line 87 of file CDeviceDataFilePersistenceComp.h.