연결된 Future 객체에 void 결과 또는 오류를 비동기적으로 제공할 수 있도록 합니다.
AI 생성미검증모델: gemini-3.8-flash-medium · 노력: medium · 온도: 제어 불가 · 프롬프트: 5c77833bef95출처열린 질문 (1)
독일어 가이드에서 번역됨gemini-3.8-flash-low · 2026-10-13 · 독일어 원문
연결된 Future 객체에 void 결과 또는 오류를 비동기적으로 제공할 수 있도록 합니다.
특수화 ara::core::Promise< void, E >은 반환값이 없는 작업의 완료를 신호하거나 오류([SWS_CORE_06341])를 전송하기 위한 비동기 생산자 엔드포인트 역할을 합니다. 인스턴스화 후에는 get_future()를 통해 소비자를 위한 관련 Future을 정확히 한 번 가져옵니다([SWS_CORE_06344]). 제공은 set_value(), SetError() 또는 SetResult()을 통해 스레드 안전하게 수행되며, 이를 통해 공유 상태가 준비됨(ready)으로 표시됩니다. 클래스가 순수 이동 시맨틱을 가지므로, 여러 번 설정하거나 공유 상태가 누락되면 명시된 위반이 발생합니다.
컨텍스트
클래스 ara::core::Promise< void, E >은 페이로드 값이 없는 비동기 흐름(반환 타입 void)을 위한 템플릿 특수화를 나타냅니다. 이는 통신 채널의 생산자(Producer) 측을 형성하며 비동기 계산 또는 작업을 소비자(Consumer) 측과 동기화합니다. 공유된 내부 상태(Shared State)를 통해 작업의 성공적인 실행 또는 E 타입 오류의 발생을 신호할 수 있습니다. 상응하는 수신자 객체는 ara::core::Future< void, E >의 형태로 제공됩니다([SWS_CORE_06344]). AUTOSAR Adaptive Platform의 요구사항에 따라 구현 시 오류 타입 E이 ara::core::ErrorCode과 호환되어야 하며, 불일치가 있을 경우 컴파일 오류가 발생합니다.
수명 주기
인스턴스 생성은 매개변수가 없는 기본 생성자 [SWS_CORE_06341]을 통해 이루어지며, 이는 새로운 공유 상태를 생성하고 C++ 표준 함수 std::promise과 유사하게 동작합니다. 이 클래스는 독점 소유권을 모델링하고 엄격한 이동 시맨틱을 구현합니다. 복사 생성자([SWS_CORE_06350])와 복사 할당 연산자([SWS_CORE_06351])는 모두 삭제되었습니다(delete).
Return an associated Future with the same shared state as *this The returned Future is set as soon as this Promise receives the result, value, or an error. This fuction must only be called once as it is not allowed to have multiple Futures per Promise.
IsoStdFutureEr- If the shared state already has a stored value or error. rcPromiseAl- readySatisfiedVio- lation PromiseNoShared- If *this has no shared state. StateToSetViola- tion
Parameter (in)
Parameter
Beschreibung
error
the error to store
Rückgabewert
Typ
Beschreibung
None
Request a governed re-review of this record. The record is not changed immediately.
IsoStdFutureEr- If the shared state already has a stored value or error. rcPromiseAl- readySatisfiedVio- lation PromiseNoShared- If *this has no shared state. StateToSetViola- tion
Parameter (in)
Parameter
Beschreibung
error
the error to store
Rückgabewert
Typ
Beschreibung
None
Request a governed re-review of this record. The record is not changed immediately.
IsoStdFutureEr- If the shared state already has a stored value or error. rcPromiseAl- readySatisfiedVio- lation PromiseNoShared- If *this has no shared state. StateToSetViola- tion
Parameter (in)
Parameter
Beschreibung
result
the result to store
Rückgabewert
Typ
Beschreibung
None
Request a governed re-review of this record. The record is not changed immediately.
IsoStdFutureEr- If the shared state already has a stored value or error. rcPromiseAl- readySatisfiedVio- lation PromiseNoShared- If *this has no shared state. StateToSetViola- tion
Parameter (in)
Parameter
Beschreibung
result
the result to store
Rückgabewert
Typ
Beschreibung
None
Request a governed re-review of this record. The record is not changed immediately.
Return an associated Future with the same shared state as *this The returned Future is set as soon as this Promise receives the result, value, or an error. This fuction must only be called once as it is not allowed to have multiple Futures per Promise.
IsoStdFutureErrc- If the function is called more than once on the same shared FutureAlreadyRe- state. trievedViolation IsoStdFutureErrc- If *this has no shared state. NoStateViolation
IsoStdFutureEr- If the shared state already has a stored value or error. rcPromiseAl- readySatisfiedVio- lation PromiseNoShared- If *this has no shared state. StateToSetViola- tion
Rückgabewert
Typ
Beschreibung
None
Request a governed re-review of this record. The record is not changed immediately.
gemini-3.8-flash-low· 2026-10-13 · 독일어 원문