QOpcUaGenericStructValue Class

일반 OPC UA 구조화된 유형의 값을 보유합니다. 더 보기...

헤더: #include <QOpcUaGenericStructValue>
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() 목록에 해당 필드가 나타나지 않아야 합니다. 유니온 유형에서 파생된 구조체의 경우 필드 중 하나만 지정해야 합니다. 디코딩된 타입의 fields() 목록에 있는 유일한 항목에 따라 타입 정의의 어떤 필드(있는 경우)가 지정되었는지가 결정됩니다.

예시:

// 확장 개체 디코딩QOpcUaGenericStructValue value = decoder.decode(extensionObject, success);// 필수 필드 값을 인쇄합니다.qDebug() << value.fields().value("MyField").value<QOpcUaLocalizedText>();

// 선택적 필드 값 인쇄if (value.fields().contains("MyOptionalField"))    qDebug() << value.fields().value("MyField").value<QOpcUaQualifiedName>();

// 필드에 대한 중첩 구조체 가져오기const auto unionMember = 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();
else    qDebug() << "Empty union";

멤버 기능 문서

QOpcUaGenericStructValue::QOpcUaGenericStructValue()

일반 구조체 값을 생성합니다.

QOpcUaGenericStructValue::QOpcUaGenericStructValue(const QString &typeName, const QString &typeId, const QOpcUaStructureDefinition &definition)

typeName, typeIddefinition 에서 일반 구조체 값을 생성합니다.

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)

이동 - other 을 이 QOpcUaGenericStructValue 인스턴스에 할당합니다.

참고: 이동된 other 객체는 부분적으로 형성된 상태로 배치되며, 유효한 작업은 소멸과 새 값 할당뿐입니다.

QOpcUaGenericStructValue &QOpcUaGenericStructValue::operator=(const QOpcUaGenericStructValue &rhs)

이 일반 구조 값에 rhs 값을 설정합니다.

관련 비회원

[noexcept] bool operator!=(const QOpcUaGenericStructValue &lhs, const QOpcUaGenericStructValue &rhs)

lhsrhs 과 같지 않으면 true 을 반환합니다 .

QDebug operator<<(QDebug debug, const QOpcUaGenericStructValue &s)

s 의 문자열 표현을 debug 로 출력합니다.

[noexcept] bool operator==(const QOpcUaGenericStructValue &lhs, const QOpcUaGenericStructValue &rhs)

lhsrhs 과 같으면 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.