Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions score/mw/com/design/configuration/structural_view.puml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,22 @@ package "configuration" {
}

class "score::mw::com::impl::LolaFieldInstanceDeployment" {
+ max_samples_: std::uint16_t
+ max_subscribers_: std::uint8_t
+ enforce_max_samples_ : score::cpp::optional<bool>
+ is_set_configured: bool
+ is_get_configured: bool
{static} + constexpr serializationVersion : std::uint32_t
+ max_subscribers_ : std::optional<SubscriberCountType>
+ max_concurrent_allocations_ : std::optional<std::uint8_t>
+ enforce_max_samples_ : bool
+ use_get_if_available_ : bool
+ use_set_if_available_ : bool
- number_of_sample_slots_ : std::optional<SampleSlotCountType>
- number_of_tracing_slots_ : TracingSlotSizeType
__
{static} + CreateFromJson(json_object : const score::json::Object&) : LolaFieldInstanceDeployment
+ Serialize() const : score::json::Object
--
<u>Type Aliases:</u>
using SampleSlotCountType as std::uint16_t
using SubscriberCountType as std::uint8_t
using TracingSlotSizeType as std::uint8_t
}

class "score::mw::com::impl::LolaMethodInstanceDeployment" {
Expand Down
8 changes: 6 additions & 2 deletions score/mw/com/impl/bindings/lola/skeleton_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1167,9 +1167,13 @@ TEST_P(SkeletonRegisterParamaterisedFixture, ValidEventMetaInfoExistAfterEventIs
fields_.emplace(test::kDumbEventName, dumb_event);

lola_field_inst_depls.push_back(
{test::kFooEventName, LolaFieldInstanceDeployment{number_of_slots, 10U, 1U, true, 0}});
{test::kFooEventName,
LolaFieldInstanceDeployment{
LolaEventInstanceDeployment{number_of_slots, 10U, 1U, true, 0}, false, false}});
lola_field_inst_depls.push_back(
{test::kDumbEventName, LolaFieldInstanceDeployment{number_of_slots, 10U, 1U, true, 0}});
{test::kDumbEventName,
LolaFieldInstanceDeployment{
LolaEventInstanceDeployment{number_of_slots, 10U, 1U, true, 0}, false, false}});
}
ServiceInstanceDeployment service_instance_deployment{
test::kFooService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class ProxyWithRealMemFixture : public ::testing::Test
LolaServiceInstanceDeployment lola_service_instance_deployment{
LolaServiceInstanceId{kElementFqId.instance_id_},
{{kEventName, LolaEventInstanceDeployment{10U, 10U, 2U, true, 0}},
{kNonProvidedEventName, LolaFieldInstanceDeployment{10U, 10U, 2U, true, 0}}}};
{kNonProvidedEventName, LolaEventInstanceDeployment{10U, 10U, 2U, true, 0}}}};
LolaServiceTypeDeployment lola_service_type_deployment{
kElementFqId.service_id_,
{{kEventName, LolaEventId{kElementFqId.element_id_}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ class SkeletonComponentTestFixture : public ::testing::Test
{test::kFooEventName, LolaEventInstanceDeployment{kNumberOfSlots, 10U, 1U, true, 0}});
fields_.emplace(test::kFooFieldName, mock_field_binding_);
lola_field_instance_deployments_.push_back(
{test::kFooFieldName, LolaEventInstanceDeployment{kNumberOfSlots, 10U, 1U, true, 0}});
{test::kFooFieldName,
LolaFieldInstanceDeployment{LolaEventInstanceDeployment{kNumberOfSlots, 10U, 1U, true, 0}, false, false}});
service_instance_deployment_ = std::make_unique<ServiceInstanceDeployment>(
test::kFooService,
CreateLolaServiceInstanceDeployment(test::kDefaultLolaInstanceId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ static const ServiceInstanceDeployment kValidInstanceDeploymentWithField{
CreateLolaServiceInstanceDeployment(
kDefaultLolaInstanceId,
{},
{{test::kFooEventName, LolaFieldInstanceDeployment{test::kMaxSlots, 10U, 1U, true, 0}}},
{{test::kFooEventName,
LolaFieldInstanceDeployment{LolaEventInstanceDeployment{test::kMaxSlots, 10U, 1U, true, 0}, false, false}}},
{},
{},
{},
Expand Down Expand Up @@ -284,7 +285,8 @@ static const ServiceInstanceDeployment kValidAsilInstanceDeploymentWithField{
CreateLolaServiceInstanceDeployment(
kDefaultLolaInstanceId,
{},
{{test::kFooEventName, LolaFieldInstanceDeployment{test::kMaxSlots, 10U, 1U, true, 0}}},
{{test::kFooEventName,
LolaFieldInstanceDeployment{LolaEventInstanceDeployment{test::kMaxSlots, 10U, 1U, true, 0}, false, false}}},
{},
{},
{},
Expand Down
5 changes: 4 additions & 1 deletion score/mw/com/impl/configuration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ cc_library(
hdrs = ["lola_field_instance_deployment.h"],
features = COMPILER_WARNING_FEATURES,
tags = ["FFI"],
deps = [":lola_event_instance_deployment"],
deps = [
":configuration_common_resources",
":lola_event_instance_deployment",
],
)

cc_library(
Expand Down
10 changes: 9 additions & 1 deletion score/mw/com/impl/configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Within the `service-instance` json object, there are further binding independent
- `events`
- `fields`

the `event` and `field` json objects, which are the items in the corresponding arrays are property-wise identical.
the event and field json objects share most configuration properties, but fields have two additional optional properties (useGetIfAvailable, useSetIfAvailable) not present on events.
Additionally, there is the following constraint:
For each event or field enlisted in the `events` and `fields` arrays on the [service-type->bindings](#bindings) level of
the `service-type` a `service-instance` is based on, a corresponding instance specific event or field object has to exist.
Expand Down Expand Up @@ -434,6 +434,12 @@ The properties of a field or an event object on the instance level are:
tracing are different and the tracing subsystem has to explicitly know, how many slots/samples it is allowed to access
in parallel at most. Furthermore, setting the value of `numberOfIpcTracingSlots` to 0 or not configuring it all,
explicitly means, that tracing for this event or field is disabled.
- `useGetIfAvailable`: (optional, field only, default `false`) - When `true`, the getter for this field will be
used if the service type declares a getter. This is a consumer/proxy side configuration hint. On the provider
(skeleton) side this setting has no effect.
- `useSetIfAvailable`: (optional, field only, default `false`) - When `true`, the setter for this field will be
used if the service type declares a setter. This is a consumer/proxy side configuration hint. On the provider
(skeleton) side this setting has no effect.

###### methods within an instance

Expand Down Expand Up @@ -599,3 +605,5 @@ is being used, whether a property is mandatory or optional or irrelevant, the fo
| _serviceInstances.instances.events.maxSubscribers_ <br> _serviceInstances.instances.fields.maxSubscribers_ | required | - | |
| _serviceInstances.instances.events.enforceMaxSamples_ <br> _serviceInstances.instances.fields.enforceMaxSamples_ | optional | - | if not given on skeleton side, defaults to true |
| _serviceInstances.instances.events.numberOfIpcTracingSlots_ <br> _serviceInstances.instances.fields.numberOfIpcTracingSlots_ | optional | - | if not given on skeleton side, defaults to 0, which means tracing for this event is disabled. |
| _serviceInstances.instances.fields.useGetIfAvailable_ | - | optional | if not given, defaults to false. Signals that the field getter should be used when the service type declares one. |
| _serviceInstances.instances.fields.useSetIfAvailable_ | - | optional | if not given, defaults to false. Signals that the field setter should be used when the service type declares one. |
23 changes: 17 additions & 6 deletions score/mw/com/impl/configuration/config_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ constexpr auto kFieldNumberOfSampleSlotsKey = "numberOfSampleSlots"sv;
constexpr auto kFieldMaxSubscribersKey = "maxSubscribers"sv;
constexpr auto kFieldEnforceMaxSamplesKey = "enforceMaxSamples"sv;
constexpr auto kFieldMaxConcurrentAllocationsKey = "maxConcurrentAllocations"sv;
constexpr auto kFieldUseGetIfAvailableKey = "useGetIfAvailable"sv;
constexpr auto kFieldUseSetIfAvailableKey = "useSetIfAvailable"sv;
constexpr auto kFieldUseGetIfAvailableDefault = false;
constexpr auto kFieldUseSetIfAvailableDefault = false;
constexpr auto kLolaShmSizeKey = "shm-size"sv;
constexpr auto kLolaControlAsilBShmSizeKey = "control-asil-b-shm-size"sv;
constexpr auto kLolaControlQmShmSizeKey = "control-qm-shm-size"sv;
Expand Down Expand Up @@ -491,12 +495,19 @@ auto ParseLolaFieldInstanceDeployment(const score::json::Object& json_map, LolaS
const auto number_of_tracing_slots =
deployment_parser.RetrieveJsonElement<NumberOfIpcTracingSlots_t>(kNumberOfIpcTracingSlotsKey)
.value_or(kNumberOfIpcTracingSlotsDefault);

auto field_deployment = LolaFieldInstanceDeployment(number_of_sample_slots,
max_subscribers,
kMaxConcurrentAllocationsDefault,
enforce_max_samples,
number_of_tracing_slots);
const auto use_get_if_available = deployment_parser.RetrieveJsonElement<bool>(kFieldUseGetIfAvailableKey)
.value_or(kFieldUseGetIfAvailableDefault);
const auto use_set_if_available = deployment_parser.RetrieveJsonElement<bool>(kFieldUseSetIfAvailableKey)
.value_or(kFieldUseSetIfAvailableDefault);

auto field_deployment =
LolaFieldInstanceDeployment(LolaEventInstanceDeployment(number_of_sample_slots,
max_subscribers,
kMaxConcurrentAllocationsDefault,
enforce_max_samples,
number_of_tracing_slots),
use_get_if_available,
use_set_if_available);
const auto emplace_result = service.fields_.emplace(std::piecewise_construct,
std::forward_as_tuple(std::move(field_name_value)),
std::forward_as_tuple(field_deployment));
Expand Down
Loading