open62541pp 0.15.0
C++ wrapper of open62541
|
#include <contextmap.hpp>
Thread-safe map for context objects.
Context objects are reference as void*
pointers in open62541 functions/callbacks. To prevent pointer-invalidation, the objects are stored as unique pointers. Stale objects will be removed when new objects are stored in the map.
Definition at line 35 of file contextmap.hpp.
Public Member Functions | |
Item * | operator[] (Key key) |
Item * | insert (Key key, std::unique_ptr< Item > &&item) |
size_t | erase (Key key) |
size_t | eraseStale () |
bool | contains (Key key) const |
const Item * | find (Key key) const |
auto | acquireLock () const |
const auto & | underlying () const noexcept |
|
inline |
Access or insert specified element.
Definition at line 38 of file contextmap.hpp.
|
inline |
Inserts an element or assigns to the current element if the key already exists.
Definition at line 49 of file contextmap.hpp.
|
inline |
Definition at line 55 of file contextmap.hpp.
|
inline |
Definition at line 60 of file contextmap.hpp.
Referenced by opcua::detail::ContextMap< Key, Item >::insert(), and opcua::detail::ContextMap< Key, Item >::operator[]().
|
inline |
Definition at line 75 of file contextmap.hpp.
|
inline |
Definition at line 80 of file contextmap.hpp.
|
inlinenodiscard |
Acquire the lock/mutex for unique access to the underlying map.
Definition at line 90 of file contextmap.hpp.
Referenced by opcua::detail::ContextMap< Key, Item >::contains(), opcua::detail::ContextMap< Key, Item >::erase(), opcua::detail::ContextMap< Key, Item >::eraseStale(), opcua::detail::ContextMap< Key, Item >::find(), opcua::detail::ContextMap< Key, Item >::insert(), and opcua::detail::ContextMap< Key, Item >::operator[]().
|
inlinenoexcept |
Get access to the underlying map. Use acquireLock
before any operation.
Definition at line 95 of file contextmap.hpp.