CVB++ 14.0
Subscription Class Reference

An OPCUA Subscribe serves to monitor OPCUA variables (from a client) and provides a callback mechanism for changes. More...

#include <cvb/opcua/subscription.hpp>

Inherits enable_shared_from_this< Subscription >.

Public Member Functions

EventCookie AddMonitoredItem (const VariableNode &node, std::function< void()> callback)
 Adds a monitored item to an existing subscription. More...
 
void DeleteMonitoredItem (const EventCookie &cookie)
 Remove a monitored item from an existing subscription. More...
 

Detailed Description

An OPCUA Subscribe serves to monitor OPCUA variables (from a client) and provides a callback mechanism for changes.

Member Function Documentation

◆ AddMonitoredItem()

EventCookie AddMonitoredItem ( const VariableNode node,
std::function< void()>  callback 
)
inline

Adds a monitored item to an existing subscription.

Parameters
[in]nodeOPCUA Variable that should be monitored.
[in]callbackCallback function pointer that is called when the value of the OPCUA Monitored Item changes.
Returns
EventCookie for removal of monitored item
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.
Note
This function is specialized to monitor the value of OPCUA Variables.

◆ DeleteMonitoredItem()

void DeleteMonitoredItem ( const EventCookie cookie)
inline

Remove a monitored item from an existing subscription.

Note
This function is specialized to monitor the value of OPCUA Variables.
Parameters
[in]cookieEventCookie of the MonitoredItem
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.