@@ -27,23 +27,22 @@ constexpr std::size_t MAX_MULTI_ALLOCATE_RETRY_COUNT{100U};
2727// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init): all members are initialized in the delegated constructor
2828template <template <class > class AtomicIndirectorType >
2929EventDataControlComposite<AtomicIndirectorType>::EventDataControlComposite(
30- SkeletonEventDataControlLocalView<>* const asil_qm_control_local,
30+ SkeletonEventDataControlLocalView<>& asil_qm_control_local,
3131 ProxyEventDataControlLocalView<>* const proxy_control_local)
3232 : EventDataControlComposite{asil_qm_control_local, nullptr , proxy_control_local}
3333{
3434}
3535
3636template <template <class > class AtomicIndirectorType >
3737EventDataControlComposite<AtomicIndirectorType>::EventDataControlComposite(
38- SkeletonEventDataControlLocalView<>* const asil_qm_control_local,
38+ SkeletonEventDataControlLocalView<>& asil_qm_control_local,
3939 SkeletonEventDataControlLocalView<>* const asil_b_control_local,
4040 ProxyEventDataControlLocalView<>* const proxy_control_local)
4141 : asil_qm_control_local_{asil_qm_control_local},
4242 asil_b_control_local_{asil_b_control_local},
4343 proxy_control_local_{proxy_control_local},
4444 ignore_qm_control_{false }
4545{
46- CheckForValidDataControls ();
4746}
4847
4948template <template <class > class AtomicIndirectorType >
@@ -82,7 +81,7 @@ auto EventDataControlComposite<AtomicIndirectorType>::GetNextFreeMultiSlot() con
8281 for (auto [current_index, it_slots_qm, it_slots_asil_b] = std::make_tuple (
8382 // coverity[autosar_cpp14_a5_2_2_violation]
8483 std::size_t {0U },
85- asil_qm_control_local_-> state_slots_ .begin (),
84+ asil_qm_control_local_. get (). state_slots_ .begin (),
8685 asil_b_control_local_->state_slots_ .begin ());
8786 current_index != asil_b_control_local_->state_slots_ .size ();
8887 // coverity[autosar_cpp14_m6_5_5_violation]
@@ -116,10 +115,7 @@ auto EventDataControlComposite<AtomicIndirectorType>::GetNextFreeMultiSlot() con
116115 {
117116 return {possible_index.value (), *qm_slot_ptr, *asil_b_slot_ptr};
118117 }
119- else
120- {
121- return {};
122- }
118+ return {};
123119}
124120
125121template <template <class > class AtomicIndirectorType >
@@ -196,7 +192,7 @@ auto EventDataControlComposite<AtomicIndirectorType>::AllocateNextSlot() noexcep
196192{
197193 if (asil_b_control_local_ == nullptr )
198194 {
199- auto qm_control_slot_indicator = asil_qm_control_local_-> AllocateNextSlot ();
195+ auto qm_control_slot_indicator = asil_qm_control_local_. get (). AllocateNextSlot ();
200196 if (qm_control_slot_indicator.IsValid ())
201197 {
202198 return {qm_control_slot_indicator.GetIndex (),
@@ -251,7 +247,7 @@ auto EventDataControlComposite<AtomicIndirectorType>::EventReady(ControlSlotComp
251247
252248 if (!ignore_qm_control_)
253249 {
254- asil_qm_control_local_-> EventReady ({slot_indicator.GetIndex (), slot_indicator.GetSlotQM ()}, time_stamp);
250+ asil_qm_control_local_. get (). EventReady ({slot_indicator.GetIndex (), slot_indicator.GetSlotQM ()}, time_stamp);
255251 }
256252}
257253
@@ -265,7 +261,7 @@ auto EventDataControlComposite<AtomicIndirectorType>::Discard(ControlSlotComposi
265261
266262 if (!ignore_qm_control_)
267263 {
268- asil_qm_control_local_-> Discard ({slot_indicator.GetIndex (), slot_indicator.GetSlotQM ()});
264+ asil_qm_control_local_. get (). Discard ({slot_indicator.GetIndex (), slot_indicator.GetSlotQM ()});
269265 }
270266}
271267
@@ -279,7 +275,7 @@ template <template <class> class AtomicIndirectorType>
279275SkeletonEventDataControlLocalView<>& EventDataControlComposite<AtomicIndirectorType>::GetQmEventDataControlLocal()
280276 const noexcept
281277{
282- return * asil_qm_control_local_;
278+ return asil_qm_control_local_;
283279}
284280
285281template <template <class > class AtomicIndirectorType >
@@ -290,7 +286,8 @@ EventDataControlComposite<AtomicIndirectorType>::GetAsilBEventDataControlLocal()
290286}
291287
292288template <template <class > class AtomicIndirectorType >
293- ProxyEventDataControlLocalView<>& EventDataControlComposite<AtomicIndirectorType>::GetProxyEventDataControlLocalView() noexcept
289+ ProxyEventDataControlLocalView<>&
290+ EventDataControlComposite<AtomicIndirectorType>::GetProxyEventDataControlLocalView() noexcept
294291{
295292 SCORE_LANGUAGE_FUTURECPP_PRECONDITION_PRD (proxy_control_local_ != nullptr );
296293 return *proxy_control_local_;
@@ -308,21 +305,12 @@ EventSlotStatus::EventTimeStamp EventDataControlComposite<AtomicIndirectorType>:
308305 }
309306 else
310307 {
311- const EventSlotStatus event_slot_status{(* asil_qm_control_local_)[slot]};
308+ const EventSlotStatus event_slot_status{asil_qm_control_local_. get ( )[slot]};
312309 const EventSlotStatus::EventTimeStamp sample_timestamp{event_slot_status.GetTimeStamp ()};
313310 return sample_timestamp;
314311 }
315312}
316313
317- template <template <class > class AtomicIndirectorType >
318- void EventDataControlComposite<AtomicIndirectorType>::CheckForValidDataControls() const noexcept
319- {
320- if (asil_qm_control_local_ == nullptr )
321- {
322- std::terminate ();
323- }
324- }
325-
326314template <template <class > class AtomicIndirectorType >
327315// Suppress "AUTOSAR C++14 A15-5-3" rule findings. This rule states: "The std::terminate() function shall not be called
328316// implicitly". std::terminate() is implicitly called from 'state_slots_[]' which might leds to a segmentation fault
@@ -332,17 +320,17 @@ template <template <class> class AtomicIndirectorType>
332320EventSlotStatus::EventTimeStamp EventDataControlComposite<AtomicIndirectorType>::GetLatestTimestamp() const noexcept
333321{
334322 EventSlotStatus::EventTimeStamp latest_time_stamp{1U };
335- SkeletonEventDataControlLocalView<>* control =
336- (asil_b_control_local_ != nullptr ) ? asil_b_control_local_ : asil_qm_control_local_;
323+ SkeletonEventDataControlLocalView<>& control =
324+ (asil_b_control_local_ != nullptr ) ? * asil_b_control_local_ : asil_qm_control_local_. get () ;
337325 for (SlotIndexType slot_index = 0U ;
338326 // Suppress "AUTOSAR C++14 A4-7-1" rule finding. This rule states: "An integer expression shall not lead to
339327 // loss.". As the maximum number of slots is std::uint16_t, so there is no case for a data loss here.
340328 // coverity[autosar_cpp14_a4_7_1_violation]
341- slot_index < static_cast <SlotIndexType>(control-> state_slots_ .size ());
329+ slot_index < static_cast <SlotIndexType>(control. state_slots_ .size ());
342330 ++slot_index)
343331 {
344- SCORE_LANGUAGE_FUTURECPP_ASSERT_PRD (static_cast <std::size_t >(slot_index) < control-> state_slots_ .size ());
345- const EventSlotStatus slot{control-> state_slots_ [slot_index].load (std::memory_order_acquire)};
332+ SCORE_LANGUAGE_FUTURECPP_ASSERT_PRD (static_cast <std::size_t >(slot_index) < control. state_slots_ .size ());
333+ const EventSlotStatus slot{control. state_slots_ [slot_index].load (std::memory_order_acquire)};
346334 if (!slot.IsInvalid () && !slot.IsInWriting ())
347335 {
348336 const auto slot_time_stamp = slot.GetTimeStamp ();
0 commit comments