subscription_service_internal.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "address_space_addon.h"
13 #include "internal_subscription.h"
14 
15 
18 #include <opc/ua/event.h>
22 
23 #include <boost/asio.hpp>
24 #include <boost/thread/shared_mutex.hpp>
25 #include <ctime>
26 #include <limits>
27 #include <list>
28 #include <map>
29 #include <queue>
30 #include <deque>
31 #include <set>
32 #include <thread>
33 
34 namespace OpcUa
35 {
36 namespace Internal
37 {
38 
39 class InternalSubscription;
40 
41 typedef std::map <uint32_t, std::shared_ptr<InternalSubscription>> SubscriptionsIdMap; // Map SubscptioinId, SubscriptionData
42 
43 
45 {
46 public:
47  SubscriptionServiceInternal(Server::AddressSpace::SharedPtr addressspace, boost::asio::io_service & io, const Common::Logger::SharedPtr & logger);
48 
50 
51  virtual std::vector<StatusCode> DeleteSubscriptions(const std::vector<uint32_t> & subscriptions);
53  virtual SubscriptionData CreateSubscription(const CreateSubscriptionRequest & request, std::function<void (PublishResult)> callback);
54  virtual std::vector<MonitoredItemCreateResult> CreateMonitoredItems(const MonitoredItemsParameters & params);
55  virtual std::vector<StatusCode> DeleteMonitoredItems(const DeleteMonitoredItemsParameters & params);
56  virtual void Publish(const PublishRequest & request);
57  virtual RepublishResponse Republish(const RepublishParameters & request);
58 
60  boost::asio::io_service & GetIOService();
61  bool PopPublishRequest(NodeId node);
62  void TriggerEvent(NodeId node, Event event);
64 
65 private:
66  boost::asio::io_service & io;
67  Server::AddressSpace::SharedPtr AddressSpace;
68  Common::Logger::SharedPtr Logger;
69  mutable boost::shared_mutex DbMutex;
70  SubscriptionsIdMap SubscriptionsMap; // Map SubscptioinId, SubscriptionData
71  uint32_t LastSubscriptionId = 2;
72  std::map<NodeId, uint32_t> PublishRequestQueues;
73 };
74 
75 
76 }
77 
78 }
79 
virtual SubscriptionData CreateSubscription(const CreateSubscriptionRequest &request, std::function< void(PublishResult)> callback)
SubscriptionServiceInternal(Server::AddressSpace::SharedPtr addressspace, boost::asio::io_service &io, const Common::Logger::SharedPtr &logger)
virtual RepublishResponse Republish(const RepublishParameters &request)
OPC UA Address space part. GNU LGPL.
virtual std::vector< StatusCode > DeleteSubscriptions(const std::vector< uint32_t > &subscriptions)
std::map< IntegerId, std::shared_ptr< InternalSubscription > > SubscriptionsIdMap
virtual std::vector< MonitoredItemCreateResult > CreateMonitoredItems(const MonitoredItemsParameters &params)
virtual std::vector< StatusCode > DeleteMonitoredItems(const DeleteMonitoredItemsParameters &params)
virtual ModifySubscriptionResponse ModifySubscription(const ModifySubscriptionParameters &parameters)
virtual void Publish(const PublishRequest &request)


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