Register an optional handler that is called if any remote proxy requests the current field value.

Note: The registered handler must provide the current field value using asynchronous future/promise approach. In case no custom handler is registered, ara::com
will internally handle the request and provide the last field value set by last Update()
API call. This implicitly requires at least one call to Update()
before a service instance gets offered.
Syntax
template <…>
auto amsr::socal::events::SkeletonField<…>::RegisterGetHandler(GetHandlerInterface get_handler) -> void
Parameters
in |
| Handler function which is called with The given handler must not be |
Returns
void

Note: Any exception thrown by the callback will lead to a termination through std::terminate()
.
Precondition
- Service must not be offered before calling this API.
Thread-safety, Reentrance, Result Delivery
- Threadsafe : FALSE for same class instance, TRUE for different instances
- Reentrant : FALSE for same class instance, TRUE for different instances
- Synchronous : TRUE
Example
ExampleApplicationField1.RegisterSetHandler([this](service1::skeleton::fields::ExampleApplicationField1::FieldType const& value) {
ara::core::Promise<service1::skeleton::fields::ExampleApplicationField1::FieldType> promise;
promise.set_value(field1_value_);
return promise.get_future();
});