QOpcUaGenericStructValue Class
汎用OPC UA構造化型の値を保持します。詳細...
ヘッダ | #include <QOpcUaGenericStructValue> |
CMake.CMakeヘッダ | find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget PRIVATE Qt6::OpcUa) |
qmake: | QT += opcua |
以来: | Qt 6.7 |
パブリック関数
QOpcUaGenericStructValue() | |
QOpcUaGenericStructValue(const QString &typeName, const QString &typeId, const QOpcUaStructureDefinition &definition) | |
QOpcUaGenericStructValue(const QString &typeName, const QString &typeId, const QOpcUaStructureDefinition &definition, const QHash<QString, QVariant> &fields) | |
QOpcUaGenericStructValue(const QOpcUaGenericStructValue &other) | |
QOpcUaGenericStructValue(QOpcUaGenericStructValue &&other) | |
~QOpcUaGenericStructValue() | |
QHash<QString, QVariant> | fields() const |
QHash<QString, QVariant> & | fieldsRef() |
void | setFields(const QHash<QString, QVariant> &fields) |
void | setStructureDefinition(const QOpcUaStructureDefinition &structureDefinition) |
void | setTypeId(const QString &typeId) |
void | setTypeName(const QString &typeName) |
QOpcUaStructureDefinition | structureDefinition() const |
void | swap(QOpcUaGenericStructValue &other) |
QString | toString() const |
QString | typeId() const |
QString | typeName() const |
QVariant | operator QVariant() const |
QOpcUaGenericStructValue & | operator=(QOpcUaGenericStructValue &&other) |
QOpcUaGenericStructValue & | operator=(const QOpcUaGenericStructValue &rhs) |
関連する非メンバー
bool | operator!=(const QOpcUaGenericStructValue &lhs, const QOpcUaGenericStructValue &rhs) |
QDebug | operator<<(QDebug debug, const QOpcUaGenericStructValue &s) |
bool | operator==(const QOpcUaGenericStructValue &lhs, const QOpcUaGenericStructValue &rhs) |
詳細説明
このクラスは、組み込み型やそのサブ型、ネストされた汎用構造体からなる、名前付きフィールドとその値から構成される汎用OPC UA構造体の値を保持します。このクラスのオブジェクトに含まれる型の型IDや構造体定義のようなメタ情報も含まれます。
デコード結果の戻り型として、またQOpcUaGenericStructHandler のエンコーディングメソッドの入力型として使用されます。
オプション・フィールドを持つ構造体の場合、指定されたフィールドのみがfields() リストに含まれる。エンコード時にオプション・フィールドを省略するには、fields() リストに現れてはならない。Union型から派生した構造体の場合、フィールドは1つだけ指定する必要があります。デコードされた型のfields() リストの唯一のエントリが、型定義のどのフィールドが指定されたかを決定する。
例
// 拡張オブジェクトをデコードするQOpcUaGenericStructValuevalue=decoder.decode(extensionObject,success);// 必須フィールドの値を表示する。qDebug() << value.fields().value("MyField").value<QOpcUaLocalizedText>(); // オプション・フィールドの値を表示するif(value.fields().contains("MyOptionalField")) qDebug() << value.fields().value("MyField").value<QOpcUaQualifiedName>(); // フィールドの入れ子構造体を取得するconst autounionMember=value.fields().value("MyUnionMember").value<QOpcUaGenericStructValue>();// 指定されたフィールドを表示if(unionMember.fields().contains("UnionMember1")) qDebug() << unionMember.fields().value("UnionMember1").toInt(); else if(unionMember.fields().contains("UnionMember2")) qDebug() << unionMember.fields().value("UnionMember2").toDouble(); その他 qDebug() << "Empty union";
メンバー関数ドキュメント
QOpcUaGenericStructValue::QOpcUaGenericStructValue()
汎用構造体値を構築します。
QOpcUaGenericStructValue::QOpcUaGenericStructValue(const QString &typeName, const QString &typeId, const QOpcUaStructureDefinition &definition)
typeName 、typeId 、definition から汎用構造体値を構築する。
QOpcUaGenericStructValue::QOpcUaGenericStructValue(const QString &typeName, const QString &typeId, const QOpcUaStructureDefinition &definition, const QHash<QString, QVariant> &fields)
typeName,typeId,definition,fields から汎用構造体値を構築する。
QOpcUaGenericStructValue::QOpcUaGenericStructValue(const QOpcUaGenericStructValue &other)
other から汎用構造体を構築する。
[noexcept]
QOpcUaGenericStructValue::QOpcUaGenericStructValue(QOpcUaGenericStructValue &&other)
Move は、other から新しい汎用構造体値を構築する。
注: 移動元のオブジェクトother は、部分的に形成された状態に置かれる。この状態では、有効な操作は破壊と新しい値の割り当てのみである。
[noexcept]
QOpcUaGenericStructValue::~QOpcUaGenericStructValue()
この汎用構造体値オブジェクトを破棄します。
QHash<QString, QVariant> QOpcUaGenericStructValue::fields() const
この汎用構造体値のフィールドを返します。
setFields()も参照してください 。
QHash<QString, QVariant> &QOpcUaGenericStructValue::fieldsRef()
この汎用構造体値のフィールドへの参照を返します。
void QOpcUaGenericStructValue::setFields(const QHash<QString, QVariant> &fields)
この汎用構造体のフィールドをfields に設定します。
fields()も参照 。
void QOpcUaGenericStructValue::setStructureDefinition(const QOpcUaStructureDefinition &structureDefinition)
この汎用構造体値の構造体定義をstructureDefinition に設定します。
structureDefinition()も参照のこと 。
void QOpcUaGenericStructValue::setTypeId(const QString &typeId)
この汎用構造体値の型ノード ID をtypeId に設定します。
typeId()も参照してください 。
void QOpcUaGenericStructValue::setTypeName(const QString &typeName)
この汎用構造体値の型名をtypeName に設定します。
typeName()も参照のこと 。
QOpcUaStructureDefinition QOpcUaGenericStructValue::structureDefinition() const
この汎用構造体値の構造体定義を返します。
setStructureDefinition()も参照してください 。
[noexcept]
void QOpcUaGenericStructValue::swap(QOpcUaGenericStructValue &other)
汎用構造体値オブジェクトother をこの汎用構造体値オブジェクトと入れ替えます。この操作は非常に高速で、失敗することはありません。
QString QOpcUaGenericStructValue::toString() const
この汎用構造体値の文字列表現を返します。
QString QOpcUaGenericStructValue::typeId() const
この汎用構造体値の型ノード ID を返します。
setTypeId()も参照してください 。
QString QOpcUaGenericStructValue::typeName() const
この汎用構造体値の型名を返します。
setTypeName()も参照してください 。
QVariant QOpcUaGenericStructValue::operator QVariant() const
この汎用構造体の値を含むQVariant を返します。
[noexcept]
QOpcUaGenericStructValue &QOpcUaGenericStructValue::operator=(QOpcUaGenericStructValue &&other)
Move-assignother をこのQOpcUaGenericStructValue インスタンスに割り当てる。
注: 移動元のオブジェクトother は、部分的に形成された状態に置かれる。この状態では、有効な操作は破壊と新しい値の割り当てのみである。
QOpcUaGenericStructValue &QOpcUaGenericStructValue::operator=(const QOpcUaGenericStructValue &rhs)
この汎用構造体の値rhs を設定します。
関連する非会員
[noexcept]
bool operator!=(const QOpcUaGenericStructValue &lhs, const QOpcUaGenericStructValue &rhs)
lhs がrhs と等しくない場合はtrue
を返す。
QDebug operator<<(QDebug debug, const QOpcUaGenericStructValue &s)
s の文字列表現をdebug に出力する。
[noexcept]
bool operator==(const QOpcUaGenericStructValue &lhs, const QOpcUaGenericStructValue &rhs)
lhs がrhs と等しい場合、true
を返す。
© 2025 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.