From 52bafd00f69f035dc67788629bfea472366dd52a Mon Sep 17 00:00:00 2001 From: George Dadunashvili Date: Sat, 7 Mar 2026 08:42:15 +0100 Subject: [PATCH] mw/com: Add Requirements for the Method extension of Fields --- .../component_requirements_ipc_fields.trlc | 168 ++++++++++++++++++ .../feature_requirements_ipc.trlc | 7 + 2 files changed, 175 insertions(+) create mode 100644 score/mw/com/requirements/component_requirements/component_requirements_ipc_fields.trlc diff --git a/score/mw/com/requirements/component_requirements/component_requirements_ipc_fields.trlc b/score/mw/com/requirements/component_requirements/component_requirements_ipc_fields.trlc new file mode 100644 index 000000000..c8d900074 --- /dev/null +++ b/score/mw/com/requirements/component_requirements/component_requirements_ipc_fields.trlc @@ -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> Get()`.""" + 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.""" + 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> Set(MethodInArgPtr)`""" + 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.""" + 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> Allocate()`.""" + 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> Set(MethodInArgPtr)`""" + 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]])""" + 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)`""" + derived_from = [Communication.Field@1] + version = 1 + + } + + ScoreReq.CompReq RegisterSetHandlerSignature { + description=""" The signature of the `RegisterSetHandler` method shall be: `bmw::ResultBlank RegisterSetHandler(SetHandlerType)`""" + derived_from = [Communication.Field@1] + version = 1 + } + + ScoreReq.CompReq SetHandlerTypeDefinition { + description="""The `SetHandlerType` shall be a callable of this type: using SetHandlerType = amp::callback;`""" + 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.""" + 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. +- be returned as the result of the `get()` method call to the proxy side.""" + derived_from = [Communication.Field@1, Communication.ProducerConsumerPattern@1] + version = 1 + } + + } + +} + diff --git a/score/mw/com/requirements/feature_requirements/feature_requirements_ipc.trlc b/score/mw/com/requirements/feature_requirements/feature_requirements_ipc.trlc index fd350205d..c7720ff14 100644 --- a/score/mw/com/requirements/feature_requirements/feature_requirements_ipc.trlc +++ b/score/mw/com/requirements/feature_requirements/feature_requirements_ipc.trlc @@ -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." + 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