opc_tcp_processor.h
Go to the documentation of this file.
1 
11 #include <opc/common/logger.h>
15 
16 #include <chrono>
17 #include <list>
18 #include <mutex>
19 #include <queue>
20 
21 namespace OpcUa
22 {
23 namespace Server
24 {
25 
26 class OpcTcpMessages: public std::enable_shared_from_this<OpcTcpMessages>
27 {
28 public:
30 
31 public:
32  OpcTcpMessages(OpcUa::Services::SharedPtr server, OpcUa::OutputChannel::SharedPtr outputChannel, const Common::Logger::SharedPtr & logger);
34 
36 
37 private:
38  void HelloClient(Binary::IStreamBinary & istream, Binary::OStreamBinary & ostream);
39  void OpenChannel(Binary::IStreamBinary & istream, Binary::OStreamBinary & ostream);
40  void CloseChannel(Binary::IStreamBinary & istream);
42  void FillResponseHeader(const RequestHeader & requestHeader, ResponseHeader & responseHeader);
43  void DeleteSubscriptions(const std::vector<uint32_t> & ids);
45  void ForwardPublishResponse(const PublishResult response);
46 
47 private:
48  std::mutex ProcessMutex;
49  OpcUa::Services::SharedPtr Server;
50  OpcUa::OutputChannel::WeakPtr OutputChannel;
52  Common::Logger::SharedPtr Logger;
53  uint32_t ChannelId;
54  uint32_t TokenId;
56  //ExpandedNodeId AuthenticationToken;
57  uint32_t SequenceNb;
58 
60  {
64  };
65 
66  std::list<uint32_t> Subscriptions; //Keep a list of subscriptions to query internal server at correct rate
68  std::queue<PublishRequestElement> PublishRequestQueue; //Keep track of request data to answer them when we have data and
69 };
70 
71 
72 } // namespace UaServer
73 } // namespace OpcUa
void CloseChannel(Binary::IStreamBinary &istream)
bool ProcessMessage(Binary::MessageType msgType, Binary::IStreamBinary &iStream)
void FillResponseHeader(const RequestHeader &requestHeader, ResponseHeader &responseHeader)
OpcUa::Binary::OStreamBinary OutputStream
Common::Logger::SharedPtr Logger
OpcUa::Services::SharedPtr Server
OPC UA Address space part. GNU LGPL.
OpcUa::OutputChannel::WeakPtr OutputChannel
void ForwardPublishResponse(const PublishResult response)
#define DEFINE_CLASS_POINTERS(ClassName)
Exception declarations GNU LGPL.
void OpenChannel(Binary::IStreamBinary &istream, Binary::OStreamBinary &ostream)
std::queue< PublishRequestElement > PublishRequestQueue
OpcTcpMessages(OpcUa::Services::SharedPtr server, OpcUa::OutputChannel::SharedPtr outputChannel, const Common::Logger::SharedPtr &logger)
void DeleteSubscriptions(const std::vector< uint32_t > &ids)
std::list< uint32_t > Subscriptions
void ProcessRequest(Binary::IStreamBinary &istream, Binary::OStreamBinary &ostream)
const char Server[]
Definition: strings.h:121
Definition: server.py:1
void HelloClient(Binary::IStreamBinary &istream, Binary::OStreamBinary &ostream)


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