QOpcUaMultiDimensionalArray Class
A container class for multidimensional arrays. More...
Header: | #include <QOpcUaMultiDimensionalArray> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget PRIVATE Qt6::OpcUa) |
qmake: | QT += opcua |
Public Functions
QOpcUaMultiDimensionalArray() | |
QOpcUaMultiDimensionalArray(const QList<quint32> &arrayDimensions) | |
QOpcUaMultiDimensionalArray(const QVariantList &value, const QList<quint32> &arrayDimensions) | |
QOpcUaMultiDimensionalArray(const QOpcUaMultiDimensionalArray &other) | |
QList<quint32> | arrayDimensions() const |
int | arrayIndex(const QList<quint32> &indices) const |
bool | isValid() const |
void | setArrayDimensions(const QList<quint32> &arrayDimensions) |
bool | setValue(const QList<quint32> &indices, const QVariant &value) |
void | setValueArray(const QVariantList &value) |
QVariant | value(const QList<quint32> &indices) const |
QVariantList | valueArray() const |
QVariantList & | valueArrayRef() |
QVariant | operator QVariant() const |
QOpcUaMultiDimensionalArray & | operator=(const QOpcUaMultiDimensionalArray &rhs) |
bool | operator==(const QOpcUaMultiDimensionalArray &other) const |
Detailed Description
This class manages arrays of Qt OPC UA types with associated array dimensions information. It is returned as value when a multidimensional array is received from the server. It can also be used as a write value or as parameter for filters and method calls.
Member Function Documentation
QOpcUaMultiDimensionalArray::QOpcUaMultiDimensionalArray()
Default constructs a multi dimensional array with no parameters set.
QOpcUaMultiDimensionalArray::QOpcUaMultiDimensionalArray(const QList<quint32> &arrayDimensions)
Creates a multidimensional array with preallocated data fitting arrayDimensions.
QOpcUaMultiDimensionalArray::QOpcUaMultiDimensionalArray(const QVariantList &value, const QList<quint32> &arrayDimensions)
Constructs a multidimensional array with value value and array dimensions arrayDimensions.
QOpcUaMultiDimensionalArray::QOpcUaMultiDimensionalArray(const QOpcUaMultiDimensionalArray &other)
Constructs a multidimensional array from other.
QList<quint32> QOpcUaMultiDimensionalArray::arrayDimensions() const
Returns the dimensions of the multidimensional array. The element at position n contains the length of the n-th dimension.
See also setArrayDimensions().
int QOpcUaMultiDimensionalArray::arrayIndex(const QList<quint32> &indices) const
Returns the array index in valueArray() of the element identified by indices. If indices is invalid for the array or if the array's dimensions don't match the size of valueArray(), the invalid index -1
is returned.
bool QOpcUaMultiDimensionalArray::isValid() const
Returns true
if the multidimensional array is valid
void QOpcUaMultiDimensionalArray::setArrayDimensions(const QList<quint32> &arrayDimensions)
Sets the dimensions of the multidimensional array to arrayDimensions.
See also arrayDimensions().
bool QOpcUaMultiDimensionalArray::setValue(const QList<quint32> &indices, const QVariant &value)
Sets the value at position indices to value. Returns true
if the value has been successfully set.
See also value().
void QOpcUaMultiDimensionalArray::setValueArray(const QVariantList &value)
Sets the value array of the multidimensional array to value.
See also valueArray().
QVariant QOpcUaMultiDimensionalArray::value(const QList<quint32> &indices) const
Returns the value of the element identified by indices. If the indices are invalid for the array, an empty QVariant is returned.
See also setValue().
QVariantList QOpcUaMultiDimensionalArray::valueArray() const
Returns the value array of the multidimensional array.
See also setValueArray().
QVariantList &QOpcUaMultiDimensionalArray::valueArrayRef()
Returns a reference to the value array of the multidimensional array.
QVariant QOpcUaMultiDimensionalArray::operator QVariant() const
Converts this multidimensional array to QVariant.
QOpcUaMultiDimensionalArray &QOpcUaMultiDimensionalArray::operator=(const QOpcUaMultiDimensionalArray &rhs)
Sets the values from rhs in the multidimensional array.
bool QOpcUaMultiDimensionalArray::operator==(const QOpcUaMultiDimensionalArray &other) const
Returns true
if this multidimensional array has the same value as other.