QExtensionObject Class

(QOpcUa::QExtensionObject)

The OPC UA ExtensionObject. More...

Header: #include <QExtensionObject>
qmake: QT += opcua

Public Types

enum Encoding { NoBody, ByteString, Xml }

Public Functions

QExtensionObject()
QExtensionObject(const QOpcUa::QExtensionObject &rhs)
~QExtensionObject()
QByteArray encodedBody() const
QByteArray &encodedBodyRef()
QOpcUa::QExtensionObject::Encoding encoding() const
QString encodingTypeId() const
void setEncodedBody(const QByteArray &encodedBody)
void setEncoding(QOpcUa::QExtensionObject::Encoding encoding)
void setEncodingTypeId(const QString &encodingTypeId)
QVariant operator QVariant() const
QOpcUa::QExtensionObject &operator=(const QOpcUa::QExtensionObject &rhs)
bool operator==(const QOpcUa::QExtensionObject &rhs) const

Detailed Description

The OPC UA ExtensionObject.

This is the Qt OPC UA representation for an extension object. Extension objects are used as a container in OPC UA whenever a non-builtin type is stored in a Variant. It contains information about the type and encoding of the data as well as the data itself encoded with one of the encodings specified in OPC-UA part 6. Decoders are supposed to decode extension objects if they can handle the type. If the type is not supported by the decoder, the extension object is not decoded and decoding is left to the user.

Member Type Documentation

enum QExtensionObject::Encoding

Enumerates the possible encodings of the body.

ConstantValue
QOpcUa::QExtensionObject::NoBody0
QOpcUa::QExtensionObject::ByteString1
QOpcUa::QExtensionObject::Xml2

Member Function Documentation

QExtensionObject::QExtensionObject()

Default constructs an instance of QExtensionObject.

QExtensionObject::QExtensionObject(const QOpcUa::QExtensionObject &rhs)

Constructs an extension object from rhs.

QExtensionObject::~QExtensionObject()

Destroys the instance of QExtensionObject.

QByteArray QExtensionObject::encodedBody() const

Returns the body of this extension object. It contains the encoded data.

See also setEncodedBody().

QByteArray &QExtensionObject::encodedBodyRef()

Returns a reference to the body of this extension object.

QOpcUa::QExtensionObject::Encoding QExtensionObject::encoding() const

Returns the encoding of the body.

See also setEncoding().

QString QExtensionObject::encodingTypeId() const

Returns the node id of the encoding for the type stored by this extension object, for example ns=0;i=886 for Range_Encoding_DefaultBinary. All encoding ids are listed in https://opcfoundation.org/UA/schemas/1.03/NodeIds.csv.

See also setEncodingTypeId().

void QExtensionObject::setEncodedBody(const QByteArray &encodedBody)

Sets the body of this extension object to encodedBody.

See also encodedBody().

void QExtensionObject::setEncoding(QOpcUa::QExtensionObject::Encoding encoding)

Sets the encoding of the body to encoding.

See also encoding().

void QExtensionObject::setEncodingTypeId(const QString &encodingTypeId)

Sets the node id of the encoding for the type stored by this extension object to encodingTypeId.

See also encodingTypeId().

QVariant QExtensionObject::operator QVariant() const

Converts this extension object to QVariant.

QOpcUa::QExtensionObject &QExtensionObject::operator=(const QOpcUa::QExtensionObject &rhs)

Sets the values from rhs in this extension object.

bool QExtensionObject::operator==(const QOpcUa::QExtensionObject &rhs) const

Returns true if this extension object has the same value as rhs.

© 2018 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.