Diag-Client-Lib
conversation_handler.h
Go to the documentation of this file.
1 /* Diagnostic Client library
2  * Copyright (C) 2024 Avijit Dey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8 #ifndef DIAGNOSTIC_CLIENT_LIB_LIB_UDS_TRANSPORT_LAYER_API_UDS_TRANSPORT_CONVERSATION_H
9 #define DIAGNOSTIC_CLIENT_LIB_LIB_UDS_TRANSPORT_LAYER_API_UDS_TRANSPORT_CONVERSATION_H
10 /* includes */
11 #include "core/include/span.h"
13 
14 namespace uds_transport {
15 
20  public:
27 
31  ConversionHandler(const ConversionHandler &other) noexcept = default;
32  ConversionHandler &operator=(const ConversionHandler &other) noexcept = default;
33 
37  ConversionHandler(ConversionHandler &&other) noexcept = default;
38  ConversionHandler &operator=(ConversionHandler &&other) noexcept = default;
39 
43  virtual ~ConversionHandler() noexcept = default;
44 
70  virtual std::pair<UdsTransportProtocolMgr::IndicationResult, UdsMessagePtr> IndicateMessage(
71  UdsMessage::Address source_addr, UdsMessage::Address target_addr, UdsMessage::TargetAddressType type,
72  ChannelID channel_id, std::size_t size, Priority priority, ProtocolKind protocol_kind,
73  core_type::Span<std::uint8_t> payload_info) const noexcept = 0;
74 
81  virtual void HandleMessage(UdsMessagePtr message) const noexcept = 0;
82 
83  protected:
87  conversion_manager::ConversionHandlerID handler_id_;
88 };
89 } // namespace uds_transport
90 #endif // DIAGNOSTIC_CLIENT_LIB_LIB_UDS_TRANSPORT_LAYER_API_UDS_TRANSPORT_CONVERSATION_H
Class to manage reception from transport protocol handler to connection handler.
ConversionHandler & operator=(ConversionHandler &&other) noexcept=default
virtual ~ConversionHandler() noexcept=default
Destructs an instance of ConversionHandler.
ConversionHandler(conversion_manager::ConversionHandlerID handler_id)
Constructs an instance of ConversionHandler.
ConversionHandler & operator=(const ConversionHandler &other) noexcept=default
conversion_manager::ConversionHandlerID handler_id_
Store the conversation handle id.
virtual void HandleMessage(UdsMessagePtr message) const noexcept=0
Function to Hands over a valid received Uds message.
ConversionHandler(const ConversionHandler &other) noexcept=default
Default copy assignment and copy constructor.
ConversionHandler(ConversionHandler &&other) noexcept=default
Default move assignment and move constructor.
virtual std::pair< UdsTransportProtocolMgr::IndicationResult, UdsMessagePtr > IndicateMessage(UdsMessage::Address source_addr, UdsMessage::Address target_addr, UdsMessage::TargetAddressType type, ChannelID channel_id, std::size_t size, Priority priority, ProtocolKind protocol_kind, core_type::Span< std::uint8_t > payload_info) const noexcept=0
Function to indicate a start of reception of message.
Span(T(&)[N]) -> Span< T, N >
std::string_view ProtocolKind
std::unique_ptr< UdsMessage > UdsMessagePtr
Definition: uds_message.h:71
uint32_t ChannelID
std::uint8_t Priority