Enables monitoring diagnostic operation cycles and triggering a cycle restart via modeled ports.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 3e8e62c1c567ProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Enables monitoring diagnostic operation cycles and triggering a cycle restart via modeled ports.
The ara::diag::OperationCycle class provides the application with functions for controlling and monitoring diagnostic operation cycles [SWS_DM_00752]. Instances are bound to a modeled port via an ara::core::InstanceSpecifier, are neither copyable nor movable, and may only exist once per identifier in the process. Via SetNotifier, a notification for cycle changes can be configured, and a restart of the operation cycle can be triggered by means of RestartOperationCycle[SWS_DM_01102]. With the exception of the thread-safe constructor, all methods as well as the destructor are not thread-safe and require application-side synchronization in case of parallel access.
Context
The ara::diag::OperationCycle class implements the DiagnosticOperationCycleInterface within AUTOSAR Adaptive Diagnostics and provides functions for handling and controlling operation cycles. It serves as an interface between the adaptive application and Diagnostic Management to monitor or specifically reset states of operation cycles.
The connection to the overall system takes place via an ara::core::InstanceSpecifier, which is passed during the constructor call [SWS_DM_00752]. This identifier references an PortPrototype defined in the model. In this context, the model prescribes a unique mapping: an PortPrototype referenced by an DiagnosticOperationCyclePortMapping must be typed by the DiagnosticOperationCycleInterface[SWS_DM_00752]. In addition to control, the class interacts via a callback interface of type ara::diag::OperationCycle::OperationCycleSetNotifier (defined as std::function<void(void)>), through which notifications upon a change of the operation cycle are transmitted to the application [SWS_DM_02078], [SWS_DM_00755].
Lifecycle
Creation of ara::diag::OperationCycle takes place explicitly by specifying the port instance specification via the constructor OperationCycle(const ara::core::InstanceSpecifier &specifier)[SWS_DM_00752]. The constructor is specified as exception-safe (exception safe) and thread-safe (thread-safe) [SWS_DM_00752].
With regard to ownership and copy semantics, the class is modeled as a strict single object representing a fixed 1:1 binding to the modeled port. Copying and moving are completely prevented:
The copy constructor is deleted (delete) to rule out duplications [SWS_DM_01598].
The move constructor is deleted (delete) [SWS_DM_01599].
The copy assignment operator is deleted (delete) [SWS_DM_01596].
The move assignment operator is deleted (delete) [SWS_DM_01597].
In addition, the framework prohibits multiple assignment: an InstanceSpecifier must not be repeatedly used for instantiation within the same process [SWS_DM_00752]. Release takes place in the destructor ~OperationCycle()[SWS_DM_00753]. In contrast to the constructor, the destructor is not thread-safe (not thread-safe), although it is declared as exception-safe [SWS_DM_00753]. The other methods of the class as well as the callback type are also not thread-safe [SWS_DM_00755], [SWS_DM_01102], [SWS_DM_02078], so parallel accesses to the same instance must be synchronized on the application side.
Usage Path
A typical usage path comprises instantiation, optional registration of a handler for cycle changes, repeatedly triggering the cycle restart, and release:
Instantiation: The application creates the object OperationCycle, passing the corresponding InstanceSpecifier[SWS_DM_00752].
Register notifier: Via the method SetNotifier, the application registers a callback function of type OperationCycleSetNotifier[SWS_DM_00755], [SWS_DM_02078]. This function is called when the operation cycle changes. A consecutive call of SetNotifier completely overwrites the previously registered notifier [SWS_DM_00755].
Restart operation cycle: By means of RestartOperationCycle(), the application triggers the restart of the operation cycle [SWS_DM_01102]. Diagnostic Management updates the cycle and notifies the registered callback upon state changes [SWS_DM_00755]. The notification is likely to occur asynchronously in the context of Diagnostic Management. Question Q-7cd22debf6fa91d7 (open)
Destruction: When shutting down the software component, the object is destroyed via the destructor [SWS_DM_00753].
Errors during initialization are signaled by the framework as violations, since the constructor is declared as noexcept[SWS_DM_00752]:
InstanceSpecifierMappingIntegrityViolation: The InstanceSpecifier cannot be resolved in the context of the executable or references an element that is not an PortPrototype[SWS_DM_00752].
PortInterfaceMappingViolation: The PortPrototype referenced by DiagnosticOperationCyclePortMapping is not typed by an DiagnosticOperationCycleInterface[SWS_DM_00752].
ProcessMappingViolation: Although a matching instance reference exists, no matching modeled process was found for the runtime process [SWS_DM_00752].
InstanceSpecifierAlreadyInUseViolation: The constructor was called with an InstanceSpecifier that is already used within the current process [SWS_DM_00752].
In regular operation, the methods SetNotifier and RestartOperationCycle return a ara::core::Result<void>[SWS_DM_00755], [SWS_DM_01102]. For both functions, no specific error codes are defined in the standard (“This function does not specify any standardized errors.”) [SWS_DM_00755], [SWS_DM_01102]. The use of the Result type is likely primarily intended to ensure a uniform interface design and offer room for implementation-specific error states. Question Q-2c59a287c0d5783a (open)
This guide was generated by an AI system based on the AUTOSAR Adaptive R25-11 specification.
Registering a notifier function which is called if the operation cycle is changed. A consecutive call of this method will overwrite the previous registered notifier.
InstanceSpeci- InstanceSpecifier either cannot be resolved in the model in the fierMappingIn- context of your executable, or it refers to a model element other tegrityViolation than a PortPrototype. PortInterfaceMap- A PortPrototype that is referenced by a pingViolation DiagnosticOperationCyclePortMapping needs to be typed by a DiagnosticOperationCycleInterface. ProcessMappingVio- Matching InstanceRef exists, but no matching (modelled) Process lation found that matches the (runtime) process. InstanceSpecifier- Violation message that is sent in case a constructor in the ara AlreadyInUseViola- framework was called with an InstanceSpecifier already in use in tion this process.
Parameter (in)
Parameter
Beschreibung
specifier
InstanceSpecifier to a PortPrototype of a DiagnosticOperationCycleInterface.
Request a governed re-review of this record. The record is not changed immediately.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 3cc8bab8ea58ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The member function RestartOperationCycle of class ara::diag::OperationCycle (provided via #include "ara/diag/operation_cycle.h") serves to notify Diagnostic Management (DM) of the restart of an operation cycle [SWS_DM_01102]. Operation cycles such as ignition cycles ("Ignition on/off"), voltage cycles ("Power up/power down"), or accumulated operating times are managed by the adaptive application and have a direct influence on the UDS DTC status byte as well as the behavior of the event memory according to ISO 14229-1 SWS Diagnostics §7.3.4.3 “Operation Cycles Management”.
Call and Semantics
The function is called without parameters and returns a ara::core::Result<void>[SWS_DM_01102]. If the DM is not yet ready to process the restart notification at the time of the call, this information is not lost: the DM temporarily buffers the event (caching) and evaluates the cycle restart as soon as the connection is re-established [SWS_DM_01103].
Error Handling and Concurrency
No standardized error codes are specified for RestartOperationCycle[SWS_DM_01102]. The function is specified as exception-safe (exception safe) and throws no C++ exceptions (noexcept) [SWS_DM_01102]. However, since the interface is explicitly designated as not thread-safe (not thread-safe) [SWS_DM_01102], concurrent accesses to the same instance by the calling application are likely to require synchronization. Question Q-b3b258a20fd9db22 (open)
This usage note was generated automatically based on the AUTOSAR specification R25-11.
Registering a notifier function which is called if the operation cycle is changed. A consecutive call of this method will overwrite the previous registered notifier.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 4ba4d539945dProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The method ara::diag::OperationCycle::SetNotifier ([SWS_DM_00755]) serves to register an application-side callback function of type OperationCycleSetNotifier. This notifier function is called by Diagnostic Management (DM) as soon as the state of the monitored operation cycle changes ([SWS_DM_00755]). To use the method, the header file ara/diag/operation_cycle.h must be included ([SWS_DM_00755]).
The operation is declared as noexcept and provides exception safety (exception safe) ([SWS_DM_00755]). ara::core::Result<void> is returned as the synchronous return value; specific standardized error codes are, however, not defined ([SWS_DM_00755]). Any error states in the result object are therefore likely to be manufacturer- or platform-specific. Question Q-6799492164efd793 (open) Regarding concurrency, the method is specified as not thread-safe (not thread-safe) ([SWS_DM_00755]), so parallel calls on the same object instance must strictly be synchronized by the application.
This usage note was created automatically and is based on the specification AUTOSAR Adaptive R25-11.
gemini-3.8-flash-low· 2026-10-13 · German original