QOpcUaHistoryData Class

This class stores historical data values from a node. More...

Header: #include <QOpcUaHistoryData>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
Since: Qt 6.3

Public Functions

QOpcUaHistoryData(const QString &nodeId)
QOpcUaHistoryData(const QOpcUaHistoryData &other)
void addValue(const QOpcUaDataValue &value)
int count() const
QString nodeId() const
QList<QOpcUaDataValue> result() const
void setNodeId(const QString &nodeId)
void setStatusCode(QOpcUa::UaStatusCode statusCode)
QOpcUa::UaStatusCode statusCode() const
void swap(QOpcUaHistoryData &other)
QOpcUaHistoryData &operator=(const QOpcUaHistoryData &other)

Detailed Description

When a request to read history data is being handled, instances of this class are used to store information about which node has been read, its values and the status code. The finished signal of a history read request will return a list of QOpcUaHistoryData objects which can be parsed to review the results of the request.

Member Function Documentation


Constructs an invalid history data item.

[explicit] QOpcUaHistoryData::QOpcUaHistoryData(const QString &nodeId)

Constructs a history data item and stores which node it corresponds to.

QOpcUaHistoryData::QOpcUaHistoryData(const QOpcUaHistoryData &other)

Constructs a history data item from other.

[noexcept] QOpcUaHistoryData::~QOpcUaHistoryData()

Destroys the history data item.

void QOpcUaHistoryData::addValue(const QOpcUaDataValue &value)

Adds a data value object given by value.

int QOpcUaHistoryData::count() const

Returns the number of available data value objects.

QString QOpcUaHistoryData::nodeId() const

Returns the nodeId of the node whose data has been stored.

See also setNodeId().

QList<QOpcUaDataValue> QOpcUaHistoryData::result() const

Returns the list of data value objects which contain the results of the history read request.

void QOpcUaHistoryData::setNodeId(const QString &nodeId)

Sets the nodeId to nodeId.

See also nodeId().

void QOpcUaHistoryData::setStatusCode(QOpcUa::UaStatusCode statusCode)

Sets the status code to statusCode.

See also statusCode().

QOpcUa::UaStatusCode QOpcUaHistoryData::statusCode() const

Returns the status code which indicates if an error occurred while fetching the history data.

See also setStatusCode().

[noexcept] void QOpcUaHistoryData::swap(QOpcUaHistoryData &other)

Swaps this data value instance with other. This function is very fast and never fails.

QOpcUaHistoryData &QOpcUaHistoryData::operator=(const QOpcUaHistoryData &other)

Sets the values from other in this history data item.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.