binary_client_addon.cpp
Go to the documentation of this file.
1 
11 
12 #include <opc/ua/client/addon.h>
15 
16 #include <opc/common/uri_facade.h>
19 
20 
21 
22 namespace
23 {
24 class BinaryClientAddon : public OpcUa::Client::Addon
25 {
26 public:
27  virtual void Initialize(Common::AddonsManager & manager, const Common::AddonParameters & parameters)
28  {
29  /*
30  for (auto param = parameters.Parameters.begin(); param != parameters.Parameters.begin(); ++param)
31  {
32  if (param->Name == "debug" && param->Value != "false" && param->Value != "0")
33  {
34  Logger = manager.GetLogger();
35  }
36  }
37  */
38  Logger = manager.GetLogger();
39  }
40 
41  virtual void Stop()
42  {
43  }
44 
45 public:
46  virtual std::string GetProtocol() const
47  {
48  return "opc.tcp";
49  }
50 
51  virtual OpcUa::Services::SharedPtr Connect(const std::string & url)
52  {
53  return OpcUa::CreateBinaryClient(url, Logger);
54  }
55 
56 private:
57  Common::Logger::SharedPtr Logger;
58 };
59 }
60 
61 extern "C" Common::Addon * CreateAddon()
62 {
63  return new BinaryClientAddon();
64 }
virtual const Logger::SharedPtr & GetLogger() const
Definition: addon_manager.h:90
virtual void Stop()=0
Stopping addon work. After calling this method addon should throw exception on any calls...
virtual void Initialize(AddonsManager &manager, const AddonParameters &parameters)=0
initialize addon.
Services::SharedPtr CreateBinaryClient(IOChannel::SharedPtr channel, const SecureConnectionParams &params, const Common::Logger::SharedPtr &logger=nullptr)
Create server based on opc ua binary protocol.
url
Definition: setup.py:46
Common::Addon * CreateAddon()
Addon interface definition GNU LGPL.
virtual OpcUa::Services::SharedPtr Connect(const std::string &url)=0
virtual std::string GetProtocol() const =0


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