DDS  ver. 3.4
AgentConnectionManager.h
Go to the documentation of this file.
1 // Copyright 2014 GSI, Inc. All rights reserved.
2 //
3 //
4 //
5 
6 #ifndef __DDS__AGENT__AgentConnectionManager__
7 #define __DDS__AGENT__AgentConnectionManager__
8 
9 // DDS
10 #include "CommanderChannel.h"
11 #include "Options.h"
12 
13 namespace dds
14 {
15  namespace agent_cmd
16  {
17  class CAgentConnectionManager : public std::enable_shared_from_this<CAgentConnectionManager>
18  {
19  public:
20  CAgentConnectionManager(const SOptions_t& _options);
21  virtual ~CAgentConnectionManager();
22 
23  public:
24  void start();
25  void stop();
26 
27  private:
28  void startService(size_t _numThreads, size_t _numIntercomThreads);
29  void createCommanderChannel(uint64_t _protocolHeaderID);
30  void doAwaitStop();
31  void on_cmdSHUTDOWN(const protocol_api::SSenderInfo& _sender,
34 
35  private:
36  boost::asio::io_context m_context;
37  boost::asio::io_context m_intercomContext;
38  boost::thread_group m_workerThreads;
39 
40  CCommanderChannel::connectionPtr_t m_commanderChannel;
41 
42  boost::asio::signal_set m_signals;
43  SOptions_t m_options;
44  bool m_bStarted{ false };
45  };
46  } // namespace agent_cmd
47 } // namespace dds
48 
49 #endif /* defined(__DDS__AGENT__AgentConnectionManager__) */
void start()
Definition: AgentConnectionManager.cpp:52
std::shared_ptr< CCommanderChannel > connectionPtr_t
Definition: BaseChannelImpl.h:235
Definition: BaseEventHandlersImpl.h:48
virtual ~CAgentConnectionManager()
Definition: AgentConnectionManager.cpp:39
Definition: AgentConnectionManager.h:17
std::shared_ptr< SEmptyCmd > ptr_t
Definition: CommandAttachmentImpl.h:64
void stop()
Definition: AgentConnectionManager.cpp:80
std::weak_ptr< CCommanderChannel > weakConnectionPtr_t
Definition: BaseChannelImpl.h:236
Definition: AgentConnectionManager.h:13
dds-commander's container of options
Definition: dds-agent/src/Options.h:27
CAgentConnectionManager(const SOptions_t &_options)
Definition: AgentConnectionManager.cpp:23