DDS  ver. 3.4
TestChannel.h
Go to the documentation of this file.
1 // Copyright 2014 GSI, Inc. All rights reserved.
2 //
3 //
4 //
5 #ifndef __DDS__TestChannel__
6 #define __DDS__TestChannel__
7 // DDS
8 #include "ClientChannelImpl.h"
9 #include "Options.h"
10 
11 namespace dds
12 {
13  namespace test_cmd
14  {
16  {
17  CTestChannel(boost::asio::io_context& _service, uint64_t _protocolHeaderID)
18  : CClientChannelImpl<CTestChannel>(_service, protocol_api::EChannelType::UI, _protocolHeaderID)
19  {
20  registerHandler<protocol_api::EChannelEvents::OnRemoteEndDissconnected>(
21  [this](const protocol_api::SSenderInfo& _sender) {
22  LOG(MiscCommon::info) << "The Agent [" << this->socket().remote_endpoint().address().to_string()
23  << "] has closed the connection.";
24  });
25 
26  registerHandler<protocol_api::EChannelEvents::OnHandshakeOK>(
27  [this](const protocol_api::SSenderInfo& _sender) { pushMsg<protocol_api::cmdTRANSPORT_TEST>(); });
28  }
29 
31 
32  public:
34  MESSAGE_HANDLER(cmdSIMPLE_MSG, on_cmdSIMPLE_MSG)
35  MESSAGE_HANDLER(cmdSHUTDOWN, on_cmdSHUTDOWN)
36  MESSAGE_HANDLER(cmdPROGRESS, on_cmdPROGRESS)
38 
39  void setOptions(const SOptions& _options)
40  {
41  m_options = _options;
42  }
43 
44  private:
45  // Message Handlers
47  const protocol_api::SSenderInfo& _sender);
49  const protocol_api::SSenderInfo& _sender);
51  const protocol_api::SSenderInfo& _sender);
52 
53  private:
54  SOptions m_options;
55  };
56  } // namespace test_cmd
57 } // namespace dds
58 #endif /* defined(__DDS__TestChannel__) */
Definition: BaseEventHandlersImpl.h:48
#define REGISTER_DEFAULT_REMOTE_ID_STRING
Definition: BaseChannelImpl.h:190
dds-getlog's container of options
Definition: dds-test/src/Options.h:23
Definition: TestChannel.h:15
Definition: ProtocolDef.h:19
std::shared_ptr< SEmptyCmd > ptr_t
Definition: CommandAttachmentImpl.h:64
Definition: ProtocolCommands.h:30
#define LOG(severity)
Definition: Logger.h:56
Definition: ProtocolCommands.h:58
Definition: ProtocolCommands.h:33
Definition: AgentConnectionManager.h:13
on_cmdSIMPLE_MSG MESSAGE_HANDLER(cmdSHUTDOWN, on_cmdSHUTDOWN) MESSAGE_HANDLER(cmdPROGRESS
BEGIN_MSG_MAP(CTestChannel) MESSAGE_HANDLER(cmdSIMPLE_MSG
Definition: BaseChannelImpl.h:40
boost::asio::ip::tcp::socket & socket()
Definition: BaseChannelImpl.h:326
Definition: def.h:150
on_cmdSIMPLE_MSG on_cmdPROGRESS END_MSG_MAP() void setOptions(const SOptions &_options)
Definition: TestChannel.h:37