open62541pp 0.16.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
client_context.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <atomic>
5#include <cstdint>
6#include <functional>
7#include <memory>
8#include <utility> // pair
9#include <vector>
10
11#include "open62541pp/config.hpp"
15#include "open62541pp/detail/open62541/client.h" // UA_SessionState, UA_SecureChannelState
18
19namespace opcua::detail {
20
27inline constexpr size_t clientStateCount = 4;
28
29/**
30 * Internal storage for Client class.
31 */
34 std::atomic<bool> running{false};
35
36 std::vector<DataType> dataTypes;
37 std::unique_ptr<UA_DataTypeArray> dataTypeArray;
38
39#ifdef UA_ENABLE_SUBSCRIPTIONS
40 using SubId = uint32_t;
41 using MonId = uint32_t;
42 using SubMonId = std::pair<uint32_t, uint32_t>;
45#endif
46
47#if UAPP_OPEN62541_VER_LE(1, 0)
48 UA_ClientState lastClientState{};
49#else
52#endif
53 std::array<std::function<void()>, clientStateCount> stateCallbacks;
54 std::function<void()> inactivityCallback;
55};
56
57} // namespace opcua::detail
Thread-safe map for context objects.
Catch & store exceptions from user-defined callbacks in an exception-unaware context (open62541).
UA_SessionState
UA_SecureChannelState
constexpr size_t clientStateCount
Internal storage for Client class.
std::pair< uint32_t, uint32_t > SubMonId
std::function< void()> inactivityCallback
UA_SecureChannelState lastChannelState
std::vector< DataType > dataTypes
std::array< std::function< void()>, clientStateCount > stateCallbacks
std::unique_ptr< UA_DataTypeArray > dataTypeArray
ContextMap< SubMonId, services::detail::MonitoredItemContext > monitoredItems
ContextMap< SubId, services::detail::SubscriptionContext > subscriptions