address_space_addon.cpp
Go to the documentation of this file.
1 
11 #include "address_space_addon.h"
12 
17 
18 #include <iostream>
19 
20 namespace OpcUa
21 {
22 namespace Internal
23 {
25 {
26 }
27 
29 {
30 }
31 
33 {
34  Logger = addons.GetLogger();
37  InternalServer->RegisterViewServices(Registry);
38  InternalServer->RegisterAttributeServices(Registry);
39  InternalServer->RegisterNodeManagementServices(Registry);
40  InternalServer->RegisterMethodServices(Registry);
41 }
42 
44 {
45  InternalServer->UnregisterViewServices();
46  InternalServer->UnregisterAttributeServices();
47  InternalServer->UnregisterNodeManagementServices();
48  InternalServer->UnregisterMethodServices();
49  InternalServer.reset();
50  Registry.reset();
51 }
52 
53 std::vector<AddNodesResult> AddressSpaceAddon::AddNodes(const std::vector<AddNodesItem> & items)
54 {
55  return Registry->AddNodes(items);
56 }
57 
58 std::vector<StatusCode> AddressSpaceAddon::AddReferences(const std::vector<AddReferencesItem> & items)
59 {
60  return Registry->AddReferences(items);
61 }
62 
63 std::vector<BrowseResult> AddressSpaceAddon::Browse(const OpcUa::NodesQuery & query) const
64 {
65  return Registry->Browse(query);
66 }
67 std::vector<BrowseResult> AddressSpaceAddon::BrowseNext() const
68 {
69  return Registry->BrowseNext();
70 }
71 
72 std::vector<BrowsePathResult> AddressSpaceAddon::TranslateBrowsePathsToNodeIds(const TranslateBrowsePathsParameters & params) const
73 {
74  return Registry->TranslateBrowsePathsToNodeIds(params);
75 }
76 
77 std::vector<NodeId> AddressSpaceAddon::RegisterNodes(const std::vector<NodeId> & params) const
78 {
79  return Registry->RegisterNodes(params);
80 }
81 
82 void AddressSpaceAddon::UnregisterNodes(const std::vector<NodeId> & params) const
83 {
84  return Registry->UnregisterNodes(params);
85 }
86 
87 std::vector<DataValue> AddressSpaceAddon::Read(const OpcUa::ReadParameters & filter) const
88 {
89  return Registry->Read(filter);
90 }
91 
92 std::vector<StatusCode> AddressSpaceAddon::Write(const std::vector<OpcUa::WriteValue> & filter)
93 {
94  return Registry->Write(filter);
95 }
96 
97 uint32_t AddressSpaceAddon::AddDataChangeCallback(const NodeId & node, AttributeId attribute, std::function<Server::DataChangeCallback> callback)
98 {
99  return Registry->AddDataChangeCallback(node, attribute, callback);
100 }
101 
103 {
104  return Registry->DeleteDataChangeCallback(clienthandle);
105 }
106 
107 StatusCode AddressSpaceAddon::SetValueCallback(const NodeId & node, AttributeId attribute, std::function<DataValue(void)> callback)
108 {
109  return Registry->SetValueCallback(node, attribute, callback);
110 }
111 
112 void AddressSpaceAddon::SetMethod(const NodeId & node, std::function<std::vector<OpcUa::Variant> (NodeId context, std::vector<OpcUa::Variant> arguments)> callback)
113 {
114  Registry->SetMethod(node, callback);
115  return;
116 }
117 
118 std::vector<CallMethodResult> AddressSpaceAddon::Call(const std::vector<CallMethodRequest> & methodsToCall)
119 {
120  return Registry->Call(methodsToCall);
121 }
122 
123 
124 } // namespace Internal
125 } // namespace OpcUa
126 
128 {
129  return Common::Addon::UniquePtr(new Internal::AddressSpaceAddon());
130 }
virtual void UnregisterNodes(const std::vector< NodeId > &params) const
virtual void DeleteDataChangeCallback(uint32_t clienthandle)
virtual const Logger::SharedPtr & GetLogger() const
Definition: addon_manager.h:90
Common::Logger::SharedPtr Logger
virtual std::vector< StatusCode > Write(const std::vector< OpcUa::WriteValue > &filter)
virtual std::shared_ptr< Addon > GetAddon(const AddonId &id) const =0
getting addon by id
virtual std::vector< DataValue > Read(const OpcUa::ReadParameters &filter) const
virtual void Initialize(Common::AddonsManager &addons, const Common::AddonParameters &params)
initialize addon.
virtual void SetMethod(const NodeId &node, std::function< std::vector< OpcUa::Variant >(NodeId context, std::vector< OpcUa::Variant > arguments)> callback)
virtual std::vector< NodeId > RegisterNodes(const std::vector< NodeId > &params) const
virtual std::vector< BrowsePathResult > TranslateBrowsePathsToNodeIds(const TranslateBrowsePathsParameters &params) const
const char ServicesRegistryAddonId[]
OpcUa::Server::AddressSpace::SharedPtr Registry
virtual void Stop()
Stopping addon work. After calling this method addon should throw exception on any calls...
virtual std::vector< StatusCode > AddReferences(const std::vector< AddReferencesItem > &items)
std::shared_ptr< OpcUa::Server::ServicesRegistry > InternalServer
virtual uint32_t AddDataChangeCallback(const NodeId &node, AttributeId attribute, std::function< Server::DataChangeCallback > callback)
virtual std::vector< BrowseResult > BrowseNext() const
virtual StatusCode SetValueCallback(const NodeId &node, AttributeId attribute, std::function< DataValue(void)> callback)
virtual std::vector< CallMethodResult > Call(const std::vector< CallMethodRequest > &methodsToCall)
OPC UA Address space part. GNU LGPL.
AddressSpace::UniquePtr CreateAddressSpace(const Common::Logger::SharedPtr &logger)
virtual std::vector< BrowseResult > Browse(const OpcUa::NodesQuery &query) const
virtual Common::Addon::UniquePtr CreateAddon()
Create instance of addon.
virtual std::vector< AddNodesResult > AddNodes(const std::vector< AddNodesItem > &items)


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