Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
execution_client.h
1#ifndef EXECUTION_CLIENT_H
2#define EXECUTION_CLIENT_H
3
4#include <future>
5#include "../core/instance_specifier.h"
6#include "../core/result.h"
7#include "../com/someip/rpc/rpc_client.h"
8#include "./exec_exception.h"
9
10namespace ara
11{
12 namespace exec
13 {
15 enum class ExecutionState : uint8_t
16 {
17 kRunning = 0
18 };
19
21 class ExecutionClient final
22 {
23 private:
24 static const ExecErrorDomain cErrorDomain;
25 const uint16_t cServiceId{1};
26 const uint16_t cMethodId{1};
27 const uint16_t cClientId{2};
28
29 mutable std::promise<void> mPromise;
30 mutable std::future<void> mFuture;
31
32 const core::InstanceSpecifier mInstanceSpecifier;
33 com::someip::rpc::RpcClient *const mRpcClient;
34 const std::chrono::seconds mTimeout;
35
36 ExecException generateException(ExecErrc executionErrorCode) const;
37
38 void reportExecutionStateHandler(
40
41 public:
48 core::InstanceSpecifier instanceSpecifier,
50 int64_t timeout = 30);
51
53
58 ExecutionState state) const;
59 };
60 }
61}
62
63#endif
SOME/IP RPC abstract client.
Definition: rpc_client.h:20
SOME/IP remote procedure call message.
Definition: someip_rpc_message.h:16
AUTOSAR shortname-path wrapper.
Definition: instance_specifier.h:14
A wrapper around the callee's return value and its possible error.
Definition: result.h:16
Execution Management ErrorDomain.
Definition: exec_error_domain.h:31
Execution Management exception.
Definition: exec_exception.h:13
Class that enables an adaptive application to interact with Execution Management.
Definition: execution_client.h:22
ExecutionClient(core::InstanceSpecifier instanceSpecifier, com::someip::rpc::RpcClient *rpcClient, int64_t timeout=30)
Constructor.
Definition: execution_client.cpp:10
ara::core::Result< void > ReportExecutionState(ExecutionState state) const
Report the application internal state to Execution Management.
Definition: execution_client.cpp:70
ExecutionState
Adaptive application internal state.
Definition: execution_client.h:16
@ kRunning
Application process performs normally.
ExecErrc
Execution Management error codes.
Definition: exec_error_domain.h:13