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.
Enables typed, controlled read and write access to memory areas of a buffer.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: d5d168d169f4ProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Enables typed, controlled read and write access to memory areas of a buffer.
The template class enables typed and controlled access to the allocated memory of an underlying data buffer. Instantiation takes place exclusively via static factory methods, which return the instance as a unique pointer ([AP_SWS_SHWA_00007]). At runtime, data can be processed via type-safe read and write operations or via index operators ([AP_SWS_SHWA_00011]). All copy and move operations are prohibited, while individual data operations are subject to specific requirements for thread safety and error handling.
Context
The template class ara::shwa::Accessor forms the central access interface for typed memory access to shared memory buffers in AUTOSAR Adaptive Platform. It encapsulates the addressing and access logic to an underlying ara::shwa::Buffer and parameterizes it statically via the data type (DataT), dimensionality (Dimensions), access mode (AccessModeType), target device (AccessTargetType), and the memory allocator used (AllocatorT). In advanced scenarios, the class incorporates a TaskHandler, which presumably controls processing tasks in the buffer environment. Question Q-552022fbf949a1f0 (open)
Within the module, the class acts in interaction with three central interaction partners:
Application / caller: Requests instances via the factory interface and executes read or write operations via methods or operators.
ara::shwa::Buffer: Provides the allocated memory area and is passed to the accessor as a reference during its creation ([AP_SWS_SHWA_00007]).
TaskHandler: Is registered during creation if needed in order to coordinate tasks during buffer handling ([AP_SWS_SHWA_00008]).
The lifecycle of ara::shwa::Accessor is subject to strict semantic restrictions that prevent uncontrolled duplication or moving of access instances. The default constructor is explicitly deleted ([AP_SWS_SHWA_00002]). Likewise, both the copy constructor ([AP_SWS_SHWA_00003]) and the move constructor ([AP_SWS_SHWA_00005]) as well as all copy and move assignment operators are declared as deleted ([AP_SWS_SHWA_00004], [AP_SWS_SHWA_00006]). Direct instantiation on the stack or value semantics is thus excluded.
The creation of new instances occurs exclusively via the static factory method Create ([AP_SWS_SHWA_00007], [AP_SWS_SHWA_00008]). It returns a ara::core::Result<std::unique_ptr<Accessor>>, whereby ownership is transferred exclusively to the caller. The object is automatically destroyed as soon as the owning std::unique_ptr goes out of scope. The creation methods are specified as thread-safe and exception safe ([AP_SWS_SHWA_00007], [AP_SWS_SHWA_00008]).
A regular usage sequence is divided into object creation, optional property checking, and subsequent read and write operations on the buffer:
Instantiation via factory: The application calls Accessor::Create and passes the reference to a ara::shwa::Buffer as well as optionally configuration properties and a TaskHandler ([AP_SWS_SHWA_00007], [AP_SWS_SHWA_00008]). After checking the ara::core::Result, the application takes over the std::unique_ptr<Accessor>.
Evaluating properties: The template method HasProperty<PropertyT>() can be used to query whether a specific characteristic is present ([AP_SWS_SHWA_00015]). Present characteristics are subsequently read out with GetProperty<PropertyT>() ([AP_SWS_SHWA_00016]).
Executing data access: Two interface paths are available for the actual data exchange:
Method-based access: Write operations take place via Set(index, value) ([AP_SWS_SHWA_00011]), read operations via Get(index) ([AP_SWS_SHWA_00012]), in each case addressed via a dimensional identifier (Id<Dimensions>).
Operator-based access: The index operator operator[] allows direct addressing via Id<Dimensions> ([AP_SWS_SHWA_00009]) or a linear offset of type std::size_t ([AP_SWS_SHWA_00010]). The return type ReferenceT resolves to const DataT& for read access and to DataT& for write access ([AP_SWS_SHWA_00014]).
Erroneous operations are represented via the ara::core::Result using error codes from ShwaErrorCode:
ShwaErrorCode::kAccessorFailure: Occurs during Create if the construction conditions or parameters are invalid ([AP_SWS_SHWA_00007], [AP_SWS_SHWA_00008]).
ShwaErrorCode::kInvalidIndex: Is reported for Get ([AP_SWS_SHWA_00012]) and Set ([AP_SWS_SHWA_00011]) if no valid initial value is present or the index is out of bounds.
ShwaErrorCode::kInvalidAccessMode: Occurs for Set if the combination of access modes is invalid ([AP_SWS_SHWA_00011]); this is likely the case when a write call is made on a class instantiated for AccessMode::kRead. Question Q-170e82f3dec16e75 (open)
ShwaErrorCode::kResourceBusy: Indicates for Get ([AP_SWS_SHWA_00012]) and Set ([AP_SWS_SHWA_00011]) that the resource is currently busy. For this error, rollback semantics are guaranteed, whereby the previous state is preserved.
ShwaErrorCode::kFeatureNotSupported: Is returned when a property requested via GetProperty is not supported ([AP_SWS_SHWA_00016]).
ara::core::Result< DataT > Get (Id< Dimensions > index);
Liest die durch die Signatur bezeichnete Information oder Eigenschaft aus dem Objekt.
Scope
class ara::shwa::Accessor
Thread Safety
thread-safe rollback_semantics ShwaErrorCode::kInvalid Index The operation could not be performed because no initial value is available rollback_semantics
Exception Safety
not exception safe
Errors
ShwaErrorCode::k ResourceBusy The operation could not be performed because the resource is currently busy.
Request a governed re-review of this record. The record is not changed immediately.
ara::core::Result< void > Set (Id< Dimensions > index, DataT value);
Schreibt den übergebenen Wert an die durch die Signatur bestimmte Stelle.
Scope
class ara::shwa::Accessor
Thread Safety
thread-safe
Exception Safety
not exception safe
Errors
ShwaErrorCode::kInvalid Index no_rollback_semantics The operation could not be performed because no initial value is available no_rollback_semantics ShwaErrorCode::kInvalid AccessMode Opening a file failed because the requested combination of Open Modes is invalid no_rollback_semantics ShwaErrorCode::k IntegrityCorrupted The structural integrity of the memory allocated by Buffer could not be established rollback_semantics ShwaErrorCode::k ResourceBusy The operation could not be performed because the resource is currently busy.
Request a governed re-review of this record. The record is not changed immediately.
gemini-3.8-flash-low· 2026-10-13 · German original