يتيح الانتظار حتى اكتمال عملية غير متزامنة بدون قيمة معادة، بالإضافة إلى استخراج حالة الخطأ.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: e943c154e07eالمصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
يتيح الانتظار حتى اكتمال عملية غير متزامنة بدون قيمة معادة، بالإضافة إلى استخراج حالة الخطأ.
تتيح الفئة ara::core::Future<void, E> المزامنة غير المتزامنة والتحقق من الأخطاء للعمليات التي لا تتضمن قيمة معادة في AUTOSAR Adaptive [SWS_CORE_06236]. وباعتبارها نوعًا غير قابل للنسخ، فإنها تتيح الانتظار حتى الاكتمال، بالإضافة إلى استرداد النتيجة الآمن ضد الاستثناءات كـ ara::core::Result<void, E>[SWS_CORE_06236] أو مواصلة المعالجة غير المتزامنة عبر دالة استمرار [SWS_CORE_06231]. بعد استخراج النتيجة، يتم إبطال الحالة المشتركة، بحيث تشكل الاستدعاءات اللاحقة دون حالة صالحة انتهاكًا [SWS_CORE_06236].
السياق
يمثل تخصيص فئة القالب ara::core::Future<void, E> طرف الاستقبال لعملية غير متزامنة في AUTOSAR Adaptive، والتي لا تعيد قيمة عند الاكتمال الناجح، بل تشير فقط إلى وقوع الحدث أو حدوث خطأ. ووفقًا لوصف الفئة، يجب على التنفيذ إنهاء الشرط E != ara::core::ErrorCode بخطأ ترجمة. تتفاعل الفئة عادةً مع ara::core::Promise مطابق يملأ الحالة المشتركة (Shared State) [SWS_CORE_06236]، وكذلك مع سياقات تنفيذ غير متزامنة عند تسجيل دوال الاستمرار [SWS_CORE_06237].
دورة الحياة
مثيلات ara::core::Future<void, E> هي كائنات ذات دلالات نقل بحتة: حيث تم حذف منشئ النسخ [SWS_CORE_06234] وعامل تشغيل التعيين بالنسخ [SWS_CORE_06235] (delete). والكائن الذي يتم إنشاؤه عبر المنشئ الافتراضي لا يمتلك حالة مشتركة ويتصرف بشكل مماثل لـ std::future[SWS_CORE_06222]. ومن خلال الإنشاء بالنقل [SWS_CORE_06223] أو التعيين بالنقل [SWS_CORE_06225]، يتولى مثيل ما ملكية Shared State من مثيل آخر.
تتشكل دورة الحياة بشكل أساسي من خلال وضع Shared State. وعبر الطريقة valid()، يمكن التحقق مما إذا كان المثيل مرتبطًا بـ Shared State وبالتالي قابلاً للاستخدام [SWS_CORE_06227]. وبمجرد استرداد النتيجة بواسطة GetResult()[SWS_CORE_06236] أو get()[SWS_CORE_06226] أو تسجيل استمرار عبر then()[SWS_CORE_06231]، يفقد كائن Future حالته المشتركة ويعيد valid() القيمة false. ويحرر المدمر أي حالة مشتركة متبقية [SWS_CORE_06233]. وفيما يتعلق بالتزامن، فإن عمليات الفحص والتدمير مثل valid()[SWS_CORE_06227] وis_ready()[SWS_CORE_06232] والمدمر [SWS_CORE_06233] آمنة بالنسبة للخيوط (thread-safe)، في حين أن العمليات المعدلة للحالة مثل GetResult()[SWS_CORE_06236] وget()[SWS_CORE_06226] ودوال الانتظار [SWS_CORE_06228] ليست آمنة بالنسبة للخيوط.
في مسار الاستخدام المتزامن، ينتظر المستهلك اكتمال العملية غير المتزامنة. وباستخدام is_ready()، يمكن الاستعلام بحد أدنى من الحظر عما إذا كانت هناك قيمة أو خطأ [SWS_CORE_06232]. وبدلاً من ذلك، يمكن الانتظار بشكل حظري بواسطة wait()[SWS_CORE_06228]، أو لفترة زمنية محددة عبر wait_for()[SWS_CORE_06229] وwait_until()[SWS_CORE_06230]. وإذا كانت النتيجة متاحة، يتم الاستعلام عن القيمة ويفضل أن يكون ذلك بأسلوب آمن ضد الاستثناءات عبر GetResult()، وبذلك يُعاد ara::core::Result<void, E>[SWS_CORE_06236].
في المسار غير المتزامن، تتيح الطريقة then() تسجيل دالة استمرار (Continuation) يتم تنفيذها بمجرد توفر النتيجة [SWS_CORE_06231]. وهنا يمكن اختياريًا تمرير سياق تنفيذ (Executor) [SWS_CORE_06237]. وتستقبل دالة الاستمرار Result<void, E> كـ Rvalue. يقوم نوع الإرجاع لـ then() بفك أنواع Future أو Result المتداخلة تلقائيًا (Unwrapping) [SWS_CORE_06231].
إذا تم تدمير الـ Promise المقابل أو غادر الحالة المشتركة دون تعيين نتيجة أو خطأ صريح، يتم إيداع رمز الخطأ FutureErrc::kBrokenPromise وفقًا لـ [SWS_CORE_00400] في Shared State [SWS_CORE_06226]، [SWS_CORE_06236]. ويتم إرجاع هذا الرمز بواسطة GetResult() كخطأ في Result<void, E>[SWS_CORE_06236]. وإذا أطلقت دالة استمرار مسجلة في then() استثناءً لا ينفذ انتهاكًا، فإن هذا يؤدي إلى FutureContinuationHasThrownViolation[SWS_CORE_06231]، [SWS_CORE_06237].
يستند هذا الدليل حصريًا إلى مواصفة AUTOSAR لـ <ara::core::Future<void, E في الإصدار R25-11.
Returns nothing. This function shall behave the same as the corresponding std::future function. Part of the behavior taken from the std::future is that after a call to this function the Future is not valid anymore (valid() == false). ≙ std::future
Get the result. Similar to Future::get(), this call blocks until the value or an error is available. However, this call will never throw an exception. Part of the behavior taken from Future::get() is that after a call to this function the Future is not valid anymore (valid() == false).
Return whether the asynchronous operation has finished. If this function returns true, get(), Get Result() and the wait calls are guaranteed not to block.
Create a new Future with the content returned by func when passed the Result of this Future. func may be called in the context of this call or in the context of Promise::set_value() or Promise::SetError() or somewhere else. valid() == false on the original future object immediately after it returns. The Callable input argument "func" takes a Result<void,E> object as parameter. This will be the Result obtained via GetResult from the Future instance itself, on which .then() is being called. The Result is passed to func as an rvalue expression. The return type of then depends on the return type of func (aka continuation). Let U be the return type of the continuation (i.e. a type equivalent to std::invoke_result_ t<std::decay_t<F>,Result<void,E>>). • If U is Future<T2,E2> for some types T2, E2, then the return type of then() is Future<T2,E2>. This is known as implicit Future unwrapping. • If U is Result<T2,E2> for some types T2, E2, then the return type of then() is Future<T2,E2>. This is known as implicit Result unwrapping. • Otherwise it is Future<U,E>. Continuations that are registered with Future::then() are registered in the Future F that Future::then() returns. No such continuation shall be executed after the destructor of the Future F returns. A continuation that is already being executed shall run to completion. Note: that means that the destructor of Future might block until the currently running continuation has been completed. The continuation shall not throw, except for the purpose of implementing a Violation. Note: Exceptions can be used within the continuation, however if they do not realize a Violation, they must not escape the continuation. Note: Users who need to propagate information from closures’ exceptions should translate them to an error and return an ara::core::Result or ara::core::Future from the continuation with the error stored in it. ≙ std::invoke_result_
التحميلات الزائدةthen2
template <typename F> auto then (F &&func) noexcept -> Future< <see below> >;SWS_CORE_06231
template <typename F, typename ExecutorT> auto then (F &&func, ExecutorT &&executor) noexcept -> Future< <see below> >;SWS_CORE_06237
Wait for the given period, or until a value or an error is available. This function shall behave the same as the corresponding std::future function ≙ std::future
Wait until the given time, or until a value or an error is available. This function shall behave the same as the corresponding std::future function. ≙ std::future
Get the result. Similar to Future::get(), this call blocks until the value or an error is available. However, this call will never throw an exception. Part of the behavior taken from Future::get() is that after a call to this function the Future is not valid anymore (valid() == false).
a Result as std::move(result from the shared state) with either a value or an error that has been put into the corresponding Promise. This can be because either: • explicit setting of the Error via Promise::SetError / Promise::Set Result or • the Promise was broken, meaning the shared state was abandoned by the corresponding Promise. Then the error is kBrokenPromise as defined in [SWS_CORE_00400]
Returns nothing. This function shall behave the same as the corresponding std::future function. Part of the behavior taken from the std::future is that after a call to this function the Future is not valid anymore (valid() == false).
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 195e9e272b48المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تُستخدم الدالة العضو get للتخصيص ara::core::Future<void, E> للانتظار حتى تتوفر نتيجة عملية غير متزامنة بدون قيمة إرجاع ([SWS_CORE_06226]). وهي تتصرف مثل الدالة المقابلة لـ std::future وتحجب المتصل حتى تتوفر النتيجة أو يحدث خطأ ([SWS_CORE_06226]، [SWS_CORE_00336]). بعد الاستدعاء تفقد كينونة Future صلاحيتها، بحيث ينطبق valid() == false ([SWS_CORE_06226]).
تم التصريح عن الدالة بأنها غير آمنة من حيث الاستثناءات (not exception safe) ([SWS_CORE_06226]). إذا تم إيداع خطأ في Promise المرتبط، فسيتم إطلاق استثناء مطابق ([SWS_CORE_06226]). وإذا تم التخلي عن الحالة المشتركة قبل الأوان، فسيحدث رمز الخطأ kBrokenPromise وفقاً لـ [SWS_CORE_00400] ([SWS_CORE_06226]). إذا تم تنفيذ get على كينونة غير صالحة بالفعل، فستطلق الدالة FutureException مع رمز الخطأ kNoState ([SWS_CORE_06226]).
فيما يتعلق بالتزامن، فإن الطريقة غير آمنة للخيوط (not thread-safe) ([SWS_CORE_06226]). ولذلك تتطلب عمليات الوصول المتوازية إلى نفس الكائن مزامنة خارجية. بالإضافة إلى ذلك، لا تشارك الدالة في حل التحميل الزائد إذا تم تعطيل استثناءات ++C في سلسلة أدوات المترجم ([SWS_CORE_06226]).
في إطار التفاعل مع الدوال المرتبطة، يضمن [SWS_CORE_00332] (is_ready) أن get لن يحجب بالتأكيد إذا كانت العملية قد اكتملت بالفعل. بالنسبة للسياقات الخالية من الاستثناءات، يقدم AUTOSAR البديل [SWS_CORE_00336] (GetResult)، والذي يُبلغ عن الأخطاء عبر نوع النتيجة بدلاً من إطلاق الاستثناءات.
تم إنشاء هذا النص بواسطة ذكاء اصطناعي وهو بمثابة دليل توجيهي؛ وتعد مواصفة AUTOSAR هي المرجع الإلزامي.
Any exception of the type associated with the error that has been put into the corresponding Promise. This can be because either: • explicit setting of the Error via: Promise::SetError(E&&) Promise::SetError(const E&) / Promise::SetResult(const Result<T, E>&) Promise::SetResult(Result <T, E>&&) • the Promise was broken, meaning the shared state was abandoned by the corresponding Promise. Then the error is kBrokenPromise as defined in [SWS_CORE_00400]. FutureException in case the Future is invalid. The contained ErrorCode is kNoState
Hinweise: This function shall not participate in overload resolution when C++ exceptions are disabled in the compiler toolchain
Request a governed re-review of this record. The record is not changed immediately.
Return whether the asynchronous operation has finished. If this function returns true, get(), Get Result() and the wait calls are guaranteed not to block.
template <typename F> auto then (F &&func) noexcept -> Future< <see below> >;
Create a new Future with the content returned by func when passed the Result of this Future. func may be called in the context of this call or in the context of Promise::set_value() or Promise::SetError() or somewhere else. valid() == false on the original future object immediately after it returns. The Callable input argument "func" takes a Result<void,E> object as parameter. This will be the Result obtained via GetResult from the Future instance itself, on which .then() is being called. The Result is passed to func as an rvalue expression. The return type of then depends on the return type of func (aka continuation). Let U be the return type of the continuation (i.e. a type equivalent to std::invoke_result_ t<std::decay_t<F>,Result<void,E>>). • If U is Future<T2,E2> for some types T2, E2, then the return type of then() is Future<T2,E2>. This is known as implicit Future unwrapping. • If U is Result<T2,E2> for some types T2, E2, then the return type of then() is Future<T2,E2>. This is known as implicit Result unwrapping. • Otherwise it is Future<U,E>. Continuations that are registered with Future::then() are registered in the Future F that Future::then() returns. No such continuation shall be executed after the destructor of the Future F returns. A continuation that is already being executed shall run to completion. Note: that means that the destructor of Future might block until the currently running continuation has been completed. The continuation shall not throw, except for the purpose of implementing a Violation. Note: Exceptions can be used within the continuation, however if they do not realize a Violation, they must not escape the continuation. Note: Users who need to propagate information from closures’ exceptions should translate them to an error and return an ara::core::Result or ara::core::Future from the continuation with the error stored in it.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 161f9bad96abالمصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
الاستخدام
تسجل الطريقة then عملية تابعة (Continuation func) في كينونة ara::core::Future<void, E>[SWS_CORE_06231]. يستقبل الكائن القابل للاستدعاء نتيجة العملية كتعبير Rvalue من النوع Result<void, E>، والذي يتم توفيره داخلياً عبر GetResult[SWS_CORE_06231]. يمكن أن يتم استدعاء func بشكل متزامن في سياق then أو بشكل غير متزامن في سياق Promise::set_value() أو Promise::SetError() أو في موضع آخر [SWS_CORE_06231].
مباشرة بعد العودة من then، يصبح Future الأصلي غير صالح (valid() == false) [SWS_CORE_06231]. ويتكيف نوع الإرجاع مع نوع الإرجاع U الخاص بـ Continuation:
إذا أرجع func القيمة Future<T2, E2>، يحدث تفريغ ضمني ويُرجع then القيمة Future<T2, E2>[SWS_CORE_06231].
إذا أرجع func القيمة Result<T2, E2>، فسيتم تفريغها ضمنياً أيضاً إلى Future<T2, E2>[SWS_CORE_06231].
في جميع الحالات الأخرى، يكون نوع الإرجاع Future<U, E>[SWS_CORE_06231].
معالجة الأخطاء والشروط الحدية
لم يتم تحديد رموز خطأ قياسية لهذه الدالة [SWS_CORE_06231]. تم التصريح عن الطريقة بأنها noexcept، ولكنها تحدد انتهاكين (Violations):
FutureInvalidViolation: يحدث عند استدعاء الطريقة على Future غير صالح (إذا أرجع valid() القيمة false) [SWS_CORE_06231].
FutureContinuationHasThrownViolation: يحدث إذا أطلقت Continuation استثناءً لا يحقق Violation [SWS_CORE_06231]. ويجب بدلاً من ذلك إرجاع الأخطاء في Continuation مغلفة في Result أو Future[SWS_CORE_06231].
التزامن والتفاعل
الطريقة ليست آمنة للخيوط (not thread-safe) [SWS_CORE_06231]. بعد عودة مدمر كائن Future المرجع، لن يتم تنفيذ أي Continuation مسجلة؛ ومع ذلك، سيتم إكمال أي تنفيذ قيد التشغيل بالفعل، مما قد يتسبب في حجب المدمر [SWS_CORE_06231]. وبينما ينطبق [SWS_CORE_06231] على Future<void, E>، يصف [SWS_CORE_00331] المتغير الخاص بكائنات Future ذات النوع المحدد Future<T, E> و[SWS_CORE_06237] التحميل الزائد باستخدام Executor صريح.
تم إنشاء هذا النص بواسطة ذكاء اصطناعي بناءً على مواصفات AUTOSAR.
FutureInvalidVio- If the Future is invalid (valid returns false) lation FutureContinua- If the continuation throws an exception tionHasThrownVio- lation
template <typename F, typename ExecutorT> auto then (F &&func, ExecutorT &&executor) noexcept -> Future< <see below> >;
Create a new Future with the content returned by func when passed the Result of this Future. func is called in the context of the provided execution context executor. valid() == false on the original future object immediately after it returns. The Callable input argument "func" takes a Result<void,E> object as parameter. This will be the Result obtained via GetResult from the Future instance itself, on which .then() is being called. The Result is passed to func as an rvalue expression. The return type of then depends on the return type of func (aka continuation). Let U be the return type of the continuation (i.e. a type equivalent to std::invoke_result_ t<std::decay_t<F>,Result<void,E>>). • If U is Future<T2,E2> for some types T2, E2, then the return type of then() is Future<T2,E2>. This is known as implicit Future unwrapping. • If U is Result<T2,E2> for some types T2, E2, then the return type of then() is Future<T2,E2>. This is known as implicit Result unwrapping. • Otherwise it is Future<U,E>. Continuations that are registered with Future::then() are registered in the Future F that Future::then() returns. No such continuation shall be executed after the destructor of the Future F returns. A continuation that is already being executed shall run to completion. Note: that means that the destructor of Future might block until the currently running continuation has been completed. The continuation shall not throw, except for the purpose of implementing a Violation. Note: Exceptions can be used within the continuation, however if they do not realize a Violation, they must not escape the continuation. Note: Users who need to propagate information from closures’ exceptions should translate them to an error and return an ara::core::Result or ara::core::Future from the continuation with the error stored in it.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 96d3b0e93b60المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تسجل الدالة then كائن متابعة قابل للاستدعاء (Continuation) func على نسخة من ara::core::Future<void, E> للتنفيذ في سياق التنفيذ المحدد executor[SWS_CORE_06237]. وتفقد نسخة Future المستدعية صلاحيتها فور إرجاع then، بحيث يكون valid() == false[SWS_CORE_06237]. وتتلقى المتابعة نتيجة نسخة Future الأصلية كـ Result<void, E> ممررة في شكل تعبير rvalue [SWS_CORE_06237]. ويُرجع الاستدعاء كقيمة إرجاع نسخة جديدة من Future، حيث يتم فك أنواع إرجاع المتابعة من النوع Future<T2, E2> أو Result<T2, E2> ضمنيًا إلى Future<T2, E2>؛ وإلا فإنه يتم إرجاع Future<U, E>[SWS_CORE_06237].
فيما يتعلق بالتزامن ودورة الحياة، حُددت الدالة على أنها غير آمنة خيطيًا (not thread-safe) [SWS_CORE_06237]. وتُسجل المتابعة في الـ Future الجديد المُرجع. وبعد عودة مدمر هذا الـ Future الجديد، لا يجوز تنفيذ أي متابعة بعد ذلك؛ ومع ذلك، فإن أي متابعة قيد التنفيذ بالفعل تكتمل حتى نهايتها تمامًا، ولهذا السبب قد يحجب مدمر الـ Future التنفيذ [SWS_CORE_06237].
لا تُعلن الدالة عن أي رموز خطأ قياسية وهي مُعرفة كـ noexcept[SWS_CORE_06237]. وإذا استُدعيت على نسخة Future غير صالحة، فإن ذلك يمثل الانتهاك FutureInvalidViolation[SWS_CORE_06237]. وإذا طرحت المتابعة استثناءً، فإن هذا يؤدي إلى الانتهاك FutureContinuationHasThrownViolation[SWS_CORE_06237]. ويجب ألا تغادر الاستثناءات المتابعة، بل يلزم عند الحاجة ترجمتها إلى قيم أخطاء وإرجاعها ضمن Result أو Future[SWS_CORE_06237]. وتُكمل الدالة المتغير الخالي من المُنفِّذ [SWS_CORE_06231] وتشكل النظير للتحميلات الزائدة ذات القيم [SWS_CORE_00331] وكذلك [SWS_CORE_00337].
تم إنشاء إشعار الاستخدام هذا بواسطة ذكاء اصطناعي ويستند إلى مواصفة AUTOSAR R25-11.
FutureInvalidVio- If the Future is invalid (valid returns false) lation FutureContinua- If the continuation throws an exception. tionHasThrownVio- lation
Template-Parameter
Parameter
Beschreibung
FExecutorT
the type of the func argument the type of the executor argument
Parameter (in)
Parameter
Beschreibung
func
a callable to register
executor
the execution context in which to execute the Callable func
Checks if the Future is valid, i.e. if it has a shared state.
This function shall behave the same as the corresponding std::future function.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 480112e5c811المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تتحقق الدالة valid() بشكل متزامن مما إذا كانت نسخة ara::core::Future<void, E> تمتلك حالة مشتركة (Shared State) وبالتالي تكون قابلة للاستخدام [SWS_CORE_06227]. وتتصرف وفقاً للمواصفة بشكل مماثل للدالة المقابلة من std::future[SWS_CORE_06227]. وكقيمة معادة، تُرجع true إذا كان الـ Future قابلاً للاستخدام، وfalse إذا كان غير قابل للاستخدام [SWS_CORE_06227].
فيما يتعلق بالتزامن ومعالجة الأخطاء، تم التصريح عن الأسلوب بـ noexcept، وتحديده كآمن للاستثناءات (exception safe) وبشكل صريح كآمن بالنسبة للخيوط (thread-safe) [SWS_CORE_06227]. وبالتالي يمكن استدعاؤه بأمان من سياقات متزامنة.
في إطار التفاعل مع عمليات أخرى، يُستخدم valid() لتأمين دورة الحياة:
إذا تم استدعاء عملية مثل wait()[SWS_CORE_06228] أو is_ready()[SWS_CORE_00332] على كائن Future غير صالح (valid() == false)، فإن ذلك يؤدي إلى إطلاق الانتهاك FutureInvalidViolation.
تُبطل العمليات المستهلكة صلاحية الكائن: بعد استدعاء get() لا يعود الـ Future صالحاً، بحيث تسفر عمليات الفحص اللاحقة باستخدام valid() عن القيمة false[SWS_CORE_06226].
وكذلك تؤدي عمليات إعادة التوجيه عبر then()[SWS_CORE_00331] أو استدعاءات GetResult()[SWS_CORE_00336] إلى إبطال صلاحية كائن الـ Future الأصلي على الفور.
تم إنشاء ملاحظة الاستخدام هذه بواسطة ذكاء اصطناعي بناءً على المواصفة.
Wait for a value or an error to be available. This function shall behave the same as the corresponding std::future function
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 2f9ee5ecd1d4المصدرأسئلة مفتوحة (1)
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تحجب الدالة العضو wait للتخصيص ara::core::Future<void, E> خيط التنفيذ المستدعي بشكل متزامن حتى تتاح نتيجة العملية غير المتزامنة في شكل قيمة أو خطأ [SWS_CORE_06228]. لا تأخذ الدالة أي معلمات، ولا تُرجع أي قيمة (void)، وتتصرف وفقاً للمواصفة مثل الدالة المقابلة لـ std::future[SWS_CORE_06228].
فيما يتعلق بمعالجة الأخطاء والقيود، تنطبق المتطلبات التالية:
أمان الاستثناءات ومعالجة الأخطاء: تم التصريح عن العملية باستخدام noexcept وتحديدها على أنها آمنة من حيث الاستثناءات (exception safe) [SWS_CORE_06228]. إذا أرجع valid() لكينونة Future القيمة false، فهذا يعني وقوع الانتهاك FutureInvalidViolation[SWS_CORE_06228]. ويُرجح أن تكون النتيجة الملموسة لهذا الانتهاك محققة كمعالجة أخطاء خاصة بالنظام في بيئة تشغيل AUTOSAR. سؤال Q-469e9abc947b9869 (مفتوح)
التزامن: صُنفت الدالة على أنها غير آمنة للخيوط (not thread-safe) [SWS_CORE_06228]. وبالتالي، فإن الوصول المتزامن إلى نفس كائن Future بدون مزامنة خارجية غير مسموح به.
في إطار التفاعل مع الدوال الأخرى للوحدة core، تتوفر الإمكانيات التالية:
باستخدام الطريقة الآمنة للخيوط is_ready، يمكن الاستعلام مسبقاً عما إذا كانت العملية قد اكتملت؛ وعند إرجاع true، يُضمن ألا يحجب wait مجدداً [SWS_CORE_06232].
لتجنب الحجب اللانهائي، تتوفر الدوال محددة الوقت wait_for بمدة نسبية [SWS_CORE_06229] وكذلك wait_until بنقطة زمنية مطلقة [SWS_CORE_06230].
بالنسبة لفئة القالب الأساسية ara::core::Future، تنطبق نفس متطلبات الانتظار المتزامن والقيود [SWS_CORE_00328].
تم تنسيق هذا النص بواسطة نظام ذكاء اصطناعي ويعتمد حصرياً على مواصفة AUTOSAR.
Wait for the given period, or until a value or an error is available. This function shall behave the same as the corresponding std::future function
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 927a98d78cf3المصدرأسئلة مفتوحة (1)
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تحجب الدالة wait_for للتخصيص ara::core::Future<void, E> خيط التنفيذ المتصل تزامنيًا لفترة زمنية قصوى timeoutDuration أو حتى تصبح النتيجة جاهزة [SWS_CORE_06229]. وتتصرف دلاليًا مثل الدالة القياسية المقابلة std::future::wait_for[SWS_CORE_06229].
تُرجع الدالة كقيمة إرجاع الحالة FutureStatus[SWS_CORE_06229]. وتشير هذه الحالة بواسطة FutureStatus::kReady إلى توفر قيمة أو خطأ، أو بواسطة FutureStatus::kTimeout إلى انقضاء المهلة الزمنية دون نتيجة [SWS_CORE_00361]. ولا توجد حالة مكافئة لـ std::future_status::deferred[SWS_CORE_00361]. ويتطابق هذا السلوك مع واجهة Future العامة [SWS_CORE_00329].
تنطبق الشروط التالية على الاستدعاء فيما يتعلق بالتزامن ومعالجة الأخطاء:
التزامن: حُددت الدالة على أنها غير آمنة خيطيًا (not thread-safe) [SWS_CORE_06229]. ويجب تأمين الاستدعاءات المتزامنة على النسخة نفسها من جهة المتصل.
حالات الخطأ وأمان الاستثناءات: أُعلنت العملية على أنها آمنة من حيث الاستثناءات (exception safe) وكذلك noexcept[SWS_CORE_06229]. وإذا كان كائن Future غير صالح (يُرجع valid()false)، فإن ذلك يمثل انتهاكًا FutureInvalidViolation[SWS_CORE_06229]. وبسبب الإعلان noexcept، فمن المرجح أن يؤدي هذا الانتهاك إلى إنهاء البرنامج فورًا. سؤال Q-4f01aa6e7fbfb12d (مفتوح)
تم إنشاء إشعار الاستخدام هذا آليًا استنادًا إلى مواصفة AUTOSAR Adaptive R25-11.
Wait until the given time, or until a value or an error is available. This function shall behave the same as the corresponding std::future function.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 932b0d674f17المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تحجب دالة العضو wait_until للتخصيص ara::core::Future<void, E> خيط الاستدعاء حتى الوصول إلى النقطة الزمنية المطلقة المحددة deadline أو حتى تتوفر قيمة أو خطأ [SWS_CORE_06230]. وتُظهر الدالة السلوك نفسه لدالة معيار C++ المقابلة std::future::wait_until[SWS_CORE_06230] وتمتلك الدلالة نفسها للتحميل الزائد العام لـ ara::core::Future[SWS_CORE_00330].
تشير قيمة الإرجاع من النوع FutureStatus إلى ما إذا كان قد تم الوصول إلى المهلة الزمنية أو تتوفر قيمة [SWS_CORE_06230]. وهنا تُظهر الحالة kReady أن الحالة المشتركة جاهزة، بينما تعني kTimeout أن الحالة المشتركة لم تصبح جاهزة قبل انقضاء المهلة [SWS_CORE_00361]. ولا توجد حالة مماثلة لـ std::future_status::deferred في FutureStatus[SWS_CORE_00361].
فيما يتعلق بالتنفيذ والشروط الحدية، حُددت المتطلبات التالية:
سياق الاستدعاء وسلوك الاستثناء: تتوفر الدالة عبر ملف الترويسة #include "ara/core/future.h"، ومُعلنة كـ noexcept، ومحددة كآمنة من حيث الاستثناءات (exception safe) [SWS_CORE_06230].
حالات الخطأ: إذا كان الـ Future غير صالح، أي عندما يُرجع valid() القيمة false، فإن ذلك يمثل الانتهاك FutureInvalidViolation[SWS_CORE_06230].
التزامن: صُنفت العملية على أنها غير آمنة خيطيًا (not thread-safe) [SWS_CORE_06230].
تم إنشاء إشعار الاستخدام هذا آليًا استنادًا إلى مواصفة AUTOSAR Adaptive R25-11.
gemini-3.8-flash-low· 2026-10-13 · الأصل الألماني