Skip to content
Start free evaluation

pdcomm::opcua::buffer

Class

Owned, immutable byte buffer returned by the library.

class buffer : public owned

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

Holds a discovery result, a local address, a DataValue or (as response) a service response. The bytes stay valid after the client or server that produced them is closed or destroyed.

Notes

  • const member functions may be called from any thread.

Members

buffer

Constructor

Takes ownership of a buffer handle.

explicit buffer(pdcomm_opcua_handle handle) noexcept

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

Parameters

NameDescription
handleBuffer handle returned by the C ABI.

copy

Method

Copies the buffer contents.

std::vector<uint8_t> copy() const

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

Returns

The bytes, without a terminator.

Notes

  • Throws error: if the handle is empty or invalid.