SNIP_ADAPTIVE_STD_FIGURE_Figure_6_12
Wortlaut
Figure 6.12: Synchronous method call sample In a nutshell: A synchronous call (from the viewpoint of the application developer) to a service method, simply consists of the ()-operator call-syntax with a subsequent blocking get() call on the returned future. There are other ways for the user to get a notification from the Communication Management implementation as soon as the method result is available beside resuming execution from a blocking call to get(): • The variants of ‘wait’ , which the ara::com::Future has taken over from std::future. They basically provide the functionality of a blocking wait for the fulfillment of the future. • Registering a callback method via then(). This is one of the extensions to the std::future according to proposal N3857. The plain parameterless wait() variant has the same blocking semantics like get() — i.e. blocks till the future has a valid result (value or exception). The variants of ‘wait’, where you either give a duration ( wait_for()) or a target point in time (wait_until()) will return either if the future has a valid result or in case the timeout/deadline restriction has been met — therefore they both return FutureStatus to allow distinction between those cases. The last possibility to get notification of the result of the future (valid or exception) is by registering a callback method via then(). This is one of the extensions to the std::future according to proposal N3857, which is shown in the following example: 43 of 80 — AUTOSAR CONFIDENTIAL — Document ID 846: AUTOSAR_EXP_ARAComAPI
Versionen & Provenienz · Zugeordnete Anforderungen
Diese Angaben zeigt der Versions-Explorer.
Begründung & Zuweisungs-Evidenz
FutureStatus enumeration return type
Dokumenten-Herkunft & Rückverfolgbarkeit
| Spezifikations-Dokument | ARAComAPI.pdf |
|---|---|
| Dokumentseite | Seite 1 |
| Ziel-Modul | com (adaptive) |
| Ziel-Anforderung | SWS_CORE_00361 |
| Semantische Rolle | heuristic |
| Automatisierungs-Konfidenz | 0.80 |