Diag-Client-Lib
Public Types | Public Member Functions | Private Attributes | List of all members
doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl Class Referencefinal

Class implements routing activation handler. More...

Collaboration diagram for doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl:
Collaboration graph
[legend]

Public Types

using RoutingActivationStateContext = utility::state::StateContext< RoutingActivationState >
 Type alias for state context. More...
 
using SyncTimer = utility::sync_timer::SyncTimer< std::chrono::steady_clock >
 Type alias for Sync timer. More...
 

Public Member Functions

 RoutingActivationHandlerImpl (sockets::TcpSocketHandler &tcp_socket_handler)
 Constructs an instance of RoutingActivationHandlerImpl. More...
 
void Start ()
 Function to start the handler. More...
 
void Stop ()
 Function to stop the handler. More...
 
void Reset ()
 Function to reset the handler. More...
 
auto GetStateContext () noexcept -> RoutingActivationStateContext &
 Function to get the Routing Activation State context. More...
 
auto GetSocketHandler () noexcept -> sockets::TcpSocketHandler &
 Function to get the socket handler. More...
 
auto GetSyncTimer () noexcept -> SyncTimer &
 Function to get the sync timer. More...
 

Private Attributes

sockets::TcpSocketHandlertcp_socket_handler_
 The reference to socket handler. More...
 
RoutingActivationStateContext state_context_
 Stores the routing activation states. More...
 
SyncTimer sync_timer_
 Store the synchronous timer. More...
 

Detailed Description

Class implements routing activation handler.

Definition at line 215 of file doip_routing_activation_handler.cpp.

Member Typedef Documentation

◆ RoutingActivationStateContext

Type alias for state context.

Definition at line 220 of file doip_routing_activation_handler.cpp.

◆ SyncTimer

Type alias for Sync timer.

Definition at line 225 of file doip_routing_activation_handler.cpp.

Constructor & Destructor Documentation

◆ RoutingActivationHandlerImpl()

doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl::RoutingActivationHandlerImpl ( sockets::TcpSocketHandler tcp_socket_handler)
inlineexplicit

Constructs an instance of RoutingActivationHandlerImpl.

Parameters
[in]tcp_socket_handlerThe reference to socket handler

Definition at line 232 of file doip_routing_activation_handler.cpp.

233  : tcp_socket_handler_{tcp_socket_handler},
234  state_context_{},
235  sync_timer_{} {
236  // create and add state for routing activation
237  // kIdle
238  state_context_.AddState(RoutingActivationState::kIdle, std::make_unique<kIdle>(RoutingActivationState::kIdle));
239  // kWaitForRoutingActivationRes
241  RoutingActivationState::kWaitForRoutingActivationRes,
242  std::make_unique<kWaitForRoutingActivationRes>(RoutingActivationState::kWaitForRoutingActivationRes));
243  // kRoutingActivationSuccessful
245  RoutingActivationState::kRoutingActivationSuccessful,
246  std::make_unique<kRoutingActivationSuccessful>(RoutingActivationState::kRoutingActivationSuccessful));
247  // kRoutingActivationFailed
249  RoutingActivationState::kRoutingActivationFailed,
250  std::make_unique<kRoutingActivationFailed>(RoutingActivationState::kRoutingActivationFailed));
251  // Transit to idle state
252  state_context_.TransitionTo(RoutingActivationState::kIdle);
253  }
void TransitionTo(EnumState state)
Definition: state.h:69
void AddState(EnumState state, std::unique_ptr< State< EnumState >> state_ptr)
Definition: state.h:58

References utility::state::StateContext< EnumState >::AddState(), state_context_, and utility::state::StateContext< EnumState >::TransitionTo().

Here is the call graph for this function:

Member Function Documentation

◆ GetSocketHandler()

auto doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl::GetSocketHandler ( ) -> sockets::TcpSocketHandler &
inlinenoexcept

Function to get the socket handler.

Returns
The reference to socket handler

Definition at line 285 of file doip_routing_activation_handler.cpp.

285 { return tcp_socket_handler_; }

References tcp_socket_handler_.

◆ GetStateContext()

auto doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl::GetStateContext ( ) -> RoutingActivationStateContext &
inlinenoexcept

Function to get the Routing Activation State context.

Returns
The reference to state context

Definition at line 279 of file doip_routing_activation_handler.cpp.

279 { return state_context_; }

References state_context_.

◆ GetSyncTimer()

auto doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl::GetSyncTimer ( ) -> SyncTimer &
inlinenoexcept

Function to get the sync timer.

Returns
The reference to sync timer

Definition at line 291 of file doip_routing_activation_handler.cpp.

291 { return sync_timer_; }

References sync_timer_.

◆ Reset()

void doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl::Reset ( )
inline

Function to reset the handler.

This will reset all the internal handler back to default state

Definition at line 273 of file doip_routing_activation_handler.cpp.

References Stop().

Here is the call graph for this function:

◆ Start()

void doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl::Start ( )
inline

Function to start the handler.

Definition at line 258 of file doip_routing_activation_handler.cpp.

258 {}

◆ Stop()

void doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl::Stop ( )
inline

Function to stop the handler.

This will reset all the internal handler back to default state

Definition at line 264 of file doip_routing_activation_handler.cpp.

264  {
266  state_context_.TransitionTo(RoutingActivationState::kIdle);
267  }
void CancelWait()
Function to cancel the synchronous wait.
Definition: sync_timer.h:90
auto IsTimerActive()
Function to query if timer is running.
Definition: sync_timer.h:82

References utility::sync_timer::SyncTimer< ClockType >::CancelWait(), utility::sync_timer::SyncTimer< ClockType >::IsTimerActive(), state_context_, sync_timer_, and utility::state::StateContext< EnumState >::TransitionTo().

Referenced by Reset().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ state_context_

RoutingActivationStateContext doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl::state_context_
private

Stores the routing activation states.

Definition at line 302 of file doip_routing_activation_handler.cpp.

Referenced by GetStateContext(), RoutingActivationHandlerImpl(), and Stop().

◆ sync_timer_

SyncTimer doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl::sync_timer_
private

Store the synchronous timer.

Definition at line 307 of file doip_routing_activation_handler.cpp.

Referenced by GetSyncTimer(), and Stop().

◆ tcp_socket_handler_

sockets::TcpSocketHandler& doip_client::channel::tcp_channel::RoutingActivationHandler::RoutingActivationHandlerImpl::tcp_socket_handler_
private

The reference to socket handler.

Definition at line 297 of file doip_routing_activation_handler.cpp.

Referenced by GetSocketHandler().


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