Future Objects Changelog
Version 26KW39
Rename generated skeleton respond and attribute accessor methods
Duplicate definitions fixed: generated
SkeletonBasesubclasses previously reused a singlerespond(...)overload set for every method and attribute, which could collide when a service had multiple operations with matching signatures.Method responses:
respond(...)is now generated per method asrespond<MethodName>(...).Attribute responses: attribute getter/setter responses are now
respondGet<AttributeName>Attribute(...)andrespondSet<AttributeName>Attribute(...).Attribute accessors renamed:
get_<AttributeName>Attribute(...)andset_<AttributeName>Attribute(...)are nowget<AttributeName>Attribute(...)andset<AttributeName>Attribute(...)(underscore removed).Cancel APIs renamed:
cancelGet_<AttributeName>AttributeResponse(...)andcancelSet_<AttributeName>AttributeResponse(...)are nowcancelGet<AttributeName>AttributeResponse(...)andcancelSet<AttributeName>AttributeResponse(...).New setter response signature: for
setAsMethodattributes,respondSet<AttributeName>Attribute(response, bool result, handleResponseFailure = true)now responds with a success flag instead of echoing back the attribute value.
Version 26KW26
Return method and getter payloads by const reference
Proxy Methods and Attributes
Callback payload type: Request/response method and getter callbacks now receive
etl::expected<etl::reference_wrapper<PayloadType const>, Future::State>instead ofetl::expected<PayloadType, Future::State>. Access the payload viaoutput.value().get()instead ofoutput.value().New result aliases: The generated proxy now exposes a
<MethodName>Resultalias, andProxyAttributeBase/ProxyAttributeexposeGetterResult/RequestResultaliases for these callback result types.
Proxy Attributes changes
How to cancel a request:
invalidateFuture(Future future)is now calledcancelGetterRequest(uint16_t reqId)orcancelSetterRequest(uint16_t reqId)and takes auint16_t.How to answer a request: setResult(Message msg) is now called answerGetterRequest(Message msg) or answerSetterRequest(Message msg).
Deleted Future Objects:
Futureobjects are no longer the application’s responsibility.Changes to Get Method:
get(Callback& callback)now returnsetl::expected<uint16_t, HRESULT>and takes aGetterPolicy::Callbackas an input.Changes to Set Method:
set(ArgType& payload, Callback& callback)now returnsetl::expected<uint16_t, HRESULT>and additionally to the payload takes a callback.Changes to Set Method (Fire And Forget): When the set method is Fire&Forget,
set(ArgType& payload)returneduint16_twill always beINVALID_REQUEST_IDand takes no callback.
Proxy Methods
How to cancel a request:
invalidateFuture(Future future)no longer exists. AcancelRequest(uint16_t reqId)needs to be called now with the appropriateuint16_t.How to answer a request: setResult(Message msg) has been replaced with answerRequest(Message msg). Inside, this calls what was called releaseRequestId(msg) and is now called futureMatchingRequestId(msg).
To call a method: The method call no longer takes a future object, but a callback. The return type is now an
etl::expected<uint16_t, HRESULT>.
Generator Changes
<InterfaceName>Proxy.h
Attribute Classes: No aliases created, only the constructor needs to be created.
<InterfaceName>Proxy.cpp
*_releaseRequestId(…) methods: These have been removed and, instead, on the OnNewMessageReceived method, the dispatcher methods are directly called.
Method Internal Logic: A lot of changes of the internal logic in the methods’ body have been made, such as return statements and extra checks. Refer to the generated service proxy when adapting the generator.
<InterfaceName>Skeleton.h
CancelResponse: A method for each method is now created with signature cancel<MethodName>Response(SkeletonResponseInfo response).