Enables client applications to subscribe to service events and receive typed new data samples.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 056774d8023aProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Enables client applications to subscribe to service events and receive typed new data samples.
The interface class <SI-Namespace>::proxy::events::<Event> enables client applications in the AUTOSAR Adaptive Platform to receive service events on the consumer side via the com module. The typical workflow comprises requesting the subscription via Subscribe[SWS_CM_00141], reactive notification via registered handlers, and synchronous sample retrieval using GetNewSamples[SWS_CM_00701]. In doing so, no more sample pointers may be held concurrently than were reserved during subscription, and all references must be released prior to unsubscription via Unsubscribe.
Context
The C++ class <SI-Namespace>::proxy::events::<Event> represents the consumer-side interface for a service event in the com module of the AUTOSAR Adaptive Platform (Release R25-11). Within the service-oriented communication pattern, this generated class serves as the local representative of an event provided by the server skeleton. Client applications use instances of this class to subscribe to event data, receive incoming samples from the communication network, and control their lifecycle on the consumer side AUTOSAR_AP_EXP_ARAComAPI p. 10.
The essential interaction partners of the class are:
Application (Subscriber): Initiates the registration of the event subscription via Subscribe[SWS_CM_00141], provides callback routines for data reception as well as status changes, and queries new samples via GetNewSamples[SWS_CM_00701].
Communication Management: Coordinates the transmission of event data across the underlying middleware, manages the network status, and executes the registered notification handlers upon arrival of new events or state changes [SWS_CM_00181], [SWS_CM_00333].
Execution context (Executor): When using overloaded registration methods, asynchronous handlers are executed within an explicitly passed context ExecutorT[SWS_CM_11354], [SWS_CM_11356], [SWS_CM_00100].
The instantiation and destruction of <SI-Namespace>::proxy::events::<Event>, as a member of the enclosing proxy class, is presumably tightly bound to the lifetime of the service proxy. Question Q-6c591ea580278c12 (open) After creation, the event is initially in the unsubscribed state. The current subscription status can be queried at any time via GetSubscriptionState, which returns the state as ara::com::SubscriptionState[SWS_CM_00316].
The transition to the active subscription state is initiated via Subscribe, where the maximum number of concurrently available cache slots is specified via maxSampleCount[SWS_CM_00141]. If the event is already in the states kSubscribed or kSubscriptionPending at the time of the call and the passed value matches the current one, the call has no effect [SWS_CM_00141]. Communication Management reports state changes of the subscription via a handler registered by means of SetSubscriptionStateChangeHandler[SWS_CM_00333] or with an execution context via SetSubscriptionStateChangeHandler[SWS_CM_11354]. This registration can be revoked via UnsetSubscriptionStateChangeHandler[SWS_CM_00334]AUTOSAR_AP_EXP_ARAComAPI p. 10.
In addition, the class manages the state of End-to-End protection (E2E). Via GetE2EStateMachineState, the state ara::com::e2e::SMState of the E2E state machine is determined as determined during the most recent internal call to E2E_Check() during GetNewSamples()[SWS_CM_11554]. Faulty transmission conditions can be monitored by handlers set via SetTransportFaultConditionHandler[SWS_CM_00099] or [SWS_CM_00100] and removed via UnsetTransportFaultConditionHandler[SWS_CM_00105].
The subscription is terminated via Unsubscribe[SWS_CM_00151]AUTOSAR_AP_EXP_ARAComAPI p. 10. If the event is not subscribed at this time, the method returns without action [SWS_CM_00151]. All member functions are declared as noexcept and provide full exception safety.
Usage Path
The typical procedure for using the proxy event is divided into the following sequential phases:
Initiate subscription: The application calls Subscribe(maxSampleCount)[SWS_CM_00141] to reserve the buffer size for incoming samples.
Configure notification: Via SetReceiveHandler[SWS_CM_00181] (or with execution context via [SWS_CM_11356]), a parameterless callback is registered that is invoked by Communication Management when new events arrive.
Retrieve and process samples: In the callback, the application calls GetNewSamples[SWS_CM_00701]. A passed callable f with signature void(ara::com::SamplePtr<SampleType const>) processes each sample sequentially. Here, SampleType corresponds to the type-specific payload type of the event [SWS_CM_11401]. The return value provides, as ara::core::Result<std::size_t>, the exact number of samples passed to f[SWS_CM_00701].
Monitor cache: Using GetFreeSampleCount[SWS_CM_00705], the application can check the number of unused slots in the local cache to detect buffer bottlenecks early.
Dereferencing and unsubscription: After data processing is complete, the receive trigger is deactivated with UnsetReceiveHandler[SWS_CM_00183] and the subscription is terminated via Unsubscribe[SWS_CM_00151].
When using the class, specific error codes and runtime violations can occur that require defensive checks:
Configuration error during re-subscription: If Subscribe is called while the event is already subscribed, and the new maxSampleCount differs from the current value, the call fails with error code ComErrc::kMaxSampleCountNotRealizable[SWS_CM_00141]. In case of missing permissions, the system refuses execution with a InsufficientPermissionsViolation[SWS_CM_00141].
Exceeding buffer limits: If the application holds more instances of ara::com::SamplePtr than were guaranteed in the previous call to Subscribe, GetNewSamples returns the error code ComErrc::kMaxSamplesExceeded; in this case, data samples may have been dropped [SWS_CM_00701].
Remaining samples upon unsubscription: If not all held ara::com::SamplePtr are released prior to calling Unsubscribe, this results in a DanglingSamplesViolation[SWS_CM_00151].
This guide was generated by an AI based on the AUTOSAR R25-11 specification.
Returns the state of the specific event class, which was determined by the last run of E2E_Check() function invoked during the last call of GetNewSamples()
Method to subscribe to a service event. If the Event is already in state kSubscribed or in state kSubscriptionPending at the time of the call, and the provided maxSampleCount value is the same as for the current subscription, the method shall return without action.
Returns the state of the specific event class, which was determined by the last run of E2E_Check() function invoked during the last call of GetNewSamples()
• If successful: an ara::core::Result containing a ara:: core::Result::value_type i.e. a std::size_t the total number of data samples passed to f • If unsuccessful: an ara::core::Result containing an ara:: core::Result::error_type i.e. a corresponding ara:: com::ComErrc
Fehler
Fehlercode
Beschreibung
ComErrc::kMaxSamplesExceeded
no_rollback_semantics Application holds more ara::com::SamplePtrs than commited in Subscribe() Samples were possibly skipped.
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: 262c351f3d58Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The function SetReceiveHandler is used on the client side in scope <SI-Namespace>::proxy::events::<Event> to register a callback handler for incoming events [SWS_CM_00181]. Passed as parameter is a ara::com::EventReceiveHandler, which is defined as a parameterless function and is called by Communication Management upon event arrival [SWS_CM_00181]. The function has no return value (void) [SWS_CM_00181].
Error Handling and Exception Behavior
The operation is specified as noexcept and exception-safe (exception safe) [SWS_CM_00181]. If the passed callable does not exist or is null, this is treated as a InvalidHandlerViolation[SWS_CM_00181].
Execution context and interaction
Within the proxy interfaces, SetReceiveHandler belongs to the basic mechanisms alongside calls such as UnsetReceiveHandler() and GetNewSamples()ARAComAPI §5.3.1 “Proxy Class API’s”. If the handler is to be executed in a specified context, the template overload with ExecutorT is available [SWS_CM_11356] (ARAComAPI p. 10).
InvalidHandlerVio- Provided Callable handler does not exist or is null lation
Parameter (in)
Parameter
Beschreibung
handler
The handler that shall be called by Communication Management upon event arrival. The EventReceiveHandler constitutes a function without parameters and has to use the f method of the specific Event class to access the retrieved event data. See [SWS_CM_00309] for its definition.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: a54152e96424ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The method SetSubscriptionStateChangeHandler in namespace proxy::events::<Event> registers a callback function that Communication Management calls as soon as the state ara::com::SubscriptionState of the event changes ([SWS_CM_00333]). The function is declared as noexcept and is considered exception-safe ([SWS_CM_00333]).
Usage and Asynchronous Semantics
Calls to Subscribe() operate asynchronously in principle; a successful subscription may only be considered completed once the registered handler or GetSubscriptionState() reports state kSubscribed ([SWS_CM_12006]). The handler is called with kSubscriptionPending if the subscription does not take effect immediately (for example, due to bus protocol latencies) or if the server instance is unreachable due to restarts or network errors ([SWS_CM_00313]). Deregistration of the handler is performed via UnsetSubscriptionStateChangeHandler() (EXP ARAComAPI §5.3.1 “Proxy Class API’s”).
Error Handling and Boundary Conditions
If no valid callback object is passed or if it is null, error case InvalidHandlerViolation is present ([SWS_CM_00333]). Regarding the call order, the handler should expediently be registered before Subscribe() in order to reliably capture early state transitions. Question Q-3b9c25c6aa2d0a0f (open)
Interaction and Variants
For executing the handler in a specified thread or work context, the overloaded template variant with parameter ExecutorT is available ([SWS_CM_11354]). Parallel interfaces exist for proxy triggers ([SWS_CM_01107]), proxy fields ([SWS_CM_11607]), and at the skeleton level ([SWS_CM_12008]).
handler: The callable to be invoked that is notified upon a change in the ara::com::SubscriptionState of the event ([SWS_CM_00333]).
executor: The execution context according to [SWS_CM_11360] in which the handler is to be processed.
Return value: The function has no return value (void).
Error Handling and Execution
The function is declared as noexcept and specified as exception-safe (exception safe). If the passed callable handler does not exist or is null, an InvalidHandlerViolation is thrown ([SWS_CM_11354]).
Interaction
The pattern of context-bound state monitoring with ExecutorT exists analogously for proxy triggers ([SWS_CM_01106]) as well as proxy fields ([SWS_CM_11608]). If no offloading to a specific context is required, variant [SWS_CM_00333] is available.
This usage note was generated automatically based on the AUTOSAR specification R25-11.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f1aa03e805b1Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The member function SetTransportFaultConditionHandler serves on a proxy event ([SWS_CM_00099]) to register a callback function of type ara::com::e2e::TransportFaultConditionHandler. Via this handler, transmission errors detected on the transport level of the communication binding are reported ([SWS_CM_00211]).
Usage and semantics:
Call and parameters: The function takes the callable handler object handler and returns no value ([SWS_CM_00099]). The method signature is declared as noexcept ([SWS_CM_00099]).
Transmitted error states: In case of an error, the registered handler reports values of the enum ara::com::e2e::TransportFaultCondition, such as kSampleRejected in case of dropped samples of the underlying transport channel ([SWS_CM_00211]).
Execution context: For asynchronous executions, a template overload with an additional executor object ExecutorT&& executor is available ([SWS_CM_00100]).
Error handling and constraints:
Exception safety: The function is considered exception-safe (exception safe) ([SWS_CM_00099]).
Violations: If the passed callable does not exist or is null, a InvalidHandlerViolation violation is present ([SWS_CM_00099]).
Interaction: Equivalent interfaces for registering a TransportFaultConditionHandler also exist for triggers ([SWS_CM_00106]), field notifiers ([SWS_CM_00109]), and skeleton methods ([SWS_CM_00093]).
This usage note was created automatically based on the AUTOSAR specification.
Execution Context overload for hierarchicalnamespacelistlowerproxy::proxy:: events::eventname::SetTransportFaultConditionHandler for a given Proxy Event.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 45577c09ced5Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The template function SetTransportFaultConditionHandler registers an application-specific handler of type ara::com::e2e::TransportFaultConditionHandler along with a user-defined executor ([SWS_CM_00100]) on a proxy event. It represents the execution-context overload of the parameter-less base function ([SWS_CM_00099]).
Usage and parameters: The method is called on instances of <SI-Namespace>::proxy::events::<Event> and returns no value (void) ([SWS_CM_00100]). It takes the handler to be called (handler) and accepts an executor object (executor as universal reference ExecutorT&&), in whose context any asynchronous execution of the handler is initiated ([SWS_CM_00100]). The function signature is declared with noexcept ([SWS_CM_00100]).
Error handling: The operation is specified as exception safe ([SWS_CM_00100]). If an invalid or non-existent callable (null) is passed, a violation in the form of InvalidHandlerViolation is present ([SWS_CM_00100]). Via the registered handler, detected transport errors are reported, such as TransportFaultCondition::kSampleRejected when incoming data samples are dropped by the underlying transport entity ([SWS_CM_00211]).
Interaction: While [SWS_CM_00099] performs registration without an explicit executor, this overload enables execution in the desired thread or task context ([SWS_CM_00100]). Analogous overloads with an executor are available for skeleton methods ([SWS_CM_00094]) and skeleton fields ([SWS_CM_00097]), as well as on the proxy side for triggers ([SWS_CM_00107]) and field notifiers ([SWS_CM_00110]).
This usage note was generated automatically based on the specification.
Method to subscribe to a service event. If the Event is already in state kSubscribed or in state kSubscriptionPending at the time of the call, and the provided maxSampleCount value is the same as for the current subscription, the method shall return without action.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 7e840633f446Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The method Subscribe registers the proxy element for receiving service events according to [SWS_CM_00141]. The call is asynchronous in nature: The return of the function merely confirms that Communication Management has accepted the registration request (AUTOSAR_AP_EXP_ARAComAPI §5.3.5.2 “Monitoring Event Subscription”). With the mandatory parameter maxSampleCount, the application bindingly communicates how many event samples it will hold at most simultaneously, thereby initializing the local receive buffer (AUTOSAR_AP_EXP_ARAComAPI p. 40).
Error Handling and Boundary Conditions
If the event is already in state kSubscribed or kSubscriptionPending upon the call and the passed value maxSampleCount matches the active subscription, the method returns successfully without action ([SWS_CM_00141]). If, on the other hand, the cache size differs upon renewed subscription, the call fails and returns the error code ComErrc::kMaxSampleCountNotRealizable in ara::core::Result ([SWS_CM_00141]). In case of missing access permissions, the call is rejected (InsufficientPermissionsViolation according to [SWS_CM_00141]). The signature is declared as noexcept and is considered exception-safe.
Interaction
The reserved cache capacity limits subsequent data reception via GetNewSamples ([SWS_CM_00701]); if the application holds more smart pointers than specified, the error ComErrc::kMaxSamplesExceeded is triggered ([SWS_CM_10432]). While field events are subscribed to identically via maxSampleCount ([SWS_CM_11601]), pure trigger events do not require a buffer size specification ([SWS_CM_00723]).
This text was generated automatically using specifications and design guidelines.
• If successful: an ara::core::Result containing a ara:: core::Result::value_type containing a void • If unsuccessful: an ara::core::Result containing an ara:: core::Result::error_type i.e. a corresponding ara:: com::ComErrc
Fehler
Fehlercode
Beschreibung
ComErrc::kMaxSampleCountNotRealizable
rollback_semantics Provided maxSampleCount for event re-subscription does not match the maxSampleCount for the current subscription
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: 51bbc4b93d81Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The function UnsetReceiveHandler is part of the event wrapper in scope <SI-Namespace>::proxy::events::<Event> and is included via header file #include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_proxy.h" ([SWS_CM_00183]). It accepts no input parameters and has no return value (void). The call removes an application-specific receive handler for a service event that was previously registered with SetReceiveHandler (EXP ARAComAPI §5.3.2 “RadarService Proxy Class Example”). This allows the receiving application to switch at any time between event-driven reception (\"event-driven\") and active querying (\"polling style\") using GetNewSamples() (EXP ARAComAPI §5.3.2 “RadarService Proxy Class Example”).
Error handling
The method is declared with noexcept and possesses the property exception safe ([SWS_CM_00183]). It does not throw exceptions at runtime and does not report specific error codes.
Concurrency and Binding
While the registered callback handler does not need to be reentrant because Communication Management serializes calls (EXP ARAComAPI §5.3.2 “RadarService Proxy Class Example”), UnsetReceiveHandler deactivates the event trigger for receiving further notifications ([SWS_CM_00183]). In the context of the DDS binding, the method UnsetReceiveHandler() is mapped to the corresponding DataReader according to [SWS_CM_11141] in line with the specification [SWS_CM_11026].
For fields, an identically named function UnsetReceiveHandler exists in scope <SI-Namespace>::proxy::fields::<Field>, which is likewise defined as noexcept and exception safe ([SWS_CM_11606]).
For triggers, UnsetReceiveHandler is available in scope <SI-Namespace>::proxy::triggers::<Trigger>, but is declared differently as not exception safe ([SWS_CM_11614]).
This usage note was generated automatically based on the AUTOSAR specifications for Release R25-11.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 72320dd7a142ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The member function UnsetSubscriptionStateChangeHandler serves to reset and unregister a previously set callback handler for changes of the subscription status (ara::com::SubscriptionState) on the proxy side ([SWS_CM_00334], EXP ARAComAPI §1.0). The function is part of the event interface and is located in the application-specific namespace under proxy::events ([SWS_CM_00334], SWS CommunicationManagement §8.3.2.2.4.5 “UnsetSubscriptionStateChangeHandler”). To use it, the generated proxy header file <SiNamespaceDerivedDirectoryPath>/<SiShortname>_proxy.h is included ([SWS_CM_00334]). The call is synchronous, takes no parameters, and returns no value ([SWS_CM_00334]).
Error handling
According to the specification, the function is declared with the identifier noexcept and classified as exception-safe ("exception safe") ([SWS_CM_00334]). In case of error, it throws no C++ exceptions and reports no error codes back ([SWS_CM_00334]).
Provides the possibility to unregister a previously set ara::com::e2e:: TransportFaultConditionHandler for a given Proxy Event.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 91b2726516e3ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The function UnsetTransportFaultConditionHandler in namespace <SI-Namespace>::proxy::events::<Event> serves to deregister a previously registered ara::com::e2e::TransportFaultConditionHandler for a specific proxy event [SWS_CM_00105]. The function declaration is provided via the header file <SiNamespaceDerivedDirectoryPath>/<SiShortname>_proxy.hAUTOSAR_AP_SWS_CommunicationManagement §8.3.2.2.1.3 “UnsetTransportFaultConditionHandler”. The call takes no parameters and returns no value (void).
Error Handling and Exception Safety
The function is declared with identifier noexcept and specified as exception-safe (exception safe) [SWS_CM_00105]. Neither specific error codes nor notifications to error or diagnostic subsystems are defined in the standard.
Sequence and boundary conditions
The call is expected to be executed synchronously to immediately disable E2E error handling at the event level, for example when the event is no longer to be monitored or before the associated proxy object is released (interpretation). Question Q-ff00695fff5407fe (open) After execution, the communication layer no longer processes E2E transport errors via the previously registered callback of this event.
Interaction
Deregistering handlers for transport errors follows a uniform pattern across various communication elements:
For notifiers of fields at the proxy level, the function [SWS_CM_00126] is used.
For proxy triggers, the handler is deregistered via [SWS_CM_00108].
On the skeleton side, analogous interfaces are available for all methods of a service interface ([SWS_CM_00095]) as well as for getters/setters of fields ([SWS_CM_00098]).
This usage note was generated by an AI based on the AUTOSAR specification.
Method to unsubscribe from a service event. If the Event is not subscribed to at the time of the call, the method shall return without action.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: fb295b3ef414Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The method Unsubscribe() terminates the active subscription of a service event on the proxy side ([SWS_CM_00151], EXP_ARAComAPI §5.5). It is defined in scope <SI-Namespace>::proxy::events::<Event> and included via header file #include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_proxy.h" ([SWS_CM_00151]). The function takes no input parameters and returns no return value (void). If the event was not subscribed at the time of the call, the method returns without taking any action ([SWS_CM_00151]).
Error Handling and Exception Safety
The operation is declared with the identifier noexcept and specified as exception-safe ([SWS_CM_00151]). A DanglingSamplesViolation is provided as a violation if the precondition according to [SWS_CM_00085] was violated prior to the method call ([SWS_CM_00151]).
gemini-3.8-flash-low· 2026-10-13 · German original