open62541pp 0.16.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
CreateSubscription service
Collaboration diagram for CreateSubscription service:

Detailed Description

Create subscriptions.

Subscriptions monitor a set of monitored items for notifications and return them to the client.

See also
https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13.2

Namespaces

namespace  opcua::services::detail
 

Typedefs

using opcua::services::DeleteSubscriptionCallback = std::function<void(uint32_t subId)>
 
using opcua::services::StatusChangeNotificationCallback
 

Functions

CreateSubscriptionResponse opcua::services::createSubscription (Client &connection, const CreateSubscriptionRequest &request, StatusChangeNotificationCallback statusChangeCallback, DeleteSubscriptionCallback deleteCallback)
 
CreateSubscriptionResponse opcua::services::createSubscription (Client &connection, const SubscriptionParameters &parameters, bool publishingEnabled, StatusChangeNotificationCallback statusChangeCallback, DeleteSubscriptionCallback deleteCallback) noexcept
 
template<typename CompletionToken >
auto opcua::services::createSubscriptionAsync (Client &connection, const CreateSubscriptionRequest &request, StatusChangeNotificationCallback statusChangeCallback, DeleteSubscriptionCallback deleteCallback, CompletionToken &&token)
 
template<typename CompletionToken >
auto opcua::services::createSubscriptionAsync (Client &connection, const SubscriptionParameters &parameters, bool publishingEnabled, StatusChangeNotificationCallback statusChangeCallback, DeleteSubscriptionCallback deleteCallback, CompletionToken &&token)
 

Typedef Documentation

◆ DeleteSubscriptionCallback

using opcua::services::DeleteSubscriptionCallback = std::function<void(uint32_t subId)>

Subscription deletion callback.

Parameters
subIdSubscription identifier

Definition at line 71 of file subscription.hpp.

◆ StatusChangeNotificationCallback

Initial value:
std::function<void(uint32_t subId, StatusChangeNotification& notification)>

Subscription status change notification callback.

Parameters
subIdSubscription identifier
notificationStatus change notification

Definition at line 78 of file subscription.hpp.

Function Documentation

◆ createSubscription() [1/2]

CreateSubscriptionResponse opcua::services::createSubscription ( Client & connection,
const CreateSubscriptionRequest & request,
StatusChangeNotificationCallback statusChangeCallback,
DeleteSubscriptionCallback deleteCallback )
nodiscard

Create a subscription.

Parameters
connectionInstance of type Client
requestCreate subscription request
statusChangeCallbackInvoked when the status of a subscription is changed
deleteCallbackInvoked when the subscription is deleted

◆ createSubscription() [2/2]

CreateSubscriptionResponse opcua::services::createSubscription ( Client & connection,
const SubscriptionParameters & parameters,
bool publishingEnabled,
StatusChangeNotificationCallback statusChangeCallback,
DeleteSubscriptionCallback deleteCallback )
nodiscardnoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ createSubscriptionAsync() [1/2]

template<typename CompletionToken >
auto opcua::services::createSubscriptionAsync ( Client & connection,
const CreateSubscriptionRequest & request,
StatusChangeNotificationCallback statusChangeCallback,
DeleteSubscriptionCallback deleteCallback,
CompletionToken && token )

Create a subscription.

Parameters
connectionInstance of type Client
requestCreate subscription request
statusChangeCallbackInvoked when the status of a subscription is changed
deleteCallbackInvoked when the subscription is deleted
tokenThe completion token that will be used to produce a completion handler, which will be called when the operation completes. Potential completion tokens include useFuture, useDeferred, useDetached, or a function (object) with the correct completion signature. The function signature of the completion handler must be:
UA_CreateSubscriptionResponse wrapper class.
Returns
Examples
client_async.cpp.

Definition at line 124 of file subscription.hpp.

Referenced by opcua::services::createSubscriptionAsync().

◆ createSubscriptionAsync() [2/2]

template<typename CompletionToken >
auto opcua::services::createSubscriptionAsync ( Client & connection,
const SubscriptionParameters & parameters,
bool publishingEnabled,
StatusChangeNotificationCallback statusChangeCallback,
DeleteSubscriptionCallback deleteCallback,
CompletionToken && token )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 163 of file subscription.hpp.