Diag-Client-Lib
Public Member Functions | Private Attributes | List of all members
diag::client::dcm::DCMClient Class Referencefinal

Class to create Diagnostic Manager Client functionality. More...

#include <dcm_client.h>

Inheritance diagram for diag::client::dcm::DCMClient:
Inheritance graph
[legend]
Collaboration diagram for diag::client::dcm::DCMClient:
Collaboration graph
[legend]

Public Member Functions

 DCMClient (config_parser::DcmClientConfig dcm_client_config)
 Constructs an instance of DCMClient. More...
 
 DCMClient (const DCMClient &other) noexcept=delete
 Deleted copy assignment and copy constructor. More...
 
DCMClientoperator= (const DCMClient &other) noexcept=delete
 
 DCMClient (DCMClient &&other) noexcept=delete
 Deleted move assignment and move constructor. More...
 
DCMClientoperator= (DCMClient &&other) noexcept=delete
 
 ~DCMClient () noexcept override
 Destructs an instance of DCMClient. More...
 
void Initialize () noexcept override
 Function to initialize the DCMClient. More...
 
void Run () noexcept override
 Function to run DCMClient. More...
 
void Shutdown () noexcept override
 Function to shutdown the DCMClient. More...
 
conversation::DiagClientConversation GetDiagnosticClientConversation (std::string_view conversation_name) noexcept override
 Function to get required diag client conversation object based on conversation name. More...
 
core_type::Result< diag::client::vehicle_info::VehicleInfoMessageResponseUniquePtr, DiagClient::VehicleInfoResponseErrorSendVehicleIdentificationRequest (diag::client::vehicle_info::VehicleInfoListRequestType vehicle_info_request) noexcept override
 Function to send vehicle identification request and get the Diagnostic Server list. More...
 
- Public Member Functions inherited from diag::client::common::DiagnosticManager
 DiagnosticManager () noexcept
 Constructs an instance of DiagnosticManager. More...
 
 DiagnosticManager (const DiagnosticManager &other) noexcept=delete
 Deleted copy assignment and copy constructor. More...
 
DiagnosticManageroperator= (const DiagnosticManager &other) noexcept=delete
 
 DiagnosticManager (DiagnosticManager &&other) noexcept=delete
 Deleted move assignment and move constructor. More...
 
DiagnosticManageroperator= (DiagnosticManager &&other) noexcept=delete
 
virtual ~DiagnosticManager () noexcept
 Destructs an instance of DiagnosticManager. More...
 
virtual void Main () noexcept
 Function to manage the whole lifecycle of DiagnosticManager. More...
 
virtual Result< void > SignalShutdown () noexcept
 Function to initiate shutdown of DiagnosticManager. More...
 

Private Attributes

std::unique_ptr< uds_transport::UdsTransportProtocolManageruds_transport_protocol_mgr_
 Stores the uds transport protocol manager. More...
 
conversation_manager::ConversationManager conversation_mgr_
 Stores the conversation manager instance. More...
 
conversation::Conversationvehicle_discovery_conversation_
 Store the conversation for vehicle discovery. More...
 

Detailed Description

Class to create Diagnostic Manager Client functionality.

Definition at line 26 of file dcm_client.h.

Constructor & Destructor Documentation

◆ DCMClient() [1/3]

diag::client::dcm::DCMClient::DCMClient ( config_parser::DcmClientConfig  dcm_client_config)
explicit

Constructs an instance of DCMClient.

Parameters
[in]dcm_client_configThe configuration of dcm client

Definition at line 30 of file dcm_client.cpp.

32  uds_transport_protocol_mgr_{std::make_unique<uds_transport::UdsTransportProtocolManager>()},
33  conversation_mgr_{std::move(dcm_client_config), *uds_transport_protocol_mgr_},
35  // make the conversation manager reference available externally
37 }
DiagnosticManager() noexcept
Constructs an instance of DiagnosticManager.
diag::client::conversation::Conversation & GetDiagnosticClientConversation(std::string_view conversation_name) noexcept
Function to get DM conversation object based on conversation name.
std::unique_ptr< uds_transport::UdsTransportProtocolManager > uds_transport_protocol_mgr_
Stores the uds transport protocol manager.
Definition: dcm_client.h:91
conversation_manager::ConversationManager conversation_mgr_
Stores the conversation manager instance.
Definition: dcm_client.h:96
conversation::Conversation & vehicle_discovery_conversation_
Store the conversation for vehicle discovery.
Definition: dcm_client.h:101
std::optional< std::reference_wrapper< conversation_manager::ConversationManager > > conversation_manager_ref
Store the conversation manager reference optionally.
Definition: dcm_client.cpp:23
constexpr std::string_view VehicleDiscoveryConversation
Definition: dcm_client.cpp:28

References diag::client::dcm::anonymous_namespace{dcm_client.cpp}::conversation_manager_ref, and conversation_mgr_.

◆ DCMClient() [2/3]

diag::client::dcm::DCMClient::DCMClient ( const DCMClient other)
deletenoexcept

Deleted copy assignment and copy constructor.

◆ DCMClient() [3/3]

diag::client::dcm::DCMClient::DCMClient ( DCMClient &&  other)
deletenoexcept

Deleted move assignment and move constructor.

◆ ~DCMClient()

diag::client::dcm::DCMClient::~DCMClient ( )
overridedefaultnoexcept

Destructs an instance of DCMClient.

Member Function Documentation

