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
22 changes: 11 additions & 11 deletions score/mw/com/design/events_fields/event_lola_model.puml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract class SkeletonBinding {
' Concrete classes
class lola::SkeletonEvent<SampleType> {
-event_data_storage: EventDataStorage<SampleType>*
-event_data_control: score::cpp::optional<EventDataControlComposite>
-event_data_control: score::cpp::optional<EventDataControlComposite<>>
+SkeletonEvent(parent: Skeleton&, event_fqn: const ElementFqId, max_number_of_slots: const std::size_t, enforce_max_samples: const bool)
+Send(SampleType const&): void
+Send(SampleAllocateePtr<SampleType>): void
Expand Down Expand Up @@ -71,7 +71,7 @@ class lola::Skeleton {
+Skeleton(const InstanceIdentifier&, SkeletonEvents&)
+PrepareOffer(): ResultBlank
+PrepareStopOffer(): ResultBlank
+Register(ElementFqId, size_t numberOfSlots): std::pair<EventDataStorage*, EventDataControlComposite>
+Register(ElementFqId, size_t numberOfSlots): std::pair<EventDataStorage*, EventDataControlComposite<>>
+GetInstanceQualityType() const: QualityType
}

Expand Down Expand Up @@ -136,7 +136,7 @@ class lola::SampleAllocateePtr<SampleType> {
-event_data_control_: EventDataControlComposite
+SampleAllocateePtr()
+SampleAllocateePtr(std::nullptr_t)
+SampleAllocateePtr(ptr: pointer, const EventDataControlComposite&, const EventDataControl::SlotIndexType)
+SampleAllocateePtr(ptr: pointer, const EventDataControlComposite<>&, const EventDataControl::SlotIndexType)
+GetReferencedSlot() const: EventDataControl::SlotIndexType
+get() const: SampleType*
+reset(std::nullptr_t): void
Expand All @@ -159,7 +159,7 @@ class lola::SamplePtr<SampleType> {
-event_data_control_: EventDataControl*
+SamplePtr()
+SamplePtr(std::nullptr_t)
+SamplePtr(pointer ptr, const EventDataControlComposite&, const EventDataControl::SlotIndexType)
+SamplePtr(pointer ptr, const EventDataControlComposite<>&, const EventDataControl::SlotIndexType)
+get() const: pointer
+swap(): void
}
Expand Down Expand Up @@ -213,11 +213,11 @@ class "<<SharedMemory>>\nlola::EventSlotStatus" {
+IsTimeStampBetween(EventTimeStamp min, EventTimeStamp max): bool
}

class EventDataControlCompositeImpl<memory::shared::AtomicIndirectorType> {
class EventDataControlComposite<memory::shared::AtomicIndirectorType> {
-asil_qm_control_: EventDataControl*
-asil_b_control_: EventDataControl*
+EventDataControlCompositeImpl(asil_qm_control: EventDataControl* const)
+EventDataControlCompositeImpl(asil_qm_control: EventDataControl* const, asil_b_control: EventDataControl* const)
+EventDataControlComposite(asil_qm_control: EventDataControl* const)
+EventDataControlComposite(asil_qm_control: EventDataControl* const, asil_b_control: EventDataControl* const)
+AllocateNextSlot(): std::optional<EventDataControl::SlotIndexType>
+EventReady(EventDataControl::SlotIndexType, EventSlotStatus::EventTimeStamp): void
+Discard(EventDataControl::SlotIndexType): void
Expand All @@ -238,18 +238,18 @@ lola::Skeleton *-- SkeletonDataStorage : "1..1"
lola::Skeleton *-- "<<SharedMemory>>\nlola::SkeletonDataControl" : "1..2"
"<<SharedMemory>>\nlola::SkeletonDataControl" *-- "<<SharedMemory>>\nlola::EventDataControlImpl" : "0..n"
lola::SkeletonEvent o-- "EventDataStorage"
lola::SkeletonEvent *-- EventDataControlCompositeImpl
lola::SkeletonEvent *-- EventDataControlComposite
"<<SharedMemory>>\nlola::EventDataControlImpl" ..> "<<SharedMemory>>\nlola::EventSlotStatus"
SampleAllocateePtr o-- lola::SampleAllocateePtr
SamplePtr o-- lola::SamplePtr
lola::ProxyEvent *-- lola::ProxyEventCommon
lola::ProxyEventCommon *-- lola::SubscriptionStateMachine
lola::ProxyEventCommon --* lola::SlotCollector
ProxyEventBindingBase o-- SubscriptionState
lola::SampleAllocateePtr *-- EventDataControlCompositeImpl
EventDataControlCompositeImpl o-- "<<SharedMemory>>\nlola::EventDataControlImpl" : "2"
lola::SampleAllocateePtr *-- EventDataControlComposite
EventDataControlComposite o-- "<<SharedMemory>>\nlola::EventDataControlImpl" : "2"
lola::Skeleton ..> lola::ShmPathBuilder : uses
lola::Skeleton ..> EventDataControlCompositeImpl
lola::Skeleton ..> EventDataControlComposite
lola::SubscriptionStateMachine ..> lola::SlotCollector : <<creates>>
SkeletonEventBinding ..> SampleAllocateePtr
lola::ProxyEvent ..> lola::SamplePtr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class "lola::EventDataControlImpl" <<SharedMemory>> {
+AllocateNextSlot(): std::optional<SlotIndexType>
+EventReady(SlotIndexType, EventTimestamp): void
+Discard(SlotIndexType): void
+ReferenceNextEvent(lastSearchTime : EventTimestampType, upper_limit : const EventSlotStatus::EventTimeStamp = EventSlotStatus::TIMESTSCORE_LANGUAGE_FUTURECPP_MAX): std::optional<SlotIndexType>
+ReferenceNextEvent(lastSearchTime : EventTimestampType, upper_limit : const EventSlotStatus::EventTimeStamp = EventSlotStatus::TIMESTAMP_MAX): std::optional<SlotIndexType>
+DereferenceEvent(SlotIndexType eventSlotIndex): void
+GetNumNewEvents(reference_time : const EventSlotStatus::EventTimeStamp) const : std::size_t
+<b>GetTransactionLogSet() : TransactionLogSet&</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The map containing the meta-information gets initialized by the skeleton instanc
the vectors containing the sample slots in
```
template <typename SampleType>
std::pair<EventDataStorage<SampleType>*, EventDataControlComposite> lola::Skeleton::Register(ElementFqId event_fqn,
std::pair<EventDataStorage<SampleType>*, EventDataControlComposite<>> lola::Skeleton::Register(ElementFqId event_fqn,
std::size_t number_of_slots)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class "lola::Skeleton" as lola_Skeleton {
+PrepareStopOffer(): void

template <typename SampleType>
+Register(ElementFqId, size_t num_slots): std::pair<EventDataStorage<SampleType>*,EventDataControlComposite>
+Register(ElementFqId, size_t num_slots): std::pair<EventDataStorage<SampleType>*,EventDataControlComposite<>>
}

class "lola::SkeletonEvent<SampleType>" as lola_SkeletonEvent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class "lola::Skeleton" as LolaSkeleton {
+PrepareOffer(SkeletonBinding::SkeletonEventBindings&, SkeletonBinding::SkeletonFieldBindings&): ResultBlank
+PrepareStopOffer(): void

+template <typename SampleType>\n Register(ElementFqId, size_t num_slots): std::pair<EventDataStorage<SampleType>*, EventDataControlComposite>
+template <typename SampleType>\n Register(ElementFqId, size_t num_slots): std::pair<EventDataStorage<SampleType>*, EventDataControlComposite<>>
}

class "SkeletonBindingFactory" {
Expand Down
122 changes: 85 additions & 37 deletions score/mw/com/impl/bindings/lola/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -216,24 +216,16 @@ cc_library(
)

cc_library(
name = "shared_data_structures",
srcs = [
"service_data_control.cpp",
"service_data_storage.cpp",
],
hdrs = [
"service_data_control.h",
"service_data_storage.h",
],
name = "service_data_storage",
srcs = ["service_data_storage.cpp"],
hdrs = ["service_data_storage.h"],
features = COMPILER_WARNING_FEATURES,
tags = ["FFI"],
visibility = [
"//score/mw/com/impl/bindings/lola/test_doubles:__pkg__",
],
deps = [
":application_id_pid_mapping",
":element_fq_id",
":event",
":event_meta_info",
":i_runtime",
"//score/mw/com/impl:runtime",
Expand All @@ -242,6 +234,24 @@ cc_library(
],
)

cc_library(
name = "service_data_control",
srcs = ["service_data_control.cpp"],
hdrs = ["service_data_control.h"],
features = COMPILER_WARNING_FEATURES,
tags = ["FFI"],
visibility = [
"//score/mw/com/impl/bindings/lola/test_doubles:__pkg__",
],
deps = [
":application_id_pid_mapping",
":element_fq_id",
":event_control",
":event_meta_info",
"@score_baselibs//score/memory/shared",
],
)

cc_library(
name = "skeleton",
srcs = [
Expand All @@ -268,7 +278,8 @@ cc_library(
":i_shm_path_builder",
":partial_restart_path_builder",
":proxy_instance_identifier",
":shared_data_structures",
":service_data_control",
":service_data_storage",
":shm_path_builder",
":skeleton_instance_identifier",
":transaction_log_registration_guard",
Expand Down Expand Up @@ -308,29 +319,13 @@ cc_library(
"proxy_event.cpp",
"proxy_event_common.cpp",
"proxy_method.cpp",
"slot_collector.cpp",
"subscription_helpers.cpp",
"subscription_not_subscribed_states.cpp",
"subscription_state_base.cpp",
"subscription_state_machine.cpp",
"subscription_state_machine_states.cpp",
"subscription_subscribed_states.cpp",
"subscription_subscription_pending_states.cpp",
],
hdrs = [
"generic_proxy_event.h",
"proxy.h",
"proxy_event.h",
"proxy_event_common.h",
"proxy_method.h",
"slot_collector.h",
"subscription_helpers.h",
"subscription_not_subscribed_states.h",
"subscription_state_base.h",
"subscription_state_machine.h",
"subscription_state_machine_states.h",
"subscription_subscribed_states.h",
"subscription_subscription_pending_states.h",
],
features = COMPILER_WARNING_FEATURES,
tags = ["FFI"],
Expand All @@ -340,8 +335,11 @@ cc_library(
":event_control",
":event_subscription_control",
":proxy_instance_identifier",
":shared_data_structures",
":service_data_control",
":service_data_storage",
":shm_path_builder",
":slot_collector",
":subscription_state_machine",
":transaction_log_id",
":transaction_log_registration_guard",
":transaction_log_rollback_executor",
Expand Down Expand Up @@ -426,6 +424,54 @@ cc_library(
],
)

cc_library(
name = "subscription_state_machine",
srcs = [
"subscription_helpers.cpp",
"subscription_not_subscribed_states.cpp",
"subscription_state_base.cpp",
"subscription_state_machine.cpp",
"subscription_state_machine_states.cpp",
"subscription_subscribed_states.cpp",
"subscription_subscription_pending_states.cpp",
],
hdrs = [
"subscription_helpers.h",
"subscription_not_subscribed_states.h",
"subscription_state_base.h",
"subscription_state_machine.h",
"subscription_state_machine_states.h",
"subscription_subscribed_states.h",
"subscription_subscription_pending_states.h",
],
features = COMPILER_WARNING_FEATURES,
tags = ["FFI"],
deps = [
":event_control",
":event_data_control",
":i_runtime",
":slot_collector",
":transaction_log_id",
":transaction_log_registration_guard",
"//score/mw/com/impl:runtime",
"//score/mw/com/impl:scoped_event_receive_handler",
"//score/mw/com/impl/bindings/lola/messaging:i_message_passing_service",
],
)

cc_library(
name = "slot_collector",
srcs = ["slot_collector.cpp"],
hdrs = ["slot_collector.h"],
features = COMPILER_WARNING_FEATURES,
tags = ["FFI"],
deps = [
":event_data_control",
":event_slot_status",
":transaction_log_set",
],
)

cc_library(
name = "application_id_pid_mapping",
srcs = ["application_id_pid_mapping.cpp"],
Expand Down Expand Up @@ -689,7 +735,7 @@ cc_library(
tags = ["FFI"],
visibility = ["//score/mw/com/impl/bindings/lola:__subpackages__"],
deps = [
":shared_data_structures",
":service_data_control",
":transaction_log_id",
":transaction_log_set",
"//score/mw/com/impl:runtime",
Expand Down Expand Up @@ -882,7 +928,7 @@ cc_unit_test(
)

cc_test(
name = "event_data_control_unit_test",
name = "event_data_control_test",
size = "small",
timeout = "long",
srcs = [
Expand All @@ -907,7 +953,7 @@ cc_test(
)

cc_gtest_unit_test(
name = "event_data_control_composite_unit_test",
name = "event_data_control_composite_test",
srcs = ["event_data_control_composite_test.cpp"],
features = COMPILER_WARNING_FEATURES,
deps = [
Expand Down Expand Up @@ -1170,7 +1216,7 @@ cc_gtest_unit_test(
":element_fq_id",
":event_meta_info",
":runtime_mock",
":shared_data_structures",
":service_data_storage",
"//score/mw/com/impl:binding_type",
"//score/mw/com/impl/test:runtime_mock_guard",
"@score_baselibs//score/memory/shared:map",
Expand Down Expand Up @@ -1213,7 +1259,7 @@ cc_gtest_unit_test(
],
features = COMPILER_WARNING_FEATURES,
deps = [
":proxy",
":slot_collector",
"//score/mw/com/impl/bindings/lola/test_doubles",
],
)
Expand All @@ -1226,6 +1272,7 @@ cc_gtest_unit_test(
features = COMPILER_WARNING_FEATURES,
deps = [
":event_data_control_test_resources",
":subscription_state_machine",
"//score/mw/com/impl/bindings/lola/test:proxy_event_test_resources",
"//score/mw/com/impl/bindings/lola/test:transaction_log_test_resources",
],
Expand All @@ -1238,6 +1285,7 @@ cc_gtest_unit_test(
],
features = COMPILER_WARNING_FEATURES,
deps = [
":subscription_state_machine",
"//score/mw/com/impl/bindings/lola/test:proxy_event_test_resources",
],
)
Expand All @@ -1249,7 +1297,7 @@ cc_gtest_unit_test(
],
features = COMPILER_WARNING_FEATURES,
deps = [
":proxy",
":subscription_state_machine",
],
)

Expand Down Expand Up @@ -1381,8 +1429,8 @@ cc_unit_test_suites_for_host_and_qnx(
":transaction_log_slot_test",
":transaction_log_test",
":dynamic_array_bounds_checking_test",
":event_data_control_unit_test",
":event_data_control_composite_unit_test",
":event_data_control_test",
":event_data_control_composite_test",
":generic_proxy_event_test",
":partial_restart_path_builder_test",
":proxy_instance_identifier_test",
Expand Down
4 changes: 2 additions & 2 deletions score/mw/com/impl/bindings/lola/event_data_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ template <template <class> class AtomicIndirectorType>
// coverity[autosar_cpp14_a15_5_3_violation : FALSE]
auto EventDataControlImpl<AtomicIndirectorType>::FindOldestUnusedSlot() noexcept -> ControlSlotIndicator
{
EventSlotStatus::EventTimeStamp oldest_time_stamp{EventSlotStatus::TIMESTSCORE_LANGUAGE_FUTURECPP_MAX};
EventSlotStatus::EventTimeStamp oldest_time_stamp{EventSlotStatus::TIMESTAMP_MAX};

ControlSlotIndicator selected_slot{};
// Suppress "AUTOSAR C++14 A5-2-2" finding rule. This rule states: "Traditional C-style casts shall not be used".
Expand Down Expand Up @@ -342,7 +342,7 @@ std::size_t EventDataControlImpl<AtomicIndirectorType>::GetNumNewEvents(
{
// coverity[autosar_cpp14_a5_3_2_violation]
const EventSlotStatus slot_status{slot.load(std::memory_order_relaxed)};
if (slot_status.IsTimeStampBetween(reference_time, EventSlotStatus::TIMESTSCORE_LANGUAGE_FUTURECPP_MAX))
if (slot_status.IsTimeStampBetween(reference_time, EventSlotStatus::TIMESTAMP_MAX))
{
// Suppress "AUTOSAR C++14 A4-7-1" rule finding. This rule states: "An integer expression shall not lead to
// loss.". This is a false positive as the maximum number of slots is std::uint16_t, so there is no case for
Expand Down
Loading
Loading