builtin_server_impl.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include "builtin_server_addon.h"
14 #include "builtin_server.h"
15 
17 
19 #include <opc/common/thread.h>
22 
23 #include <atomic>
24 #include <condition_variable>
25 #include <mutex>
26 #include <thread>
27 
28 
29 namespace OpcUa
30 {
31 namespace Impl
32 {
33 class BufferedInput;
34 
36  : public Common::Addon
37  , public Server::TcpServer
38  , public Server::BuiltinServer
39  , private Common::ThreadObserver
40 {
41 public:
42  BuiltinServerAddon(const Common::Logger::SharedPtr & logger = nullptr);
43  ~BuiltinServerAddon() override;
44 
45  OpcUa::Services::SharedPtr GetServices() const override;
46 
47 public: // Common::Addon
48  virtual void Initialize(Common::AddonsManager & addons, const Common::AddonParameters & params) override;
49  virtual void Stop() override;
50 
51 public: // TcpServer
52  virtual void Listen(const OpcUa::Server::TcpParameters & params, std::shared_ptr<OpcUa::Server::IncomingConnectionProcessor> processor) override;
53  virtual void StopListen(const OpcUa::Server::TcpParameters & params) override;
54 
55 private:
56  virtual void OnSuccess() override;
57  virtual void OnError(const std::exception & exc) override;
58 
59 private:
60  std::shared_ptr<BufferedInput> ClientInput;
61  std::shared_ptr<BufferedInput> ServerInput;
62 
63  std::shared_ptr<OpcUa::IOChannel> ClientChannel;
64  std::shared_ptr<OpcUa::IOChannel> ServerChannel;
65  std::unique_ptr<Common::Thread> Thread;
66 
67  OpcUa::Server::OpcUaProtocol::SharedPtr Protocol;
68 };
69 
70 } // namespace Impl
71 } // namespace OpcUa
std::shared_ptr< BufferedInput > ServerInput
std::unique_ptr< Common::Thread > Thread
std::shared_ptr< OpcUa::IOChannel > ClientChannel
virtual void Listen(const OpcUa::Server::TcpParameters &params, std::shared_ptr< OpcUa::Server::IncomingConnectionProcessor > processor) override
virtual void OnError(const std::exception &exc) override
Thread exited with error.
virtual void Initialize(Common::AddonsManager &addons, const Common::AddonParameters &params) override
initialize addon.
virtual void OnSuccess() override
thread exited with Success.
OpcUa::Server::OpcUaProtocol::SharedPtr Protocol
std::shared_ptr< OpcUa::IOChannel > ServerChannel
virtual void Stop() override
Stopping addon work. After calling this method addon should throw exception on any calls...
OPC UA Address space part. GNU LGPL.
OpcUa::Services::SharedPtr GetServices() const override
virtual void StopListen(const OpcUa::Server::TcpParameters &params) override
std::shared_ptr< BufferedInput > ClientInput
BuiltinServerAddon(const Common::Logger::SharedPtr &logger=nullptr)


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:06:04