◆ GetDiagnosticClientConversation()

conversation::DiagClientConversation diag::client::dcm::DCMClient::GetDiagnosticClientConversation ( std::string_view  conversation_name)
overridevirtualnoexcept

Function to get required diag client conversation object based on conversation name.

Parameters
[in]conversation_nameName of conversation configured as json parameter "ConversationName"
Returns
Diag client conversation object as per passed conversation name

Implements diag::client::common::DiagnosticManager.

Definition at line 72 of file dcm_client.cpp.

73  {
74  return conversation::DiagClientConversation{conversation_name};
75 }

◆ Initialize()

void diag::client::dcm::DCMClient::Initialize ( )
overridevirtualnoexcept

Function to initialize the DCMClient.

Implements diag::client::common::DiagnosticManager.

Definition at line 41 of file dcm_client.cpp.

41  {
42  // start Conversation Manager
44  // start all the udsTransportProtocol Layer
45  uds_transport_protocol_mgr_->Startup();
46  // start Vehicle Discovery
48 
50  __FILE__, __LINE__, __func__, [](std::stringstream &msg) { msg << "Dcm Client Initialized"; });
51 }
virtual void Startup() noexcept=0
Function to start the Conversation.
void Startup() noexcept
Function to start the ConversationManager.
static auto GetDiagClientLogger() noexcept -> DiagClientLogger &
Get the diag client logger instance.
Definition: logger.h:32

References diag::client::logger::DiagClientLogger::GetDiagClientLogger().

Here is the call graph for this function:

◆ operator=() [1/2]

DCMClient& diag::client::dcm::DCMClient::operator= ( const DCMClient other)
deletenoexcept

◆ operator=() [2/2]

DCMClient& diag::client::dcm::DCMClient::operator= ( DCMClient &&  other)
deletenoexcept

◆ Run()

void diag::client::dcm::DCMClient::Run ( )
overridevirtualnoexcept

Function to run DCMClient.

Implements diag::client::common::DiagnosticManager.

Definition at line 53 of file dcm_client.cpp.

53  {
54  // run udsTransportProtocol layer
57  __FILE__, __LINE__, __func__, [](std::stringstream &msg) { msg << "Dcm Client is ready to serve"; });
58 }

References diag::client::logger::DiagClientLogger::GetDiagClientLogger(), and uds_transport_protocol_mgr_.

Here is the call graph for this function:

◆ SendVehicleIdentificationRequest()

core_type::Result< diag::client::vehicle_info::VehicleInfoMessageResponseUniquePtr, DiagClient::VehicleInfoResponseError > diag::client::dcm::DCMClient::SendVehicleIdentificationRequest ( diag::client::vehicle_info::VehicleInfoListRequestType  vehicle_info_request)
overridevirtualnoexcept

Function to send vehicle identification request and get the Diagnostic Server list.

Parameters
[in]vehicle_info_requestVehicle information sent along with request
Returns
Result containing available vehicle information response on success, VehicleResponseErrorCode on error

Implements diag::client::common::DiagnosticManager.

Definition at line 78 of file dcm_client.cpp.

79  {
81 }
virtual core_type::Result< diag::client::vehicle_info::VehicleInfoMessageResponseUniquePtr, DiagClient::VehicleInfoResponseError > SendVehicleIdentificationRequest(vehicle_info::VehicleInfoListRequestType) noexcept
Function to send vehicle identification request and get the Diagnostic Server list.
Definition: conversation.h:171

◆ Shutdown()

void diag::client::dcm::DCMClient::Shutdown ( )
overridevirtualnoexcept

Function to shutdown the DCMClient.

Implements diag::client::common::DiagnosticManager.

Definition at line 60 of file dcm_client.cpp.

60  {
61  // shutdown Vehicle Discovery
63  // shutdown udsTransportProtocol layer
64  uds_transport_protocol_mgr_->Shutdown();
65  // shutdown Conversation Manager
67 
69  __FILE__, __LINE__, __func__, [](std::stringstream &msg) { msg << "Dcm Client Shutdown completed"; });
70 }
virtual void Shutdown() noexcept=0
Function to shutdown the Conversation.
void Shutdown() noexcept
Function to shutdown the ConversationManager.

References conversation_mgr_, diag::client::logger::DiagClientLogger::GetDiagClientLogger(), diag::client::conversation_manager::ConversationManager::Shutdown(), diag::client::conversation::Conversation::Shutdown(), uds_transport_protocol_mgr_, and vehicle_discovery_conversation_.

Here is the call graph for this function:

Member Data Documentation

◆ conversation_mgr_

conversation_manager::ConversationManager diag::client::dcm::DCMClient::conversation_mgr_
private

Stores the conversation manager instance.

Definition at line 96 of file dcm_client.h.

Referenced by DCMClient(), and Shutdown().

◆ uds_transport_protocol_mgr_

std::unique_ptr<uds_transport::UdsTransportProtocolManager> diag::client::dcm::DCMClient::uds_transport_protocol_mgr_
private

Stores the uds transport protocol manager.

Definition at line 91 of file dcm_client.h.

Referenced by Run(), and Shutdown().

◆ vehicle_discovery_conversation_

conversation::Conversation& diag::client::dcm::DCMClient::vehicle_discovery_conversation_
private

Store the conversation for vehicle discovery.

Definition at line 101 of file dcm_client.h.

Referenced by Shutdown().


The documentation for this class was generated from the following files: