-
Notifications
You must be signed in to change notification settings - Fork 61
mw/com: Add Requirements for the Method extension of Fields #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,168 @@ | ||||||
| /******************************************************************************** | ||||||
| * Copyright (c) 2026 Contributors to the Eclipse Foundation | ||||||
| * | ||||||
| * See the NOTICE file(s) distributed with this work for additional | ||||||
| * information regarding copyright ownership. | ||||||
| * | ||||||
| * This program and the accompanying materials are made available under the | ||||||
| * terms of the Apache License Version 2.0 which is available at | ||||||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||||||
| * | ||||||
| * SPDX-License-Identifier: Apache-2.0 | ||||||
| ********************************************************************************/ | ||||||
| package Communication | ||||||
|
|
||||||
| import ScoreReq | ||||||
|
|
||||||
| section "com" { | ||||||
| section "Public_API_Requirements" { | ||||||
|
|
||||||
| ScoreReq.CompReq FieldGetAndSetInterfaceDefinition{ | ||||||
|
|
||||||
| description = """ | ||||||
| On the interface definition level of a field it shall be possible to specify for each of the following | ||||||
| functionalities, whether they are enabled or not: | ||||||
| - support for a `Get()` call to retrieve the current field value | ||||||
| - support for a `Set()` call to set the current field value | ||||||
| - support for a notification to registered consumers to a field update. | ||||||
| """ | ||||||
| safety = ScoreReq.Asil.B | ||||||
| derived_from = [Communication.Field@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
| ScoreReq.CompReq NoSupportForNotificationInSharedMemoryBinding { | ||||||
|
|
||||||
| description = """For the field implementation in our shared-memory-binding implementation, we shall ignore the setting for "support for a notification" specified in [[FieldGetAndSetInterfaceDefinition]]. Since, in the shared-memory-binding implementation support for an update notification does not imply any performance drawbacks, opposed to e.g. a network binding.""" | ||||||
| safety = ScoreReq.Asil.B | ||||||
| derived_from = [Communication.Field@1, Communication.MultiBindingSupport@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
| section "Field_member_representation_at_the_Proxy_side" { | ||||||
|
|
||||||
| ScoreReq.CompReq GetMethodOnlyIfEnabledInInterfaceDefinition { | ||||||
| description="""It shall provide a public `Get` method only in the case, that 'support for a `Get()`' has been enabled in the underlying interface definition (see [[FieldGetAndSetInterfaceDefinition]])""" | ||||||
| derived_from = [Communication.Field@1] | ||||||
| version = 1 | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq GetMethodSignature { | ||||||
| description=""" The signature of the `Get` method shall be: `bmw::Result<MethodReturnTypePtr<SampleDataType>> Get()`.""" | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| derived_from = [Communication.Field@1] | ||||||
| version = 1 | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
|
|
||||||
| ScoreReq.CompReq GetMethodReturnValue { | ||||||
| description="""It shall return the field value, which has been updated last by the provider in success case in the form of a `MethodReturnTypePtr` to the value.""" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It shall return the provider's most recently updated field value as a MethodReturnTypePtr upon success. |
||||||
| derived_from = [Communication.Field@1, Communication.ProducerConsumerPattern@1] | ||||||
| version = 1 | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq SetMethodOnlyIfEnabledInInterfaceDefinition { | ||||||
| description="""It shall provide a public `Set` method only in the case, that "support for a Set()" has been enabled in the underlying interface definition (see [[FieldGetAndSetInterfaceDefinition]]).""" | ||||||
| derived_from = [Communication.Field@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq SetMethodSignature { | ||||||
| description=""" The signature of the `Set` method shall be: `bmw::Result<MethodReturnTypePtr<SampleDataType>> Set(MethodInArgPtr<SampleDataType>)`""" | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| derived_from = [Communication.Field@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq SetMethodReturnValue { | ||||||
| description="""`Set` method shall return the field value, which has been updated last by the provider in success case in the form of a MethodReturnTypePtr to the value.""" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||||||
| derived_from = [Communication.Field@1, Communication.ProducerConsumerPattern@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq AllocateMethodForZeroCopySet { | ||||||
| description="""It shall provide a `Allocate()` method for the zero-copy Set call variant.""" | ||||||
| derived_from = [Communication.Field@1, Communication.ZeroCopy@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq AllocateMethodSignature { | ||||||
| description="""The signature of the `Allocate()` method shall be: `bmw::Result<impl::MethodInArgPtr<SampleDataType>> Allocate()`.""" | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| derived_from = [Communication.Field@1, Communication.ZeroCopy@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
| ScoreReq.CompReq ZeroCopySetMethodOnlyIfEnabledInInterfaceDefinition { | ||||||
| description="""It shall provide a public `Set` method with zero copy semantics only in the case, that "support for a Set()" has been enabled in the underlying interface definition (see [[FieldGetAndSetInterfaceDefinition]]).""" | ||||||
| derived_from = [Communication.Field@1, Communication.ZeroCopy@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq ZeroCopySetMethodSignature { | ||||||
| description="""The signature of the `Set` method shall be: `bmw::Result<MethodReturnTypePtr<SampleDataType>> Set(MethodInArgPtr<SampleDataType>)`""" | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| derived_from = [Communication.Field@1, Communication.ZeroCopy@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
| section "Field_member_representation_at_the_Skeleton_side" { | ||||||
|
|
||||||
| ScoreReq.CompReq RegisterGetHandlerOnlyIfEnabledInInterfaceDefinition { | ||||||
| description="""It shall provide a public `RegisterGetHandler` method only in the case, that 'support for a Get()' has been enabled in the underlying interface definition (see [[FieldGetAndSetInterfaceDefinition]])""" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As of the last sync, LoLa handles Get functionality internally. |
||||||
| derived_from = [Communication.Field@1] | ||||||
| version = 1 | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq RegisterSetHandlerOnlyIfEnabledInInterfaceDefinition { | ||||||
| description="""It shall provide a public `RegisterSetHandler` method only in the case, that "support for a Set()" has been enabled in the underlying interface definition (see [[FieldGetAndSetInterfaceDefinition]])""" | ||||||
| derived_from = [Communication.Field@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
| ScoreReq.CompReq RegisterGetHandlerSignature { | ||||||
| description=""" The signature of the `RegisterGetHandler` method shall be: `bmw::ResultBlank RegisterGetHandler(GetHandlerType)`""" | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my view, the requirement for RegisterGetHandler on the Skeleton side is not needed. The RegisterGetHandler function will not be exposed to the user, as it is managed internally by LoLa. Therefore, it should be considered an implementation detail. |
||||||
| derived_from = [Communication.Field@1] | ||||||
| version = 1 | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq RegisterSetHandlerSignature { | ||||||
| description=""" The signature of the `RegisterSetHandler` method shall be: `bmw::ResultBlank RegisterSetHandler(SetHandlerType)`""" | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| derived_from = [Communication.Field@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq SetHandlerTypeDefinition { | ||||||
| description="""The `SetHandlerType` shall be a callable of this type: using SetHandlerType = amp::callback<void(SampleDataType&)>;`""" | ||||||
| derived_from = [Communication.Field@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
| ScoreReq.CompReq SetHandlerTypeDefinition { | ||||||
| description="""It is mandatory to register a `SetHandler` for a `SkeletonField` instance. If the user has not registered a handler before calling `Offer()` on the enclosing skeleton, the call to `Offer()` shall fail with an error.""" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only if Set is enabled in the interface Definition. right? |
||||||
| derived_from = [Communication.Field@1, Communication.ServiceInstance@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
| ScoreReq.CompReq SetHandlerTypeDefinition { | ||||||
| description="""After the user provided `SetHandler` has returned, the (potentially updated) field value has to: | ||||||
| - be stored as the latest value. | ||||||
| - if enabled, notifier for the updated value has to be called to inform subscribers of the field about the updated value. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does if enable means? what if the value is not changed? |
||||||
| - be returned as the result of the `get()` method call to the proxy side.""" | ||||||
| derived_from = [Communication.Field@1, Communication.ProducerConsumerPattern@1] | ||||||
| version = 1 | ||||||
| } | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,13 @@ ScoreReq.FeatReq Method { | |
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq Field { | ||
| description = "A field is part of a communication interface and has a name and a data type, as wall as special getter and setter methods. The producer can assign a value to it. Consumers can subscribe to value-changed fields of the element or poll unseen, cached fields. Consumers can also retrieve the current value of the field through its getter or set a new value to it through the setter method." | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A field is a component of a communication interface and is defined by a name and a data type, along with dedicated getter and setter methods. The producer has the ability to assign a value to the field. Consumers can either subscribe to receive notifications when the field’s value changes or poll the cached values of fields that have not yet been seen. Additionally, consumers can retrieve the current value of the field using the getter method or update the field’s value through the setter method. |
||
| safety = ScoreReq.Asil.B | ||
| derived_from = [ AssumedSystemRequirements.InterProcessCommunication@1, AssumedSystemRequirements.SupportForRequestDrivenArchitecture@1, AssumedSystemRequirements.SafeCommunication@1 ] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq Signal { | ||
| description = "A signal is part of a communication interface and has a name. A client can trigger the signal. The service instance offering the trigger can wait for the signal to be triggered or check if the signal was triggered. Signals can not transport data." | ||
| safety = ScoreReq.Asil.QM | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the field implementation in the shared-memory-binding implementation, the setting for "support for a notification" specified in [[FieldGetAndSetInterfaceDefinition]] shall be ignored. This is because, in the shared-memory-binding implementation, support for update notifications does not imply any performance drawbacks, unlike, for example, a network binding.