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_00501] wording not yet importedUpstream: RS_SHWA_00008
class ErrorHandler final {...};
Die Spezifikation definiert diesen Klassentyp mit der gezeigten Schnittstelle.
Serves for detecting and forwarding errors in the shwa module to an application-specific handling routine.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: d10c8775782fProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Serves for detecting and forwarding errors in the shwa module to an application-specific handling routine.
The class serves for the central reception and forwarding of errors within the shwa module. Instances can exclusively be created via the static factory method, which provides the object in an exclusive pointer [AP_SWS_SHWA_00507]. Specific error codes are passed and processed via the error handling method [AP_SWS_SHWA_00508]. Because error handling is designed to be neither thread-safe nor exception-safe, the calling application must coordinate concurrent access externally.
Context
The class ara::shwa::ErrorHandler provides a specialized interface in the module shwa (Smart Hardware Actuator) for receiving and purposefully forwarding module-specific error states. As part of the AUTOSAR Adaptive Platform, it decouples the actual hardware and actuator logic from higher-level error handling strategies. The class is declared as final, which prevents derivation and enforces a firmly defined usage behavior.
Essential interaction partners of ara::shwa::ErrorHandler are:
The using application or platform component that manages the instance and triggers the handling method in case of an error.
The callback std::function<void(ara::core::ErrorCode)> registered upon creation, which executes the actual handling response at the application level.
The module-specific error domain represented by the type ara::shwa::ShwaErrorCode.
Lifecycle
The lifecycle of an instance of ara::shwa::ErrorHandler is subject to strict constraints regarding creation, copyability, and memory ownership. Regular construction via default constructors is precluded because the parameterless constructor is deleted [AP_SWS_SHWA_00502]. To ensure a clear identity and unambiguous responsibilities, the class definition prevents any copy and move operations:
The only way to instantiate is provided by the static factory method Create[AP_SWS_SHWA_00507]. This accepts the function object std::function<void(ara::core::ErrorCode)> and returns the result in the form of a ara::core::Result<std::unique_ptr<ErrorHandler>>. Through the std::unique_ptr, exclusive ownership of the object is transferred to the caller. The lifetime of the instance is thus directly bound to the lifetime of the smart pointer; upon its destruction, the ErrorHandler is also released.
Regarding concurrency, the creation method Create is specified as thread-safe (thread-safe) and exception-safe (exception safe) [AP_SWS_SHWA_00507]. In contrast, the operational error handling method HandleError is specified as neither thread-safe nor exception-safe [AP_SWS_SHWA_00508]. Concurrent access to the same instance must consequently be coordinated at the application level.
Usage Path
The typical flow when using ara::shwa::ErrorHandler includes initialization via the factory and subsequent error processing:
Callback definition: The application defines a handling routine with the signature void(ara::core::ErrorCode).
Creation: The application calls the static method Create and passes the callback function [AP_SWS_SHWA_00507]. After checking the ara::core::Result, the application takes over the std::unique_ptr<ErrorHandler>.
Error signaling: If an error occurs during ongoing operation, the method HandleError is called on the instance with the corresponding ara::shwa::ShwaErrorCode[AP_SWS_SHWA_00508].
Forwarding: The instance processes the error event; during this, the module-specific error code is internally presumably transformed into a ara::core::ErrorCode and transmitted to the registered callback function (interpretation). Question Q-4101388d317e1f5b (open)
When using the class, essential constraints and edge cases must be observed:
Failure of object creation: The specification identifies no standardized error codes for the factory method Create[AP_SWS_SHWA_00507]. Nevertheless, the method returns a ara::core::Result, so that any error conditions (such as insufficient memory) are likely reported via this result object (interpretation). Question Q-85c2140acfda8244 (open) Callers must therefore validate the Result prior to accessing the pointer.
Preconditions for error handling: A call to HandleError requires an intact instance and a valid ara::shwa::ShwaErrorCode[AP_SWS_SHWA_00508]. Because the method has no return value, errors within processing cannot be reported directly to the caller as a status code.
Lack of exception safety and thread safety: Because HandleError is declared as not thread-safe and not exception safe[AP_SWS_SHWA_00508], the calling environment must ensure that calls occur sequentially and that no unhandled exceptions propagate within the error handling.
This class guide is based on the AUTOSAR specification for the Adaptive Platform (Release R25-11) and was created automatically.
gemini-3.8-flash-low· 2026-10-13 · German original