LCOV - code coverage report
Current view: top level - libs/bsw/cpp2someip/include/someip - IServiceAnnouncer.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 1 1
Test Date: 2026-09-11 12:05:06 Functions: 50.0 % 2 1

            Line data    Source code
       1              : /********************************************************************************
       2              :  * Copyright (c) 2026 Accenture
       3              :  *
       4              :  * This program and the accompanying materials are made available under the
       5              :  * terms of the Apache License Version 2.0 which is available at
       6              :  * https://www.apache.org/licenses/LICENSE-2.0
       7              :  *
       8              :  * SPDX-License-Identifier: Apache-2.0
       9              :  ********************************************************************************/
      10              : 
      11              : #pragma once
      12              : 
      13              : #include "someip/SomeIpConstants.h"
      14              : #include <cstdint>
      15              : 
      16              : namespace ip
      17              : {
      18              : struct IPAddress;
      19              : }
      20              : 
      21              : namespace someip
      22              : {
      23              : struct ServiceDescription;
      24              : 
      25              : class IServiceAnnouncer
      26              : {
      27              : public:
      28           92 :     virtual ~IServiceAnnouncer() = default;
      29              : 
      30              :     /**
      31              :      * Pure virtual lifecycle function that starts ServiceAnnouncer.
      32              :      */
      33              :     virtual void start() = 0;
      34              : 
      35              :     /**
      36              :      * Pure virtual lifecycle function that stops ServiceAnnouncer.
      37              :      */
      38              :     virtual void stop() = 0;
      39              : 
      40              :     /**
      41              :      * Pure virtual lifecycle function that responds to a request to
      42              :      * find a specific service.
      43              :      */
      44              :     virtual void respondToFindService(
      45              :         service_id::type serviceId,
      46              :         instance_id::type instanceId,
      47              :         major_version::type majorVersion,
      48              :         minor_version::type minorVersion,
      49              :         ttl::type ttl,
      50              :         ::ip::IPAddress const& sourceIpAddress,
      51              :         bool unicast)
      52              :         = 0;
      53              : 
      54              :     /**
      55              :      * Pure virtual function that tries to add a subscription
      56              :      * to a subscribers list.
      57              :      */
      58              :     virtual void respondToSubscribe(
      59              :         service_id::type serviceId,
      60              :         instance_id::type instanceId,
      61              :         major_version::type majorVersion,
      62              :         uint16_t reserved,
      63              :         eventgroup_id::type eventgroup,
      64              :         ttl::type ttl,
      65              :         ::ip::IPAddress const& sourceIpAddress,
      66              :         ::ip::IPAddress const& endpointIpAddress,
      67              :         uint16_t endpointPort,
      68              :         uint8_t endpointProto)
      69              :         = 0;
      70              : 
      71              :     /**
      72              :      * Pure virtual function that handles sending the subscribe
      73              :      * Ack message.
      74              :      */
      75              :     virtual void sendSubscribeAck(
      76              :         service_id::type serviceId,
      77              :         instance_id::type instanceId,
      78              :         eventgroup_id::type eventgroup,
      79              :         major_version::type majorVersion,
      80              :         uint16_t reserved,
      81              :         ttl::type ttl,
      82              :         ::ip::IPAddress const& sourceIpAddress)
      83              :         = 0;
      84              : 
      85              :     /**
      86              :      * Pure virtual function that handles sending the subscribe
      87              :      * Nack message.
      88              :      */
      89              :     virtual void sendSubscribeNack(
      90              :         service_id::type serviceId,
      91              :         instance_id::type instanceId,
      92              :         eventgroup_id::type eventgroup,
      93              :         major_version::type majorVersion,
      94              :         uint16_t reserved,
      95              :         ::ip::IPAddress const& sourceIpAddress)
      96              :         = 0;
      97              : 
      98              :     /**
      99              :      * Pure virtual function that handles sending the subscribe
     100              :      * Ack message over multicast IP address.
     101              :      */
     102              :     virtual void sendSubscribeAckMulticast(
     103              :         service_id::type serviceId,
     104              :         instance_id::type instanceId,
     105              :         eventgroup_id::type eventgroup,
     106              :         major_version::type majorVersion,
     107              :         uint16_t reserved,
     108              :         ttl::type ttl,
     109              :         ::ip::IPAddress const& endpointAddress,
     110              :         uint16_t endpointPort,
     111              :         ::ip::IPAddress const& sourceIpAddress)
     112              :         = 0;
     113              : 
     114              :     /**
     115              :      * Pure virtual function that handles the subscribe.
     116              :      */
     117              :     virtual void subscribe(ServiceDescription const& service, ::ip::IPAddress const& sourceAddress)
     118              :         = 0;
     119              : 
     120              :     /**
     121              :      * Pure virtual function that handles the unsubscribe.
     122              :      */
     123              :     virtual void
     124              :     unsubscribe(ServiceDescription const& service, ::ip::IPAddress const& sourceAddress)
     125              :         = 0;
     126              : 
     127              :     /**
     128              :      * Pure virtual function that handles finding a service.
     129              :      */
     130              :     virtual void find(ServiceDescription const& service) = 0;
     131              : 
     132              :     /**
     133              :      * Pure virtual function that handles offering a service.
     134              :      */
     135              :     virtual void offer(ServiceDescription const& service) = 0;
     136              : 
     137              :     /**
     138              :      * Pure virtual function that handles stopping offering a service.
     139              :      */
     140              :     virtual void stopOffer(ServiceDescription const& service) = 0;
     141              : 
     142              :     /**
     143              :      * Pure virtual function that triggers sending message to stop offer.
     144              :      */
     145              :     virtual void sendStopOffers() = 0;
     146              : };
     147              : 
     148              : } // namespace someip
        

Generated by: LCOV version 2.0-1