Diese Seite wurde vollständig KI-generiert auf Basis von SWS Safe Hardware Acceleration (R25-11) — kein offizieller AUTOSAR-Text und keine automatisch extrahierte API-Seite wie die übrigen Module. Als Interpretation gekennzeichnete Aussagen sind Schlussfolgerungen aus den Quellen.
[AP_SWS_SHWA_01001] wording not yet importedUpstream: RS_SHWA_00017
template <int Dimensions = 1> class Range final {...};
Die Spezifikation definiert diesen Klassentyp mit der gezeigten Schnittstelle.
Encapsulates range sizes of up to three dimensions as an immutable value type via controlled factory creation.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 9801add965b6ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Encapsulates range sizes of up to three dimensions as an immutable value type via controlled factory creation.
The class encapsulates multidimensional range dimensions and completely prevents parameterless instantiation [AP_SWS_SHWA_01002]. Objects are created in a controlled manner via static factory methods that return ShwaErrorCode::kRuntime in the event of an error and, upon success, provide exception-safe value objects with copy and move semantics [AP_SWS_SHWA_01007]. Reading individual dimensions is not thread-safe and requires external synchronization [AP_SWS_SHWA_01010].
Context
Within the Adaptive Platform module shwa, the template class ara::shwa::Range represents a multidimensional range or size specification (parameterized by default via Dimensions = 1). In hardware-oriented or memory-sharing architectures, a range object typically serves as a structured description of geometric extents or buffer dimensions over up to three axes. Interaction partners are primarily application components and driver services that need to allocate, partition, or address memory regions. The class encapsulates the discrete extents of the dimensions and protects them against erroneous direct construction by preventing incompletely or invalidly initialized objects through interface constraints.
Lifecycle
The lifecycle of an instance of ara::shwa::Range is determined by strict construction rules. The parameterless default constructor is explicitly deleted [AP_SWS_SHWA_01002]. Direct creation without specifying the dimensions is therefore precluded. Instead, creation occurs exclusively via static factory methods Create that are overloaded for one-, two-, or three-dimensional variants: for one dimension with dim0[AP_SWS_SHWA_01007], for two dimensions with dim0 and dim1[AP_SWS_SHWA_01008], and for three dimensions with dim0, dim1, and dim2[AP_SWS_SHWA_01009]. Each of these factory functions returns a ara::core::Result<Range>.
After successful creation, the class behaves as a full-fledged value type. It provides both the copy constructor [AP_SWS_SHWA_01003] and the copy assignment operator [AP_SWS_SHWA_01004] as standardized, exception-safe operations (noexcept = default). In addition, a move constructor [AP_SWS_SHWA_01005] and a move assignment operator [AP_SWS_SHWA_01006] are available with the same exception safety. Instances thus possess clear value semantics and can easily be transferred or held in containers. Regarding concurrency, the static factory methods are designed to be thread-safe, whereas the reading inspector methods GetDimension0[AP_SWS_SHWA_01010], GetDimension1[AP_SWS_SHWA_01011], and GetDimension2[AP_SWS_SHWA_01012] are classified as not thread-safe by the specification.
Usage Path
A typical usage path comprises creating a range instance via the static interface, validating the result, and subsequently reading the dimensions for configuration or allocation steps. The following sequence diagram illustrates this flow.
In the first step, the application calls one of the factory overloads, for example Create(dim0)[AP_SWS_SHWA_01007] for a one-dimensional range or Create(dim0, dim1)[AP_SWS_SHWA_01008] or Create(dim0, dim1, dim2)[AP_SWS_SHWA_01009] for multidimensional configurations. The calling layer then checks the returned ara::core::Result for success. If a valid value is present, the Range object is dereferenced or moved. Subsequently, downstream functions can query the contained axis sizes via GetDimension0[AP_SWS_SHWA_01010] as well as, if required, via GetDimension1[AP_SWS_SHWA_01011] and GetDimension2[AP_SWS_SHWA_01012] and use them for buffer operations.
Error Scenarios
During creation via Create, error conditions can occur that cause the initialization to fail. In this case, the factory does not return an initialized object, but rather an error result of type ShwaErrorCode::kRuntime ("General runtime error") [AP_SWS_SHWA_01007], [AP_SWS_SHWA_01008], [AP_SWS_SHWA_01009]. For all factory variants, the specification guarantees rollback semantics and exception safety (noexcept), so that no partial states remain or inconsistencies are caused in the event of an error.
No return error codes are provided for the inspector methods GetDimension0[AP_SWS_SHWA_01010], GetDimension1[AP_SWS_SHWA_01011], and GetDimension2[AP_SWS_SHWA_01012]; however, the specification identifies them as not exception-safe (not exception safe) and not thread-safe (not thread-safe). The caller therefore bears the precondition of securing access across threads. Furthermore, calling a dimension query that exceeds the number of dimensions instantiated with the template parameter Dimensions (for example, GetDimension2 in a one-dimensional configuration) is likely impermissible and leads to errors. Question Q-794519baf2ea8a5e (open)
This guide is based exclusively on the interface specification of ara::shwa::Range from AUTOSAR Adaptive R25-11.
gemini-3.8-flash-low· 2026-10-13 · German original