Serves to encapsulate compressed and uncompressed file sizes in bytes for file transfer services.
Context
The struct ara::diag::FileTransferService::FileSizes is an integral part of the diagnostic module (diag) in the AUTOSAR Adaptive Platform [SWS_DM_01321]. Within the namespace of the higher-level service ara::diag::FileTransferService, it defines a compact data model for representing complete file size specifications AUTOSAR_AP_SWS_Diagnostics §8.18.2 “Struct: FileSizes”. The type is declared via the header file ara/diag/file_transfer.h [SWS_DM_01322]. Its primary responsibility is to bundle the size information relevant to file transfer operations into a uniform data structure, so that interacting platform and application components can exchange file sizes consistently AUTOSAR_AP_SWS_Diagnostics p. 1126.
Functionally, the data structure captures two distinct size specifications: the total uncompressed size of a file via the member uncompressed_size [SWS_DM_01322] as well as the total compressed size via the member compressed_size [SWS_DM_01323]. Both values are maintained as unsigned 64-bit integers (std::uint64_t) in units of bytes. Thereby, FileSizes acts as a semantic information carrier between diagnostic clients, Diagnostic Management, and the concrete service providers that handle file transfers on the Adaptive Platform.
Lifecycle
The struct ara::diag::FileTransferService::FileSizes is modeled as a pure record (value object) without its own virtual methods or complex inheritance hierarchies AUTOSAR_AP_SWS_Diagnostics §8.18.2.1 “Public Member Variables”. Creation typically occurs directly on the call stack or as a member of a higher-level data structure. Since only standard integer types are contained, the struct is likely copyable as well as movable by default and does not require dynamic memory management on the heap. Question Q-f9c6e76fc8c62463 (open)
Ownership depends on the respective usage context: If an instance is created by a diagnostic application, ownership remains with that application or is transferred via pass-by-value to called interface functions. The destruction of the instance is trivial and takes place automatically upon leaving scope without additional cleanup logic. Since the type provides no internal synchronization mechanisms, coordinated and thread-safe usage under concurrent access to the same instance is presumably entirely the responsibility of the participating diagnostic or application components. Question Q-d2e83f9098c7f8c8 (open)
Usage Path
Typical usage of the struct is divided into the phases of initialization, parameter population, and passing to transfer routines of FileTransferService [SWS_DM_01321]. In a typical use case, a sending component determines the actual file dimensions on the file system or in memory prior to starting a file transfer. It then instantiates FileSizes and assigns the measured byte values to the two public variables:
uncompressed_size: Specifies the absolute size of the original file in bytes [SWS_DM_01322].
compressed_size: Specifies the compressed size of the data stream to be transferred in bytes [SWS_DM_01323].
If a file is transferred without prior compression, compressed_size and uncompressed_size presumably carry identical values. Question Q-1edcb924fd5932ee (open) After initialization, the struct is passed to the corresponding file transfer methods so that peers can pre-allocate the memory requirement and precisely monitor the transfer progress AUTOSAR_AP_SWS_Diagnostics p. 77.
Error Scenarios
In the specification of ara::diag::FileTransferService::FileSizes, no dedicated diagnostic error codes, return values, or exceptions are defined AUTOSAR_AP_SWS_Diagnostics §8.18.2 “Struct: FileSizes”. As a passive data type, the struct itself triggers no error messages and does not validate the entered values at runtime.
Error potentials arise primarily from incorrect preconditions and postconditions during parameter population. The type std::uint64_t allows values up to $2^{64}-1$ bytes to be represented [SWS_DM_01322], [SWS_DM_01323]. If a component passes implausible sizes—for example, a value of zero bytes for existing files or a compressed size that drastically exceeds the uncompressed size without plausible explanation—this must be intercepted by the upstream or downstream processing logic of FileTransferService. An overflow of the available destination memory also constitutes an overarching error scenario that must be recognized prior to starting the data transfer on the basis of the byte values transmitted in FileSizes.
This class guide is based on the specification AUTOSAR Adaptive Platform R25-11 (module diag) and was created for autodocs.
gemini-3.8-flash-low· 2026-10-13 · German original