रिटर्न वैल्यू के बिना एसिंक्रोनस ऑपरेशन के पूरा होने की प्रतीक्षा करने और एरर स्टेटस को पुनः प्राप्त करने में सक्षम बनाता है।
एआई-जनितअसत्यापितमॉडल: 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 के साथ इंटरैक्ट करती है, जो शेयर्ड स्टेट को पॉप्युलेट करता है [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] के माध्यम से एक इंस्टेंस किसी अन्य इंस्टेंस से शेयर्ड स्टेट का स्वामित्व प्राप्त करता है।
लाइफ़साइकल मुख्य रूप से शेयर्ड स्टेट की स्थिति से निर्धारित होता है। मेथड valid() के माध्यम से यह जांचा जा सकता है कि क्या इंस्टेंस किसी शेयर्ड स्टेट से जुड़ा है और इस प्रकार उपयोग योग्य है [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] थ्रेड-सेफ हैं, जबकि स्टेट-मॉडिफाइंग ऑपरेशंस जैसे 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() एक कंटिन्यूएशन फ़ंक्शन के पंजीकरण की अनुमति देती है, जो परिणाम उपलब्ध होते ही निष्पादित होता है [SWS_CORE_06231]। यहां वैकल्पिक रूप से एक निष्पादन संदर्भ (एग्ज़ीक्यूटर) पास किया जा सकता है [SWS_CORE_06237]। कंटिन्यूएशन Result<void, E> को Rvalue के रूप में स्वीकार करता है। then() का रिटर्न टाइप स्वचालित रूप से नेस्टेड Future या Result प्रकारों को अनपैक (Unwrapping) करता है [SWS_CORE_06231]।
यदि किसी अमान्य इंस्टेंस (valid() == false) पर स्थिति-निर्भर ऑपरेशन (जैसे GetResult(), is_ready(), wait(), wait_for(), wait_until() या then()) को कॉल किया जाता है, तो यह प्रीकंडीशन का उल्लंघन होता है, जिसे FutureInvalidViolation के रूप में माना जाता है [SWS_CORE_06228], [SWS_CORE_06229], [SWS_CORE_06230], [SWS_CORE_06231], [SWS_CORE_06232], [SWS_CORE_06236], [SWS_CORE_06237]। इसके बजाय अमान्य इंस्टेंस पर get() के कॉल पर, एरर कोड kNoState के साथ एक FutureException ट्रिगर किया जाता है [SWS_CORE_06226]; C++ अपवाद अक्षम होने पर get() ओवरलोड रिज़ॉल्यूशन में भाग नहीं लेता है [SWS_CORE_06226]।
यदि संबंधित Promise नष्ट हो गया है या उसने कोई परिणाम या स्पष्ट त्रुटि सेट किए बिना शेयर्ड स्टेट को छोड़ दिया है, तो त्रुटि कोड FutureErrc::kBrokenPromise[SWS_CORE_00400] के अनुसार शेयर्ड स्टेट में संग्रहीत किया जाता है [SWS_CORE_06226], [SWS_CORE_06236]। इसे GetResult() द्वारा Result<void, E> में त्रुटि के रूप में लौटाया जाता है [SWS_CORE_06236]। यदि then() में पंजीकृत कोई कंटिन्यूएशन ऐसा अपवाद उत्पन्न करता है जो उल्लंघन को लागू नहीं करता है, तो यह FutureContinuationHasThrownViolation[SWS_CORE_06231], [SWS_CORE_06237] की ओर ले जाता है।
यह गाइड पूरी तरह से रिलीज़ R25-11 में ara::core::Future<void, E> के AUTOSAR विनिर्देश पर आधारित है।
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 · जर्मन मूल
विशेषज्ञता ara::core::Future<void, E> का सदस्य फ़ंक्शन get बिना रिटर्न मान ([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])। यदि साझा स्थिति को समय से पहले छोड़ दिया गया था, तो [SWS_CORE_00400] के अनुसार त्रुटि कोड kBrokenPromise उत्पन्न होता है ([SWS_CORE_06226])। यदि get पहले से ही अमान्य इंस्टेंस पर निष्पादित किया जाता है, तो फ़ंक्शन त्रुटि कोड kNoState ([SWS_CORE_06226]) के साथ एक FutureException फेंकता है।
समवर्तीता के संबंध में, विधि थ्रेड-सुरक्षित नहीं है (not thread-safe) ([SWS_CORE_06226])। इसलिए एक ही ऑब्जेक्ट पर समानांतर एक्सेस के लिए बाहरी सिंक्रोनाइज़ेशन की आवश्यकता होती है। इसके अलावा, यदि कंपाइलर टूलचेन ([SWS_CORE_06226]) में C++ अपवाद अक्षम हैं, तो फ़ंक्शन ओवरलोड रिज़ॉल्यूशन में भाग नहीं लेता है।
संबंधित फ़ंक्शनों के संयोजन में, [SWS_CORE_00332] (is_ready) यह सुनिश्चित करता है कि यदि ऑपरेशन पहले ही पूरा हो चुका है, तो get के ब्लॉक न होने की गारंटी है। अपवादों के बिना संदर्भों के लिए, AUTOSAR एक विकल्प के रूप में [SWS_CORE_00336] (GetResult) प्रदान करता है, जो अपवाद फेंकने के बजाय परिणाम प्रकार के माध्यम से त्रुटियों की रिपोर्ट करता है।
यह पाठ एक AI द्वारा जनरेट किया गया था और यह मार्गदर्शन के रूप में कार्य करता है; आधिकारिक 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 एक ara::core::Future<void, E> इंस्टेंस [SWS_CORE_06231] पर एक अनुवर्ती ऑपरेशन (कंटिन्यूएशन func) पंजीकृत करती है। कॉल करने योग्य ऑब्जेक्ट प्रकार Result<void, E> के Rvalue अभिव्यक्ति के रूप में ऑपरेशन के परिणाम को स्वीकार करता है, जो आंतरिक रूप से GetResult[SWS_CORE_06231] के माध्यम से प्रदान किया जाता है। func का आह्वान then के संदर्भ में सिंक्रोनस रूप से या Promise::set_value(), Promise::SetError() के संदर्भ में या कहीं और एसिंक्रोनस रूप से हो सकता है [SWS_CORE_06231]।
then से लौटने के तुरंत बाद, मूल Future अमान्य (valid() == false) [SWS_CORE_06231] हो जाता है। रिटर्न प्रकार कंटिन्युएशन के रिटर्न प्रकार U के अनुसार अनुकूलित होता है:
यदि func एक Future<T2, E2> लौटाता है, तो अंतर्निहित अनपैकिंग होती है और thenFuture<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: तब घटित होता है जब कंटिन्युएशन कोई ऐसा अपवाद फेंकता है जो उल्लंघन को लागू नहीं करता है [SWS_CORE_06231]। इसके बजाय कंटिन्युएशन में त्रुटियों को Result या Future[SWS_CORE_06231] में पैक करके वापस किया जाना चाहिए।
समवर्तीता और परस्पर क्रिया
विधि थ्रेड-सुरक्षित नहीं है (not thread-safe) [SWS_CORE_06231]। लौटाए गए Future के डिस्ट्रक्टर से लौटने के बाद, कोई भी पंजीकृत कंटिन्युएशन निष्पादित नहीं की जाएगी; हालाँकि, पहले से चल रहा निष्पादन पूरा हो जाएगा, जिससे डिस्ट्रक्टर ब्लॉक हो सकता है [SWS_CORE_06231]। जबकि [SWS_CORE_06231]Future<void, E> पर लागू होता है, [SWS_CORE_00331] टाइप किए गए Futures Future<T, E> के वेरिएंट का वर्णन करता है और [SWS_CORE_06237] स्पष्ट निष्पादक (Executor) के साथ ओवरलोड का वर्णन करता है।
यह पाठ AUTOSAR विनिर्देश के आधार पर एक AI द्वारा तैयार किया गया था।
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 निर्दिष्ट निष्पादन संदर्भ executor[SWS_CORE_06237] में निष्पादन के लिए ara::core::Future<void, E> के एक इंस्टेंस पर एक कॉल करने योग्य कन्टीन्यूएशन ऑब्जेक्ट (Continuation) func पंजीकृत करता है। then की वापसी के तुरंत बाद, कॉलिंग Future इंस्टेंस अपनी वैधता खो देता है, जिससे कि valid() == false हो जाता है [SWS_CORE_06237]। कन्टीन्यूएशन को मूल Future इंस्टेंस का परिणाम Rvalue एक्सप्रेशन के रूप में Result<void, E> के रूप में पास किया जाता है [SWS_CORE_06237]। रिटर्न मान के रूप में, कॉल एक नया Future इंस्टेंस लौटाता है, जिसमें कन्टीन्यूएशन के Future<T2, E2> या Result<T2, E2> प्रकार के रिटर्न प्रकार अंतर्निहित रूप से Future<T2, E2> में अनपैक हो जाते हैं; अन्यथा एक Future<U, E> वापस कर दिया जाता है [SWS_CORE_06237]।
समवर्तीता (concurrency) और जीवनचक्र के संदर्भ में, फ़ंक्शन को गैर-थ्रेड-सुरक्षित (not thread-safe) के रूप में निर्दिष्ट किया गया है [SWS_CORE_06237]। निरंतरता (continuation) नए लौटाए गए Future में पंजीकृत की जाती है। इस नए Future के डिस्ट्रक्टर के वापस लौटने के बाद, कोई और निरंतरता निष्पादित नहीं की जानी चाहिए; हालाँकि, पहले से निष्पादन की स्थिति में मौजूद निरंतरता पूरी तरह से समाप्त होती है, जिसके कारण Future का डिस्ट्रक्टर ब्लॉक हो सकता है [SWS_CORE_06237]।
फ़ंक्शन किसी मानकीकृत त्रुटि कोड को घोषित नहीं करता है और इसे noexcept के रूप में परिभाषित किया गया है [SWS_CORE_06237]। यदि इसे किसी अमान्य Future इंस्टेंस पर कॉल किया जाता है, तो उल्लंघन FutureInvalidViolation मौजूद होता है [SWS_CORE_06237]। यदि निरंतरता कोई अपवाद (exception) उत्पन्न करती है, तो यह उल्लंघन FutureContinuationHasThrownViolation की ओर ले जाती है [SWS_CORE_06237]। अपवादों को निरंतरता से बाहर निकलने की अनुमति नहीं है, बल्कि आवश्यकता पड़ने पर उन्हें त्रुटि मानों में अनुवादित किया जाना चाहिए और Result या Future के भीतर लौटाया जाना चाहिए [SWS_CORE_06237]। यह फ़ंक्शन निष्पादक-रहित (executorless) संस्करण [SWS_CORE_06231] का पूरक है और मान-युक्त ओवरलोड [SWS_CORE_00331] तथा [SWS_CORE_00337] का समकक्ष बनाता है।
यह उपयोग नोट एक AI द्वारा तैयार किया गया था और यह 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]।
समवर्तीता (concurrency) और त्रुटि प्रबंधन के संदर्भ में, मेथड को noexcept के रूप में घोषित किया गया है, अपवाद-सुरक्षित (exception safe) है, और स्पष्ट रूप से थ्रेड-सुरक्षित (thread-safe) के रूप में निर्दिष्ट किया गया है [SWS_CORE_06227]। अतः इसे समवर्ती संदर्भों से सुरक्षित रूप से कॉल किया जा सकता है।
अन्य ऑपरेशनों के साथ संयोजन में, valid() जीवनचक्र (lifecycle) को सुरक्षित करने का कार्य करता है:
यदि किसी अमान्य Future ऑब्जेक्ट (valid() == false) पर wait()[SWS_CORE_06228] या is_ready()[SWS_CORE_00332] जैसा कोई ऑपरेशन कॉल किया जाता है, तो यह उल्लंघन FutureInvalidViolation को ट्रिगर करता है।
उपभोग करने वाले ऑपरेशन ऑब्जेक्ट को अमान्य कर देते हैं: get() को कॉल करने के बाद, Future अब मान्य नहीं रहता है, जिससे valid() के साथ बाद की जाँचों का परिणाम false होता है [SWS_CORE_06226]।
इसी प्रकार, then()[SWS_CORE_00331] के माध्यम से फ़ॉरवर्डिंग या GetResult()[SWS_CORE_00336] के कॉल के परिणामस्वरूप मूल Future ऑब्जेक्ट तत्काल अमान्य हो जाता है।
यह उपयोग नोट विनिर्देश के आधार पर एक AI द्वारा जनरेट किया गया था।
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 · जर्मन मूल
विशेषज्ञता ara::core::Future<void, E> का सदस्य फ़ंक्शन wait कॉलिंग थ्रेड को तब तक सिंक्रोनस रूप से ब्लॉक करता है जब तक कि एसिंक्रोनस ऑपरेशन का परिणाम मान या त्रुटि के रूप में उपलब्ध न हो जाए [SWS_CORE_06228]। फ़ंक्शन कोई पैरामीटर स्वीकार नहीं करता है, कोई रिटर्न मान (void) नहीं देता है, और विनिर्देश के अनुसार std::future[SWS_CORE_06228] के संबंधित फ़ंक्शन की तरह व्यवहार करता है।
त्रुटि प्रबंधन और सीमा शर्तों के संबंध में निम्नलिखित आवश्यकताएं लागू होती हैं:
अपवाद सुरक्षा और त्रुटि प्रबंधन: ऑपरेशन को noexcept के साथ घोषित किया गया है और अपवाद-सुरक्षित (exception safe) [SWS_CORE_06228] के रूप में निर्दिष्ट किया गया है। यदि Future इंस्टेंस false के लिए valid() रिटर्न देता है, तो उल्लंघन FutureInvalidViolation मौजूद है [SWS_CORE_06228]। इस उल्लंघन का ठोस परिणाम AUTOSAR रनटाइम परिवेश के सिस्टम-विशिष्ट त्रुटि प्रबंधन के रूप में कार्यान्वित होना चाहिए। प्रश्न Q-469e9abc947b9869 (खुला)
समवर्तीता: फ़ंक्शन को थ्रेड-सुरक्षित नहीं (not thread-safe) [SWS_CORE_06228] के रूप में वर्गीकृत किया गया है। इसलिए बाहरी सिंक्रोनाइज़ेशन के बिना एक ही Future ऑब्जेक्ट पर समवर्ती एक्सेस अस्वीकार्य है।
मॉड्यूल core के अन्य फ़ंक्शनों के संयोजन में निम्नलिखित संभावनाएं मौजूद हैं:
थ्रेड-सुरक्षित विधि is_ready के साथ, यह पहले से पूछा जा सकता है कि क्या ऑपरेशन पूरा हो गया है; true लौटाए जाने पर, wait अब ब्लॉक न होने की गारंटी देता है [SWS_CORE_06232]।
अंतहीन ब्लॉकिंग से बचने के लिए, सापेक्ष अवधि [SWS_CORE_06229] के साथ समय-सीमित फ़ंक्शन wait_for और साथ ही पूर्ण समय बिंदु [SWS_CORE_06230] के साथ wait_until उपलब्ध हैं।
प्राथमिक टेम्पलेट वर्ग ara::core::Future के लिए समान सिंक्रोनस प्रतीक्षा आवश्यकताएं और प्रतिबंध [SWS_CORE_00328] लागू होते हैं।
यह पाठ एक AI सिस्टम द्वारा क्यूरेट किया गया था और विशेष रूप से 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 · जर्मन मूल
विशेषज्ञता ara::core::Future<void, E> की विधि wait_for कॉलिंग थ्रेड को अधिकतम समय अवधि 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 · जर्मन मूल
विशेषज्ञता ara::core::Future<void, E> का सदस्य फ़ंक्शन wait_until कॉलिंग थ्रेड को तब तक ब्लॉक करता है जब तक कि निर्दिष्ट पूर्ण समय बिंदु 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 · जर्मन मूल