Line data Source code
1 : // Copyright 2024 Accenture. 2 : 3 : /** 4 : * Contains interface ICANFrameListener. 5 : * \file ICANFrameListener.h 6 : * \ingroup framemgmt 7 : */ 8 : #ifndef GUARD_3991843A_AE0E_493A_8A61_E4A780891238 9 : #define GUARD_3991843A_AE0E_493A_8A61_E4A780891238 10 : 11 : #include <estd/forward_list.h> 12 : 13 : namespace can 14 : { 15 : class CANFrame; 16 : class IFilter; 17 : 18 : /** 19 : * CANFrameListener interface 20 : * 21 : * 22 : * An ICANFrameListener subclass is a class interested in the reception 23 : * of CANFrames. Therefore it needs to register at an ICanTransceiver. 24 : */ 25 : class ICANFrameListener : public ::estd::forward_list_node<ICANFrameListener> 26 : { 27 : public: 28 : ICANFrameListener(); 29 : ICANFrameListener(ICANFrameListener const&) = delete; 30 : ICANFrameListener& operator=(ICANFrameListener const&) = delete; 31 : 32 : /** 33 : * This method notifies the listener of a CANFrame reception. 34 : */ 35 : virtual void frameReceived(CANFrame const& canFrame) = 0; 36 : 37 : /** 38 : * Returns the ICANFrameListeners filter. 39 : */ 40 : virtual IFilter& getFilter() = 0; 41 : }; 42 : 43 : /* 44 : * inline implementation 45 : */ 46 17 : inline ICANFrameListener::ICANFrameListener() : ::estd::forward_list_node<ICANFrameListener>() {} 47 : 48 : } // namespace can 49 : 50 : #endif // GUARD_3991843A_AE0E_493A_8A61_E4A780891238