Skip to content
Start free evaluation

pdcomm::opcua::owned

Class

Move-only owner of one ::pdcomm_opcua_handle; base of every wrapper.

class owned

Declared in: #include <pdcomm/opcua/pdcomm_opcua.hpp>

The destructor and reset() release a non-zero handle with pdcomm_opcua_release(). A default-constructed or moved-from object is empty, and calling a member function on it throws error with #PDCOMM_OPCUA_INVALID_HANDLE.

Members

operator=

Method

Copy assignment is disabled: a handle has exactly one owner.

owned& operator=(const owned&) = delete

Declared in: #include <pdcomm/opcua/pdcomm_opcua.hpp>

operator=

Method

Releases the current handle, then takes ownership from other.

owned& operator=(owned&& other) noexcept

Declared in: #include <pdcomm/opcua/pdcomm_opcua.hpp>

Parameters

NameDescription
otherOwner to move from; it becomes empty.

Returns

This owner.

owned

Constructor

Creates an empty owner.

owned() noexcept = default

Declared in: #include <pdcomm/opcua/pdcomm_opcua.hpp>

owned

Constructor

Copying is disabled: a handle has exactly one owner.

owned(const owned&) = delete

Declared in: #include <pdcomm/opcua/pdcomm_opcua.hpp>

owned

Constructor

Moves ownership; other becomes empty.

owned(owned&& other) noexcept

Declared in: #include <pdcomm/opcua/pdcomm_opcua.hpp>

Parameters

NameDescription
otherOwner to move from.

reset

Method

Releases the owned handle now and leaves the object empty.

void reset() noexcept

Declared in: #include <pdcomm/opcua/pdcomm_opcua.hpp>

For an open client this aborts the socket without CloseSession; call client::close() first for an orderly shutdown.

~owned

Method

Releases the owned handle, if any.

~owned()

Declared in: #include <pdcomm/opcua/pdcomm_opcua.hpp>