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/IEventListener.h"
14 : #include "someip/SomeIpConstants.h"
15 : #include "someip/SomeIpParser.h"
16 : #include <ip/IPEndpoint.h>
17 :
18 : #include <cstdint>
19 :
20 : namespace someip
21 : {
22 : class IEventReceiver
23 : {
24 : public:
25 33 : IEventReceiver() = default;
26 : IEventReceiver(IEventReceiver const&) = delete;
27 : IEventReceiver& operator=(IEventReceiver const&) = delete;
28 :
29 : /**
30 : * Passes payload for an incoming SOME/IP event/notification to every
31 : * IServiceEventListener added to this receiver.
32 : *
33 : * \param serviceId ServiceID of the event/notification
34 : * \param eventId EventID of the event/notification
35 : * \param instanceId InstanceID of the event/notification
36 : * \param majorVersion majorVersion of the event/notification
37 : * \param parser Payload of the event/notification
38 : */
39 : virtual void eventReceived(
40 : service_id::type serviceId,
41 : uint16_t eventId,
42 : instance_id::type instanceId,
43 : major_version::type majorVersion,
44 : SomeIpParser& parser)
45 : = 0;
46 :
47 : /**
48 : * Adds IEventListener from IEventListener List
49 : *
50 : * \param listener IEventListener that has to be added
51 : */
52 : virtual void addEventListener(IEventListener& listener) = 0;
53 : /**
54 : * Removes IEventListener from IEventListener List
55 : *
56 : * \param listener IEventListener that has to be removed
57 : */
58 : virtual void removeEventListener(IEventListener& listener) = 0;
59 : };
60 :
61 : } // namespace someip
|