LCOV - code coverage report
Current view: top level - transport/src - LogicalAddress.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 12 12 100.0 %
Date: 2025-04-15 08:32:23 Functions: 2 2 100.0 %

          Line data    Source code
       1             : // Copyright 2024 Accenture.
       2             : 
       3             : #include "transport/LogicalAddress.h"
       4             : 
       5             : #include <algorithm>
       6             : 
       7             : namespace transport
       8             : {
       9             : namespace addressfinder
      10             : {
      11             : ::estd::optional<LogicalAddress>
      12           9 : findDoipAddressInSlice(uint16_t const address, ::estd::slice<LogicalAddress const> const& list)
      13             : {
      14           9 :     auto const iter = std::find_if(
      15             :         list.begin(),
      16             :         list.end(),
      17          22 :         [address](LogicalAddress const addr) -> bool { return addr.addressDoip == address; });
      18           9 :     if (iter != list.end())
      19             :     {
      20           4 :         return *iter;
      21             :     }
      22          20 :     return {};
      23             : }
      24             : 
      25             : ::estd::optional<LogicalAddress>
      26           9 : find8BitAddressInSlice(uint16_t const address, ::estd::slice<LogicalAddress const> const& list)
      27             : {
      28           9 :     auto const iter = std::find_if(
      29             :         list.begin(),
      30             :         list.end(),
      31          22 :         [address](LogicalAddress const addr) -> bool { return addr.address8Bit == address; });
      32           9 :     if (iter != list.end())
      33             :     {
      34           4 :         return *iter;
      35             :     }
      36          20 :     return {};
      37             : }
      38             : } // namespace addressfinder
      39             : } // namespace transport

Generated by: LCOV version 1.14