Portable Ua Variant class. Converts Variant into all datatypes. The UaVariant class acts like a union for the most common Ua data types. More...
#include <uavariant.h>
Public Member Functions | |
UaVariant () | |
UaVariant (const UaVariant &) | |
UaVariant (const OpcUa_Variant &) | |
UaVariant (OpcUa_Variant *pValue, OpcUa_Boolean detachValue=OpcUa_False) | |
UaVariant (const UaString &) | |
UaVariant (const UaNodeId &) | |
UaVariant (const UaQualifiedName &) | |
UaVariant (const UaLocalizedText &) | |
UaVariant (OpcUa_Double) | |
UaVariant (OpcUa_Float) | |
UaVariant (OpcUa_Int32) | |
UaVariant (OpcUa_Int16) | |
UaVariant (OpcUa_UInt32) | |
UaVariant (OpcUa_UInt16) | |
UaVariant (OpcUa_Boolean) | |
~UaVariant () | |
void | clear () |
OpcUa_Boolean | isEmpty () const |
OpcUa_Byte | arrayType () const |
OpcUa_Boolean | isArray () const |
OpcUa_Int32 | arraySize () const |
OpcUa_Boolean | isMatrix () const |
OpcUa_Int32 | dimensionSize () const |
void | arrayDimensions (UaUInt32Array &arrayDimensions) const |
OpcUa_BuiltInType | type () const |
UaNodeId | dataType () const |
OpcUa_StatusCode | changeType (OpcUa_BuiltInType, OpcUa_Boolean toArray) |
OpcUa_StatusCode | getIndexRange (const UaNumericRange &indexRange, UaVariant &value) const |
OpcUa_StatusCode | applyIndexRange (const UaNumericRange &indexRange, const UaVariant &value) |
UaVariant (const VARIANT &) | |
UaVariant & | operator= (const VARIANT &) |
operator VARIANT () const | |
UaVariant & | operator= (const OpcUa_Variant &) |
UaVariant & | operator= (const UaVariant &) |
UaVariant & | operator= (double) |
UaVariant & | operator= (const UaString &) |
bool | operator== (const UaVariant &) const |
bool | operator!= (const UaVariant &) const |
bool | operator> (const UaVariant &) const |
bool | operator< (const UaVariant &) const |
bool | operator>= (const UaVariant &) const |
bool | operator<= (const UaVariant &) const |
OpcUa_Variant | operator[] (const OpcUa_UInt32 index) const |
operator const OpcUa_Variant * () const | |
void | detach () |
void | attach (const OpcUa_Variant *pSrc) |
OpcUa_Variant * | copy () const |
void | copyTo (OpcUa_Variant *pDst) const |
void | setBool (OpcUa_Boolean val) |
void | setSByte (OpcUa_SByte val) |
void | setInt16 (OpcUa_Int16 val) |
void | setInt32 (OpcUa_Int32 val) |
void | setInt64 (OpcUa_Int64 val) |
void | setByte (OpcUa_Byte val) |
void | setUInt16 (OpcUa_UInt16 val) |
void | setUInt32 (OpcUa_UInt32 val) |
void | setUInt64 (OpcUa_UInt64 val) |
void | setFloat (OpcUa_Float val) |
void | setDouble (OpcUa_Double val) |
void | setString (const UaString &val) |
void | setDateTime (const UaDateTime &val) |
void | setGuid (const UaGuid &val) |
void | setByteString (UaByteString &val, OpcUa_Boolean bDetach) |
void | setXmlElement (const UaString &val) |
void | setXmlElement (UaByteString &val, OpcUa_Boolean bDetach) |
void | setNodeId (const UaNodeId &val) |
void | setExpandedNodeId (const UaExpandedNodeId &val) |
void | setStatusCode (OpcUa_StatusCode val) |
void | setQualifiedName (const UaQualifiedName &val) |
void | setLocalizedText (const UaLocalizedText &val) |
void | setExtensionObject (UaExtensionObject &val, OpcUa_Boolean bDetach) |
void | setDataValue (UaDataValue *pVal, OpcUa_Boolean bDetach) |
void | setBoolArray (UaBoolArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setByteArray (UaByteArray &val) |
void | setSByteArray (UaSByteArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setInt16Array (UaInt16Array &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setUInt16Array (UaUInt16Array &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setInt32Array (UaInt32Array &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setUInt32Array (UaUInt32Array &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setInt64Array (UaInt64Array &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setUInt64Array (UaUInt64Array &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setFloatArray (UaFloatArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setDoubleArray (UaDoubleArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setStringArray (UaStringArray &val, OpcUa_Boolean bDetach) |
void | setStringArray (const UaStringArray &val) |
void | setDateTimeArray (UaDateTimeArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setGuidArray (UaGuidArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setByteStringArray (UaByteStringArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setByteStringArray (const UaByteStringArray &val) |
void | setXmlElementArray (UaByteStringArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setXmlElementArray (const UaByteStringArray &val) |
void | setNodeIdArray (UaNodeIdArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setExpandedNodeIdArray (UaExpandedNodeIdArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setStatusCodeArray (UaStatusCodeArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setQualifiedNameArray (UaQualifiedNameArray &val, OpcUa_Boolean bDetach) |
void | setQualifiedNameArray (const UaQualifiedNameArray &val) |
void | setLocalizedTextArray (UaLocalizedTextArray &val, OpcUa_Boolean bDetach) |
void | setLocalizedTextArray (const UaLocalizedTextArray &val) |
void | setExtensionObjectArray (UaExtensionObjectArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setVariantArray (UaVariantArray &val, OpcUa_Boolean bDetach=OpcUa_False) |
void | setVariantArray (const UaVariantArray &val) |
OpcUa_StatusCode | toBool (OpcUa_Boolean &val) const |
OpcUa_StatusCode | toSByte (OpcUa_SByte &val) const |
OpcUa_StatusCode | toInt16 (OpcUa_Int16 &val) const |
OpcUa_StatusCode | toInt32 (OpcUa_Int32 &val) const |
OpcUa_StatusCode | toInt64 (OpcUa_Int64 &val) const |
OpcUa_StatusCode | toByte (OpcUa_Byte &val) const |
OpcUa_StatusCode | toUInt16 (OpcUa_UInt16 &val) const |
OpcUa_StatusCode | toUInt32 (OpcUa_UInt32 &val) const |
OpcUa_StatusCode | toUInt64 (OpcUa_UInt64 &val) const |
OpcUa_StatusCode | toFloat (OpcUa_Float &val) const |
OpcUa_StatusCode | toDouble (OpcUa_Double &val) const |
OpcUa_StatusCode | toDateTime (UaDateTime &val) const |
OpcUa_StatusCode | toGuid (UaGuid &val) const |
OpcUa_StatusCode | toByteString (UaByteString &val) const |
OpcUa_StatusCode | toXmlElement (UaByteString &val) const |
OpcUa_StatusCode | toNodeId (UaNodeId &val) const |
OpcUa_StatusCode | toExpandedNodeId (UaExpandedNodeId &val) const |
OpcUa_StatusCode | toStatusCode (OpcUa_StatusCode &val) const |
OpcUa_StatusCode | toQualifiedName (UaQualifiedName &val) const |
OpcUa_StatusCode | toLocalizedText (UaLocalizedText &val) const |
OpcUa_StatusCode | toExtensionObject (UaExtensionObject &val) const |
OpcUa_StatusCode | toDataValue (UaDataValue *pVal) const |
OpcUa_StatusCode | toBoolArray (UaBoolArray &val) const |
OpcUa_StatusCode | toByteArray (UaByteArray &val) const |
OpcUa_StatusCode | toSByteArray (UaSByteArray &val) const |
OpcUa_StatusCode | toInt16Array (UaInt16Array &val) const |
OpcUa_StatusCode | toUInt16Array (UaUInt16Array &val) const |
OpcUa_StatusCode | toInt32Array (UaInt32Array &val) const |
OpcUa_StatusCode | toUInt32Array (UaUInt32Array &val) const |
OpcUa_StatusCode | toInt64Array (UaInt64Array &val) const |
OpcUa_StatusCode | toUInt64Array (UaUInt64Array &val) const |
OpcUa_StatusCode | toFloatArray (UaFloatArray &val) const |
OpcUa_StatusCode | toDoubleArray (UaDoubleArray &val) const |
OpcUa_StatusCode | toStringArray (UaStringArray &val) const |
OpcUa_StatusCode | toDateTimeArray (UaDateTimeArray &val) const |
OpcUa_StatusCode | toGuidArray (UaGuidArray &val) const |
OpcUa_StatusCode | toByteStringArray (UaByteStringArray &val) const |
OpcUa_StatusCode | toXmlElementArray (UaByteStringArray &val) const |
OpcUa_StatusCode | toNodeIdArray (UaNodeIdArray &val) const |
OpcUa_StatusCode | toExpandedNodeIdArray (UaExpandedNodeIdArray &val) const |
OpcUa_StatusCode | toStatusCodeArray (UaStatusCodeArray &val) const |
OpcUa_StatusCode | toQualifiedNameArray (UaQualifiedNameArray &val) const |
OpcUa_StatusCode | toLocalizedTextArray (UaLocalizedTextArray &val) const |
OpcUa_StatusCode | toExtensionObjectArray (UaExtensionObjectArray &val) const |
OpcUa_StatusCode | toVariantArray (UaVariantArray &val) const |
UaString | toString () const |
UaString | toFullString () const |
Static Public Member Functions | |
static OpcUa_StatusCode | VartypeToUaType (VARTYPE vt, OpcUa_BuiltInType &ut, OpcUa_Boolean &isArray) |
static OpcUa_StatusCode | UaTypeToVartype (OpcUa_BuiltInType ut, OpcUa_Boolean isArray, VARTYPE &vt) |
static bool | compare (const OpcUa_Variant &, const OpcUa_Variant &) |
static void | adjustTypes (UaVariant &, UaVariant &) |
static OpcUa_Variant * | clone (const OpcUa_Variant &source) |
static void | cloneTo (const OpcUa_Variant &source, OpcUa_Variant ©) |
Portable Ua Variant class. Converts Variant into all datatypes. The UaVariant class acts like a union for the most common Ua data types.
UaVariant::UaVariant | ( | ) |
Constructs an empty variant.
UaVariant::UaVariant | ( | const UaVariant & | vVal ) |
Constructs a variant initialized with the passed variant value.
[in] | vVal | The value as UaVariant |
UaVariant::UaVariant | ( | const OpcUa_Variant & | vVal ) |
Constructs a variant initialized with the passed variant value.
[in] | vVal | The value as OpcUa_Variant |
UaVariant::UaVariant | ( | OpcUa_Variant * | pValue, |
OpcUa_Boolean | detachValue = OpcUa_False |
||
) |
Constructs a variant initialized with the passed variant value. This version allows to detach the variant value from the passed structure to avoid copying of variants containing a lot of data like arrays or strings.
[in] | pValue | The value as OpcUa_Variant |
[in] | detachValue | Flag indicating if the passed variant should be detached |
UaVariant::UaVariant | ( | const UaString & | val ) |
Constructs a variant initialized with the passed string value.
[in] | val | The value as UaString |
UaVariant::UaVariant | ( | const UaNodeId & | val ) |
Constructs a variant initialized with the passed string value.
[in] | val | The value as UaNodeId |
UaVariant::UaVariant | ( | const UaQualifiedName & | val ) |
Constructs a variant initialized with the passed string value.
[in] | val | The value as UaQualifiedName |
UaVariant::UaVariant | ( | const UaLocalizedText & | val ) |
Constructs a variant initialized with the passed string value.
[in] | val | The value as UaLocalizedText |
UaVariant::UaVariant | ( | OpcUa_Double | dblVal ) |
Constructs a variant initialized with the passed double value.
[in] | dblVal | The value as OpcUa_Double |
UaVariant::UaVariant | ( | OpcUa_Float | fltVal ) |
Constructs a variant initialized with the passed float value.
[in] | fltVal | The value as OpcUa_Float |
UaVariant::UaVariant | ( | OpcUa_Int32 | iVal ) |
Constructs a variant initialized with the passed Int32 value.
[in] | iVal | The value as OpcUa_Int32 |
UaVariant::UaVariant | ( | OpcUa_Int16 | iVal ) |
Constructs a variant initialized with the passed Int16 value.
[in] | iVal | The value as OpcUa_Int16 |
UaVariant::UaVariant | ( | OpcUa_UInt32 | iVal ) |
Constructs a variant initialized with the passed UInt32 value.
[in] | iVal | The value as OpcUa_UInt32 |
UaVariant::UaVariant | ( | OpcUa_UInt16 | iVal ) |
Constructs a variant initialized with the passed UInt16 value.
[in] | iVal | The value as OpcUa_UInt16 |
UaVariant::UaVariant | ( | OpcUa_Boolean | bVal ) |
Constructs a variant initialized with the passed bool value.
[in] | bVal | The value as OpcUa_Boolean |
UaVariant::~UaVariant | ( | ) |
destruction
UaVariant::UaVariant | ( | const VARIANT & | copy ) |
Constructs a UaVariant with the passed Windows VARIANT value
Adjust types to prepare comparison of values independent of the variant type. Adjustment is only implemented for Number data types. The data type is adjusted to Double, UInt64 or Int64 depending on the passed data types.
OpcUa_StatusCode UaVariant::applyIndexRange | ( | const UaNumericRange & | indexRange, |
const UaVariant & | value | ||
) |
Applies an index range to this variant. Returns error if the index range could not be applied.
[in] | indexRange | The index range to apply |
[in] | value | The value to apply with index range |
void UaVariant::arrayDimensions | ( | UaUInt32Array & | arrayDimensions ) | const |
Writes the size of each dimension to an UaUInt32Array
arrayDimensions | The array to write to |
OpcUa_Int32 UaVariant::arraySize | ( | ) | const |
Get the actual array size.
OpcUa_Byte UaVariant::arrayType | ( | ) | const |
Get the actual array type. Possible values are
OpcUa_VariantArrayType_Scalar 0x00
OpcUa_VariantArrayType_Array 0x01
OpcUa_VariantArrayType_Matrix 0x02
void UaVariant::attach | ( | const OpcUa_Variant * | vVal ) |
Attach the internal variant data of the passed variant to the own variant.
vVal | a value as OpcUa_Variant. |
OpcUa_StatusCode UaVariant::changeType | ( | OpcUa_BuiltInType | type, |
OpcUa_Boolean | toArray | ||
) |
Change the type of a parameter.
type | the type to change. |
toArray | true if set to array false if not. |
void UaVariant::clear | ( | ) |
Clear the data of the UaVariant.
OpcUa_Variant * UaVariant::clone | ( | const OpcUa_Variant & | source ) | [static] |
void UaVariant::cloneTo | ( | const OpcUa_Variant & | source, |
OpcUa_Variant & | copy | ||
) | [static] |
Copy OpcUa_VariableTypeAttributes data to an exisitng OpcUa_VariableTypeAttributes structure.
source | Source OpcUa_VariableTypeAttributes to clone. |
copy | New copy of source OpcUa_VariableTypeAttributes. |
bool UaVariant::compare | ( | const OpcUa_Variant & | Val1, |
const OpcUa_Variant & | Val2 | ||
) | [static] |
Compares two variant values.
Val1 | First value as OpcUa_Variant. |
Val2 | Second value as OpcUa_Variant. |
OpcUa_Variant * UaVariant::copy | ( | ) | const |
Copy UaVariant data to a newly allocated OpcUa_Variant.
void UaVariant::copyTo | ( | OpcUa_Variant * | pDst ) | const |
Copy UaArgument data to an exisitng OpcUa_Argument structure.
pDst | the destination of this operation. |
UaNodeId UaVariant::dataType | ( | ) | const |
Get the DataType for the DataVariable.
void UaVariant::detach | ( | ) |
Reset UaVariant structure without clearing the data.
OpcUa_Int32 UaVariant::dimensionSize | ( | ) | const |
Get the size of the dimensions.
OpcUa_StatusCode UaVariant::getIndexRange | ( | const UaNumericRange & | indexRange, |
UaVariant & | value | ||
) | const |
Applies an index range to the variant value and returns the subset of the data selected by the index range or an error if the index range is invalid for the value of the variant.
[in] | indexRange | The index range to apply |
[out] | value | The result value after applying the index range |
OpcUa_Boolean UaVariant::isArray | ( | ) | const |
Check wether the var is an array or not.
OpcUa_Boolean UaVariant::isEmpty | ( | ) | const |
Checks wether the variant is empty or not.
OpcUa_Boolean UaVariant::isMatrix | ( | ) | const |
Check if there is a matrix.
UaVariant::operator const OpcUa_Variant * | ( | ) | const |
Get a reference to a value.
UaVariant::operator VARIANT | ( | ) | const |
Converts a UaVariant value to a Windows Variant value. The caller is responsible for clearing the Windows VARIANT with VariantClear()
bool UaVariant::operator!= | ( | const UaVariant & | vVal ) | const |
Returns true if this variant is not equal to variant other; otherwise returns false.
bool UaVariant::operator< | ( | const UaVariant & | other ) | const |
Returns true if this variant is less than variant other; otherwise returns false. Returns false if the data type of the two variants are different. Returns false if the value is not scalar.
bool UaVariant::operator<= | ( | const UaVariant & | other ) | const |
Returns true if this variant is less than or equal to variant other; otherwise returns false. Returns false if the data type of the two variants are different. Returns false if the value is not scalar.
UaVariant & UaVariant::operator= | ( | const OpcUa_Variant & | vVal ) |
Assigns the content of a OpcUa_Variant variant strucutre to this variant and clears the old value.
Assigns another variant to this variant and clears the old value.
UaVariant & UaVariant::operator= | ( | double | dblVal ) |
Assigns a double value to this variant and clears the old value.
Assigns a string to this variant and clears the old value.
UaVariant & UaVariant::operator= | ( | const VARIANT & | copy ) |
Implements the operator = for assigning a Windows VARIANT value to the UaVariant.
bool UaVariant::operator== | ( | const UaVariant & | other ) | const |
Returns true if this variant is equal to variant other; otherwise returns false. Return false if the data type of the two variants are different.
bool UaVariant::operator> | ( | const UaVariant & | other ) | const |
Returns true if this variant is greater than variant other; otherwise returns false. Returns false if the data type of the two variants are different. Returns false if the value is not scalar.
bool UaVariant::operator>= | ( | const UaVariant & | other ) | const |
Returns true if this variant is greater than or equal to variant other; otherwise returns false. Returns false if the data type of the two variants are different. Returns false if the value is not scalar.
OpcUa_Variant UaVariant::operator[] | ( | const OpcUa_UInt32 | index ) | const |
Returns the array element for the given index. This method works also for scalar ByteString values.
index | Array in idnex. |
void UaVariant::setBool | ( | OpcUa_Boolean | val ) |
Sets a boolean value
[in] | val | The new boolean value |
void UaVariant::setBoolArray | ( | UaBoolArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaBoolArray.
val | a value as UaBoolArray. |
bDetach | true if detach false if not. |
void UaVariant::setByte | ( | OpcUa_Byte | val ) |
Sets a value to OpcUa_Byte.
val | a value as OpcUa_Byte. |
void UaVariant::setByteArray | ( | UaByteArray & | val ) |
Sets a value to UaByteArray.
val | a value as UaByteArray. |
void UaVariant::setByteString | ( | UaByteString & | val, |
OpcUa_Boolean | bDetach | ||
) |
Sets a ByteString value to the Variant.
val | a value as UaByteString. |
bDetach | true if detach false if not. |
void UaVariant::setByteStringArray | ( | UaByteStringArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaByteStringArray.
val | a value as UaByteStringArray. |
bDetach | true if detach false if not. |
void UaVariant::setByteStringArray | ( | const UaByteStringArray & | val ) |
Sets a value to UaByteStringArray.
val | a value as UaByteStringArray. |
void UaVariant::setDataValue | ( | UaDataValue * | pVal, |
OpcUa_Boolean | bDetach | ||
) |
Sets a UaDataValue value to the variant.
The method signature is different to the other setter methods to allow forward declaration or UaDataValue in this class to avoid cross include headers with UaDataValue since it uses UaVariant.
pVal | Pointer to the UaDataValue to set. The UaDataValue will be changed if the detach flag is set. |
bDetach | The detach flag indicates if a shallow copy of the data should be created. In this case the data is detached from the UaDataValue. |
void UaVariant::setDateTime | ( | const UaDateTime & | val ) |
Sets a value to UaDateTime.
val | a value as UaDateTime. |
void UaVariant::setDateTimeArray | ( | UaDateTimeArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaDateTimeArray.
val | a value as UaDateTimeArray. |
bDetach | true if detach false if not. |
void UaVariant::setDouble | ( | OpcUa_Double | val ) |
Sets a value to OpcUa_Double.
val | a value as OpcUa_Double. |
void UaVariant::setDoubleArray | ( | UaDoubleArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaDoubleArray.
val | a value as UaDoubleArray. |
bDetach | true if detach false if not. |
void UaVariant::setExpandedNodeId | ( | const UaExpandedNodeId & | val ) |
Sets a UaExpandedNodeId value to the variant.
val | a value as UaExpandedNodeId. |
void UaVariant::setExpandedNodeIdArray | ( | UaExpandedNodeIdArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a OpcUa_ExpandedNodeId array to the variant.
val | a value as UaExpandedNodeIdArray. |
bDetach | true if detach false if not. |
void UaVariant::setExtensionObject | ( | UaExtensionObject & | val, |
OpcUa_Boolean | bDetach | ||
) |
Sets a ExtensionObject value to the variant.
val | a value as UaExtensionObject. |
bDetach | true if detach false if not. |
void UaVariant::setExtensionObjectArray | ( | UaExtensionObjectArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaExtensionObjectArray.
val | a value as UaExtensionObjectArray. |
bDetach | true if detach false if not. |
void UaVariant::setFloat | ( | OpcUa_Float | val ) |
Sets a value to OpcUa_Float.
val | a value as OpcUa_Float. |
void UaVariant::setFloatArray | ( | UaFloatArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaFloatArray.
val | a value as UaFloatArray. |
bDetach | true if detach false if not. |
void UaVariant::setGuid | ( | const UaGuid & | val ) |
void UaVariant::setGuidArray | ( | UaGuidArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaGuidArray.
val | a value as UaGuidArray. |
bDetach | true if detach false if not. |
void UaVariant::setInt16 | ( | OpcUa_Int16 | val ) |
Sets a value to OpcUa_Int16.
val | a value as OpcUa_Int16. |
void UaVariant::setInt16Array | ( | UaInt16Array & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaInt16Array.
val | a value as UaInt16Array. |
bDetach | true if detach false if not. |
void UaVariant::setInt32 | ( | OpcUa_Int32 | val ) |
Sets a value to OpcUa_Int32.
val | a value as OpcUa_Int32. |
void UaVariant::setInt32Array | ( | UaInt32Array & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaInt32Array.
val | a value as UaInt32Array. |
bDetach | true if detach false if not. |
void UaVariant::setInt64 | ( | OpcUa_Int64 | val ) |
Sets a value to OpcUa_Int64.
val | a value as OpcUa_Int64. |
void UaVariant::setInt64Array | ( | UaInt64Array & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaInt64Array.
val | a value as UaInt64Array. |
bDetach | true if detach false if not. |
void UaVariant::setLocalizedText | ( | const UaLocalizedText & | val ) |
Sets a value to UaLocalizedText.
val | a value as UaLocalizedText. |
void UaVariant::setLocalizedTextArray | ( | UaLocalizedTextArray & | val, |
OpcUa_Boolean | bDetach | ||
) |
Sets a value to UaLocalizedTextArray.
val | a value as UaLocalizedTextArray. |
bDetach | true if detach false if not. |
void UaVariant::setLocalizedTextArray | ( | const UaLocalizedTextArray & | val ) |
Sets a value to UaLocalizedTextArray.
val | a value as UaLocalizedTextArray. |
void UaVariant::setNodeId | ( | const UaNodeId & | val ) |
void UaVariant::setNodeIdArray | ( | UaNodeIdArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a OpcUa_NodeId array to the variant.
val | a value as UaNodeIdArray. |
bDetach | true if detach false if not. |
void UaVariant::setQualifiedName | ( | const UaQualifiedName & | val ) |
Sets a value to UaQualifiedName.
val | a value as UaQualifiedName. |
void UaVariant::setQualifiedNameArray | ( | UaQualifiedNameArray & | val, |
OpcUa_Boolean | bDetach | ||
) |
Sets a value to UaQualifiedNameArray.
val | a value as UaQualifiedNameArray. |
bDetach | true if detach false if not. |
void UaVariant::setQualifiedNameArray | ( | const UaQualifiedNameArray & | val ) |
Sets a value to QualifiedNameArray.
val | a value as UaQualifiedNameArray. |
void UaVariant::setSByte | ( | OpcUa_SByte | val ) |
Sets a value to OpcUa_SByte.
val | a value as OpcUa_SByte. |
void UaVariant::setSByteArray | ( | UaSByteArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaSByteArray.
val | a value as UaSByteArray. |
bDetach | true if detach false if not. |
void UaVariant::setStatusCode | ( | OpcUa_StatusCode | val ) |
Sets a OpcUa_StatusCode value to the Variant.
val | a value as OpcUa_StatusCode. |
void UaVariant::setStatusCodeArray | ( | UaStatusCodeArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a OpcUa_StatusCode array to the variant.
val | a value as UaStatusCodeArray. |
bDetach | true if detach false if not. |
void UaVariant::setString | ( | const UaString & | val ) |
Sets a String value to the Variant.
val | a value as UaString. |
void UaVariant::setStringArray | ( | UaStringArray & | val, |
OpcUa_Boolean | bDetach | ||
) |
Sets a value to UaStringArray.
val | a value as UaStringArray. |
bDetach | true if detach false if not. |
void UaVariant::setStringArray | ( | const UaStringArray & | val ) |
Sets a value to UaStringArray.
val | a value as UaStringArray. |
void UaVariant::setUInt16 | ( | OpcUa_UInt16 | val ) |
Sets a value to OpcUa_UInt16.
val | a value as OpcUa_UInt16. |
void UaVariant::setUInt16Array | ( | UaUInt16Array & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaInt16Array.
val | a value as UaInt16Array. |
bDetach | true if detach false if not. |
void UaVariant::setUInt32 | ( | OpcUa_UInt32 | val ) |
Sets a OpcUa_UInt32 value to the Variant.
val | a value as OpcUa_UInt32. |
void UaVariant::setUInt32Array | ( | UaUInt32Array & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaUInt32Array.
val | a value as UaUInt32Array. |
bDetach | true if detach false if not. |
void UaVariant::setUInt64 | ( | OpcUa_UInt64 | val ) |
Sets a value to OpcUa_UInt64.
val | a value as OpcUa_UInt64. |
void UaVariant::setUInt64Array | ( | UaUInt64Array & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaUInt64Array.
val | a value as UaUInt64Array. |
bDetach | true if detach false if not. |
void UaVariant::setVariantArray | ( | UaVariantArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaVariantArray.
val | a value as UaVariantArray. |
bDetach | true if detach false if not. |
void UaVariant::setVariantArray | ( | const UaVariantArray & | val ) |
Sets a value to UaVariantArray.
val | a value as UaVariantArray. |
void UaVariant::setXmlElement | ( | const UaString & | val ) |
Sets a XmlElement value to the Variant.
val | a value as UaString. |
void UaVariant::setXmlElement | ( | UaByteString & | val, |
OpcUa_Boolean | bDetach | ||
) |
Sets a XmlElement value to the Variant.
val | a value as UaByteString. |
bDetach | true if detach false if not. |
void UaVariant::setXmlElementArray | ( | UaByteStringArray & | val, |
OpcUa_Boolean | bDetach = OpcUa_False |
||
) |
Sets a value to UaXmlElementArray.
val | a value as UaByteStringArray. |
bDetach | true if detach false if not. |
void UaVariant::setXmlElementArray | ( | const UaByteStringArray & | val ) |
Sets a value to XmlElementArray.
val | a value as UaByteStringArray. |
OpcUa_StatusCode UaVariant::toBool | ( | OpcUa_Boolean & | val ) | const |
Converts the UaVariant into a OpcUa_Boolean.
val | a value as OpcUa_Boolean. |
OpcUa_StatusCode UaVariant::toBoolArray | ( | UaBoolArray & | val ) | const |
Converts the UaVariant into a UaBoolArray.
val | a value as UaBoolArray. |
OpcUa_StatusCode UaVariant::toByte | ( | OpcUa_Byte & | val ) | const |
Converts the UaVariant into a OpcUa_Byte.
val | a value as OpcUa_Byte. |
OpcUa_StatusCode UaVariant::toByteArray | ( | UaByteArray & | val ) | const |
Converts the UaVariant into a UaByteArray.
val | a value as UaByteArray. |
OpcUa_StatusCode UaVariant::toByteString | ( | UaByteString & | val ) | const |
Converts the UaVariant into a UaByteString.
val | a value as UaByteString. |
OpcUa_StatusCode UaVariant::toByteStringArray | ( | UaByteStringArray & | val ) | const |
Converts the UaVariant into a UaByteStringArray.
val | a value as UaByteStringArray. |
OpcUa_StatusCode UaVariant::toDataValue | ( | UaDataValue * | pVal ) | const |
Converts the UaVariant into a UaDataValue.
The method signature is different to the other setter methods to allow forward declaration or UaDataValue in this class to avoid cross include headers with UaDataValue since it uses UaVariant.
pVal | a value as UaDataValue. |
OpcUa_StatusCode UaVariant::toDateTime | ( | UaDateTime & | val ) | const |
Converts the UaVariant into a UaDateTime.
val | a value as UaDateTime. |
OpcUa_StatusCode UaVariant::toDateTimeArray | ( | UaDateTimeArray & | val ) | const |
Converts the UaVariant into a UaDateTimeArray.
val | a value as UaDateTimeArray. |
OpcUa_StatusCode UaVariant::toDouble | ( | OpcUa_Double & | val ) | const |
Converts the UaVariant into a OpcUa_Double.
val | a value as OpcUa_Double. |
OpcUa_StatusCode UaVariant::toDoubleArray | ( | UaDoubleArray & | val ) | const |
Converts the UaVariant into a UaDoubleArray.
val | a value as UaDoubleArray. |
OpcUa_StatusCode UaVariant::toExpandedNodeId | ( | UaExpandedNodeId & | val ) | const |
Converts the UaVariant into a UaExpandedNodeId.
val | a value as UaExpandedNodeId. |
OpcUa_StatusCode UaVariant::toExpandedNodeIdArray | ( | UaExpandedNodeIdArray & | val ) | const |
Converts the UaVariant into a UaExpandedNodeIdArray.
val | a value as UaExpandedNodeIdArray. |
OpcUa_StatusCode UaVariant::toExtensionObject | ( | UaExtensionObject & | val ) | const |
Converts the UaVariant into a UaExtensionObject.
val | a value as UaExtensionObject. |
OpcUa_StatusCode UaVariant::toExtensionObjectArray | ( | UaExtensionObjectArray & | val ) | const |
Converts the UaVariant into an array of OpcUa_ExtensionObject.
val | a value as UaExtensionObjectArray. |
OpcUa_StatusCode UaVariant::toFloat | ( | OpcUa_Float & | val ) | const |
Converts the UaVariant into a OpcUa_Float.
val | a value as OpcUa_Float. |
OpcUa_StatusCode UaVariant::toFloatArray | ( | UaFloatArray & | val ) | const |
Converts the UaVariant into a UaFloatArray.
val | a value as UaFloatArray. |
UaString UaVariant::toFullString | ( | ) | const |
Converts the UaVariant into a UaString containing all information about the value. This function returns the full information of the types NodeId, ExpandedNodeId, QualifiedName and LocalizedText. All other types will return the same string as toString().
OpcUa_StatusCode UaVariant::toGuid | ( | UaGuid & | val ) | const |
OpcUa_StatusCode UaVariant::toGuidArray | ( | UaGuidArray & | val ) | const |
Converts the UaVariant into a UaGuidArray.
val | a value as UaGuidArray. |
OpcUa_StatusCode UaVariant::toInt16 | ( | OpcUa_Int16 & | val ) | const |
Converts the UaVariant into a OpcUa_Int16.
val | a value as OpcUa_Int16. |
OpcUa_StatusCode UaVariant::toInt16Array | ( | UaInt16Array & | val ) | const |
Converts the UaVariant into a UaInt16Array.
val | a value as UaInt16Array. |
OpcUa_StatusCode UaVariant::toInt32 | ( | OpcUa_Int32 & | val ) | const |
Converts the UaVariant into a OpcUa_Int32.
val | a value as OpcUa_Int32. |
OpcUa_StatusCode UaVariant::toInt32Array | ( | UaInt32Array & | val ) | const |
Converts the UaVariant into a UaInt32Array.
val | a value as UaInt32Array. |
OpcUa_StatusCode UaVariant::toInt64 | ( | OpcUa_Int64 & | val ) | const |
Converts the UaVariant into a OpcUa_Int64.
val | a value as OpcUa_Int64. |
OpcUa_StatusCode UaVariant::toInt64Array | ( | UaInt64Array & | val ) | const |
Converts the UaVariant into a UaInt64Array.
val | a value as UaInt64Array. |
OpcUa_StatusCode UaVariant::toLocalizedText | ( | UaLocalizedText & | val ) | const |
Converts the UaVariant into a UaLocalizedText.
val | a value as UaLocalizedText. |
OpcUa_StatusCode UaVariant::toLocalizedTextArray | ( | UaLocalizedTextArray & | val ) | const |
Converts the UaVariant into an array of OpcUa_LocalizedText.
val | a value as UaLocalizedTextArray. |
OpcUa_StatusCode UaVariant::toNodeId | ( | UaNodeId & | val ) | const |
OpcUa_StatusCode UaVariant::toNodeIdArray | ( | UaNodeIdArray & | val ) | const |
Converts the UaVariant into a toNodeIdArray.
val | a value as UaNodeIdArray. |
OpcUa_StatusCode UaVariant::toQualifiedName | ( | UaQualifiedName & | val ) | const |
Converts the UaVariant into a UaQualifiedName.
val | a value as UaQualifiedName. |
OpcUa_StatusCode UaVariant::toQualifiedNameArray | ( | UaQualifiedNameArray & | val ) | const |
Converts the UaVariant into a UaQualifiedNameArray.
val | a value as UaQualifiedNameArray. |
OpcUa_StatusCode UaVariant::toSByte | ( | OpcUa_SByte & | val ) | const |
Converts the UaVariant into a OpcUa_SByte.
val | a value as OpcUa_SByte. |
OpcUa_StatusCode UaVariant::toSByteArray | ( | UaSByteArray & | val ) | const |
Converts the UaVariant into a UaSByteArray.
val | a value as UaSByteArray. |
OpcUa_StatusCode UaVariant::toStatusCode | ( | OpcUa_StatusCode & | val ) | const |
Converts the UaVariant into a OpcUa_StatusCode.
val | a value as OpcUa_StatusCode. |
OpcUa_StatusCode UaVariant::toStatusCodeArray | ( | UaStatusCodeArray & | val ) | const |
Converts the UaVariant into a UaStatusCodeArray.
val | a value as UaStatusCodeArray. |
UaString UaVariant::toString | ( | ) | const |
OpcUa_StatusCode UaVariant::toStringArray | ( | UaStringArray & | val ) | const |
Converts the UaVariant into a UaStringArray.
val | a value as UaStringArray. |
OpcUa_StatusCode UaVariant::toUInt16 | ( | OpcUa_UInt16 & | val ) | const |
Converts the UaVariant into a OpcUa_UInt16.
val | a value as OpcUa_UInt16. |
OpcUa_StatusCode UaVariant::toUInt16Array | ( | UaUInt16Array & | val ) | const |
Converts the UaVariant into a UaUInt16Array.
val | a value as UaUInt16Array. |
OpcUa_StatusCode UaVariant::toUInt32 | ( | OpcUa_UInt32 & | val ) | const |
Converts the UaVariant into a OpcUa_UInt32.
val | a value as OpcUa_UInt32. |
OpcUa_StatusCode UaVariant::toUInt32Array | ( | UaUInt32Array & | val ) | const |
Converts the UaVariant into a UaUInt32Array.
val | a value as UaUInt32Array. |
OpcUa_StatusCode UaVariant::toUInt64 | ( | OpcUa_UInt64 & | val ) | const |
Converts the UaVariant into a OpcUa_UInt64.
val | a value as OpcUa_UInt64. |
OpcUa_StatusCode UaVariant::toUInt64Array | ( | UaUInt64Array & | val ) | const |
Converts the UaVariant into a UaUInt64Array.
val | a value as UaUInt64Array. |
OpcUa_StatusCode UaVariant::toVariantArray | ( | UaVariantArray & | val ) | const |
Converts the UaVariant into an array of OpcUa_Variant.
val | a value as UaVariantArray. |
OpcUa_StatusCode UaVariant::toXmlElement | ( | UaByteString & | val ) | const |
Converts the UaVariant into a UaByteString containing the XML element.
val | a value as UaByteString. |
OpcUa_StatusCode UaVariant::toXmlElementArray | ( | UaByteStringArray & | val ) | const |
Converts the UaVariant into a UaByteStringArray.
val | a value as UaByteStringArray. |
OpcUa_BuiltInType UaVariant::type | ( | ) | const |
Get the type of the variable.
OpcUa_StatusCode UaVariant::UaTypeToVartype | ( | OpcUa_BuiltInType | uaType, |
OpcUa_Boolean | isArray, | ||
VARTYPE & | vt | ||
) | [static] |
Converts a UA built in type into a Windows VARTYPE.
[in] | uaType | The OPC UA built in type |
[in] | isArray | Flag indicating if the value is an array |
[out] | vt | The resulting Windows variant type |
OpcUa_StatusCode UaVariant::VartypeToUaType | ( | VARTYPE | vt, |
OpcUa_BuiltInType & | ut, | ||
OpcUa_Boolean & | isArray | ||
) | [static] |
Converts a Windows VARTYPE into a UA built in type.
[in] | vt | The Windows variant type |
[out] | ut | The resulting OPC UA built in type |
[out] | isArray | Flag indicating if the value is an array |