função RegisterGetHandler [SWS_CM_00114] Upstream: RS_CM_00218, RS_AP_00114, RS_AP_00120, RS_AP_00127, RS_AP_00128, RS_AP_00138
void RegisterGetHandler (std::function< ara::core::Future< FieldType >()> handler) noexcept;
Register a callback function to be invoked when a Get() request is received. The method exists only if the offered service contains a Field and Field.hasGetter ==TRUE
usar
O método RegisterGetHandler é chamado no lado do servidor no objeto de campo de um skeleton ([SWS_CM_00114]). Ele existe no código gerado exclusivamente se um getter tiver sido configurado na descrição da interface para o campo em questão (Field.hasGetter == TRUE) (EXP ARAComAPI §5.4.8.1 «Registering Getters»). É passado um callback handler do tipo std::function<ara::core::Future<FieldType>()>, o qual é chamado pela implementação de binding mediante uma solicitação Get() recebida de um proxy.
O registro de tal handler é totalmente opcional (EXP ARAComAPI §5.4.8.1 «Registering Getters»). Usualmente, a implementação do serviço não necessita de um handler de getter, uma vez que o Communication Management armazena em cache o valor definido mais recentemente via Update() e responde autonomamente a solicitações do proxy. Um handler é útil principalmente se a determinação do valor do campo for demorada ou computacionalmente intensiva e, portanto, deva ocorrer apenas sob demanda real de forma assíncrona através do padrão promise/future.
Tratamento de erros e condições de contorno
A função não possui valor de retorno, está declarada como noexcept e é segura contra exceções (exception safe) ([SWS_CM_00114]). Se o chamável passado não existir ou for null, ocorre o erro InvalidHandlerViolation ([SWS_CM_00114]).
Interação
Ao contrário de RegisterSetHandler, cuja chamada é obrigatória havendo um setter configurado (EXP ARAComAPI §5.4.8.2 «Registering Setters»), RegisterGetHandler permanece puramente opcional. Caso o handler deva ser processado de forma assíncrona em um contexto de execução específico, está disponível adicionalmente a função de template sobrecarregada com ExecutorT ([SWS_CM_11360]).
Esta nota de utilização foi gerada por uma IA com base na especificação AUTOSAR R25-11.
Guia do implementador em breve (complexidade I2)
| Header-Datei | #include "<SiNamespaceDerivedDirectoryPath>/<SiShortname>_skeleton.h" |
|---|---|
| Scope | class <SI-Namespace>::skeleton:: fields::<Field> |
| Exception-Sicherheit | exception safe |
| Verletzungen (Violations) | InvalidHandlerVio- Provided Callable handler does not exist or is null lation |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| handler | The callback function to be invoked to process the Field get request |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| None |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_CM_00114- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_CM_00114@rel:R25-11#627745db- Content hash
627745db- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_00114
Status: valid/unmigrated
Version: rel:R25-11#c6386380
Versionshistorie & Revisions (1 transition, 8 revision)
- Current State
valid/unmigrated- Reason
- mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
- Campaign
2026-08-13-status-backfill- Active Version
AUTOSAR/AP/record/SWS_CM_00114@rel:R25-11#c6386380
Recorded Revisions (8):
- R25-11
rel:R25-11#417163c72026-09-30 - R19-11
rel:R19-11#f07f56a32026-10-14 - R20-11
rel:R20-11#cdd125c72026-10-14 - R21-11
rel:R21-11#cdd125c72026-10-14 - R22-11
rel:R22-11#6a153b112026-10-14 - R23-11
rel:R23-11#23956e7c2026-10-14 - R24-11
rel:R24-11#5d29d0102026-10-14 - R25-11
rel:R25-11#c63863802026-10-14 active
Requirement Text as-of this release:
Curation Decisions:
Reachable Artifacts & Dependents:
| Date | Actor | Transition | Reason / Rationale | Campaign |
|---|---|---|---|---|
| 2026-08-13 | tool | none → valid/unmigrated | mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record | 2026-08-13-status-backfill |
gemini-3.8-flash-low· 2026-10-13 · Original em alemão