C++ UA Server SDK
1.5.2.336
|
A class that serializes and deserializes unions that is described by an UaStructureDefinition. More...
#include <uagenericunionvalue.h>
Inherits UaAbstractGenericStructureValue.
Public Member Functions | |
UaGenericUnionValue () | |
Creates an empty UaGenericUnionValue. More... | |
UaGenericUnionValue (const UaStructureDefinition &structureDefinition) | |
Creates an UaGenericUnionValue without a field set. More... | |
UaGenericUnionValue (const UaGenericUnionValue &other) | |
Copy constructor. More... | |
UaGenericUnionValue (const UaByteString &bsData, Encoding valueEncoding, const UaStructureDefinition &structureDefinition) | |
Parses a ByteString and stores the data to a new UaGenericUnionValue. More... | |
UaGenericUnionValue (const UaExtensionObject &extensionObject, const UaStructureDefinition &structureDefinition) | |
Parses a the binary data of an ExtenionObject and stores the data to a new UaGenericUnionValue. More... | |
virtual | ~UaGenericUnionValue () |
Desctruction. | |
virtual void | clear () |
Clears the UaGenericUnionValue. More... | |
bool | operator== (const UaGenericUnionValue &other) const |
Compares the content of two UaGenericUnionValues. More... | |
bool | operator!= (const UaGenericUnionValue &other) const |
Check if two UaGenericUnionValue are unequal. | |
OpcUa_StatusCode | setGenericUnion (const UaByteString &bsData, UaAbstractGenericValue::Encoding valueEncoding, const UaStructureDefinition &structureDefinition) |
Assignment operator. More... | |
OpcUa_StatusCode | setGenericUnion (const UaExtensionObject &extensionObject, const UaStructureDefinition &structureDefinition) |
Parses a the binary data of an ExtenionObject and stores the data to a new UaGenericUnionValue. More... | |
OpcUa_StatusCode | setValue (const UaString &sFieldName, UaVariant &value, OpcUa_Boolean bDetach) |
Sets the value of the union based on the structure field name. More... | |
OpcUa_StatusCode | setValue (int iIndex, UaVariant &value, OpcUa_Boolean bDetach) |
Sets the value of the union based on the structure field index. More... | |
OpcUa_StatusCode | setValue (const UaString &sFieldName, const UaVariant &value) |
Sets the value of the union based on the structure field name. More... | |
OpcUa_StatusCode | setValue (int iIndex, const UaVariant &value) |
Sets the value of the union based on the structure field index. More... | |
OpcUa_StatusCode | setValue (const UaString &sFieldName, const UaGenericStructureValue &value) |
Sets the value of the union based on the structure field name. More... | |
OpcUa_StatusCode | setValue (int iIndex, const UaGenericStructureValue &value) |
Sets the value of the union based on the structure field index. More... | |
OpcUa_StatusCode | setValue (const UaString &sFieldName, const UaGenericStructureArray &value) |
Sets the value of the union based on the structure field name. More... | |
OpcUa_StatusCode | setValue (int iIndex, const UaGenericStructureArray &value) |
Sets the value of the union based on the structure field index. More... | |
OpcUa_StatusCode | setValue (const UaString &sFieldName, const UaGenericUnionValue &value) |
Sets the value of the union based on the structure field name. More... | |
OpcUa_StatusCode | setValue (int iIndex, const UaGenericUnionValue &value) |
Sets the value of the union based on the structure field index. More... | |
OpcUa_StatusCode | setValue (const UaString &sFieldName, const UaGenericUnionArray &value) |
Sets the value of the union based on the structure field name. More... | |
OpcUa_StatusCode | setValue (int iIndex, const UaGenericUnionArray &value) |
Sets the value of the union based on the structure field index. More... | |
OpcUa_StatusCode | setValue (const UaString &sFieldName, const UaGenericOptionSetValue &value) |
Sets the value of the union based on the structure field name. More... | |
OpcUa_StatusCode | setValue (int iIndex, const UaGenericOptionSetValue &value) |
Sets the value of the union based on the structure field index. More... | |
OpcUa_StatusCode | setValue (const UaString &sFieldName, const UaGenericOptionSetArray &value) |
Sets the value of the union based on the structure field name. More... | |
OpcUa_StatusCode | setValue (int iIndex, const UaGenericOptionSetArray &value) |
Sets the value of the union based on the structure field index. More... | |
UaVariant | value () const |
Returns the current value of the UaGenericUnionValue. More... | |
UaGenericStructureValue | genericStructure (OpcUa_StatusCode *status=0) const |
Returns the current value of the UaGenericUnionValue. More... | |
UaGenericStructureArray | genericStructureArray (OpcUa_StatusCode *status=0) const |
Returns the current value of the UaGenericUnionValue. More... | |
UaGenericUnionValue | genericUnion (OpcUa_StatusCode *status=0) const |
Returns the current value of the UaGenericUnionValue. More... | |
UaGenericUnionArray | genericUnionArray (OpcUa_StatusCode *status=0) const |
Returns the current value of the UaGenericUnionValueArray. More... | |
UaGenericOptionSetValue | genericOptionSet (OpcUa_StatusCode *status=0) const |
Returns the current value of the UaGenericUnionValue. More... | |
UaGenericOptionSetArray | genericOptionSetArray (OpcUa_StatusCode *status=0) const |
Returns the current value of the UaGenericUnionValueArray. More... | |
int | switchValue () const |
Returns the index of the current used field for the UaGenericUnionValue. | |
UaStructureField | field () const |
Returns the current used field for the UaGenericUnionValue. | |
virtual UaStructureDefinition | definition () const |
Returns the definition of the UaGenericUnionValue. More... | |
void | decode (UaAbstractDecoder *pDecoder) |
Deserializing method that is used by the SDK internally. More... | |
void | encode (UaAbstractEncoder *pEncoder) const |
Serializing method that is used by the SDK internally. More... | |
Public Member Functions inherited from UaAbstractGenericValue | |
virtual void | toVariant (UaVariant &variant, Encoding valueEncoding=Encoding_Binary) const |
Serializes the UaGenericValue to the variant. More... | |
virtual void | toVariant (OpcUa_Variant &variant, Encoding valueEncoding=Encoding_Binary) const |
Serializes the UaGenericValue to the variant. More... | |
void | toDataValue (UaDataValue &dataValue, OpcUa_Boolean updateTimeStamps, Encoding valueEncoding=Encoding_Binary) const |
Serializes the UaGenericValue to the dataValue. More... | |
void | toDataValue (OpcUa_DataValue &dataValue, OpcUa_Boolean updateTimeStamps, Encoding valueEncoding=Encoding_Binary) const |
Serializes the UaGenericValue to the dataValue. More... | |
void | toExtensionObject (UaExtensionObject &extensionObject, Encoding valueEncoding=Encoding_Binary) const |
Serializes the UaGenericValue to the extensionObject. More... | |
void | toExtensionObject (OpcUa_ExtensionObject &extensionObject, Encoding valueEncoding=Encoding_Binary) const |
Serializes the UaGenericValue to the extensionObject. More... | |
Additional Inherited Members | |
Public Types inherited from UaAbstractGenericValue | |
enum | Encoding |
The possible encodings for a UaAbstractGenericValue. More... | |
Protected Member Functions inherited from UaAbstractGenericStructureValue | |
bool | checkValue (const UaStructureField &field, const UaVariant &value) const |
Checks whether value matches the DataType and ValueRank definition of field. More... | |
UaVariant | defaultValue (const UaStructureField &field) const |
Returns a value based on the DataType and the ValueRank of the field. More... | |
void | setVariantToFieldData (const UaStructureField &field, UaVariant &value, UaStructureFieldData &fieldData) const |
Detaches value. | |
Protected Member Functions inherited from UaAbstractGenericValue | |
UaStructureFieldData | readField (UaAbstractDecoder *pDecoder, const UaStructureField &field) const |
Deserializes a field. More... | |
void | writeField (UaAbstractEncoder *pEncoder, const UaStructureField &field, const UaStructureFieldData &value) const |
Serializes a field. More... | |
A class that serializes and deserializes unions that is described by an UaStructureDefinition.
The class can be used for DataTypes that are not registered to the stack.
UaGenericUnionValue::UaGenericUnionValue | ( | ) |
Creates an empty UaGenericUnionValue.
UaGenericUnionValue::UaGenericUnionValue | ( | const UaStructureDefinition & | structureDefinition | ) |
Creates an UaGenericUnionValue without a field set.
UaGenericUnionValue::UaGenericUnionValue | ( | const UaGenericUnionValue & | other | ) |
Copy constructor.
other | The other UaGenericUnionValue. |
UaGenericUnionValue::UaGenericUnionValue | ( | const UaByteString & | bsData, |
Encoding | valueEncoding, | ||
const UaStructureDefinition & | structureDefinition | ||
) |
Parses a ByteString and stores the data to a new UaGenericUnionValue.
UaGenericUnionValue::UaGenericUnionValue
bsData | The contend that will be deserialized. |
valueEncoding | The encoding of bsData |
structureDefinition | The definition that is used for deserializing. |
UaGenericUnionValue::UaGenericUnionValue | ( | const UaExtensionObject & | extensionObject, |
const UaStructureDefinition & | structureDefinition | ||
) |
Parses a the binary data of an ExtenionObject and stores the data to a new UaGenericUnionValue.
If the TypeId of the ExtenionObject does not match the structureDefinition, an empty UaGenericUnionValue will be created.
extensionObject | Contains the content that will be deserialized. |
structureDefinition | The definition that is used for deserializing. |
|
virtual |
Clears the UaGenericUnionValue.
Clears the value and sets the StructureDefinition to an invalid definition.
Implements UaAbstractGenericValue.
|
virtual |
Deserializing method that is used by the SDK internally.
Implements UaAbstractGenericValue.
|
virtual |
Returns the definition of the UaGenericUnionValue.
Implements UaAbstractGenericStructureValue.
|
virtual |
Serializing method that is used by the SDK internally.
Implements UaAbstractGenericValue.
UaGenericOptionSetValue UaGenericUnionValue::genericOptionSet | ( | OpcUa_StatusCode * | status = 0 | ) | const |
Returns the current value of the UaGenericUnionValue.
status | Is set to OpcUa_BadTypeMismatch if the current value of the UaGenericUnionValue is not a union. Is set too OpcUa_Good otherwise. Can be NULL. |
UaGenericOptionSetArray UaGenericUnionValue::genericOptionSetArray | ( | OpcUa_StatusCode * | status = 0 | ) | const |
Returns the current value of the UaGenericUnionValueArray.
status | Is set to OpcUa_BadTypeMismatch if the current value of the UaGenericUnionValue is not an array of unions. Is set too OpcUa_Good otherwise. Can be NULL. |
UaGenericStructureValue UaGenericUnionValue::genericStructure | ( | OpcUa_StatusCode * | status = 0 | ) | const |
Returns the current value of the UaGenericUnionValue.
status | Is set to OpcUa_BadTypeMismatch if the current value of the UaGenericUnionValue is not a structure. Is set too OpcUa_Good otherwise. Can be NULL. |
UaGenericStructureArray UaGenericUnionValue::genericStructureArray | ( | OpcUa_StatusCode * | status = 0 | ) | const |
Returns the current value of the UaGenericUnionValue.
status | Is set to OpcUa_BadTypeMismatch if the current value of the UaGenericUnionValue is not an array of structures. Is set too OpcUa_Good otherwise. Can be NULL. |
UaGenericUnionValue UaGenericUnionValue::genericUnion | ( | OpcUa_StatusCode * | status = 0 | ) | const |
Returns the current value of the UaGenericUnionValue.
status | Is set to OpcUa_BadTypeMismatch if the current value of the UaGenericUnionValue is not a union. Is set too OpcUa_Good otherwise. Can be NULL. |
UaGenericUnionArray UaGenericUnionValue::genericUnionArray | ( | OpcUa_StatusCode * | status = 0 | ) | const |
Returns the current value of the UaGenericUnionValueArray.
status | Is set to OpcUa_BadTypeMismatch if the current value of the UaGenericUnionValue is not an array of unions. Is set too OpcUa_Good otherwise. Can be NULL. |
bool UaGenericUnionValue::operator== | ( | const UaGenericUnionValue & | other | ) | const |
Compares the content of two UaGenericUnionValues.
OpcUa_StatusCode UaGenericUnionValue::setGenericUnion | ( | const UaByteString & | bsData, |
UaAbstractGenericValue::Encoding | valueEncoding, | ||
const UaStructureDefinition & | structureDefinition | ||
) |
Assignment operator.
OpcUa_StatusCode UaGenericUnionValue::setGenericUnion | ( | const UaExtensionObject & | extensionObject, |
const UaStructureDefinition & | structureDefinition | ||
) |
Parses a the binary data of an ExtenionObject and stores the data to a new UaGenericUnionValue.
If the TypeId of the ExtenionObject does not match the structureDefinition, the UaGenericUnionValue will not be changed.
extensionObject | Contains the content that will be deserialized. |
structureDefinition | The definition that is used for deserializing. |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | const UaString & | sFieldName, |
UaVariant & | value, | ||
OpcUa_Boolean | bDetach | ||
) |
Sets the value of the union based on the structure field name.
sFieldName | The name of the structure field to use for the value |
value | The new value of the UaGenericUnionValue |
bDetach | If true UaGenericUnionValue attaches value. If false value is copied. |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | int | iIndex, |
UaVariant & | value, | ||
OpcUa_Boolean | bDetach | ||
) |
Sets the value of the union based on the structure field index.
iIndex | Index of the structure field |
value | The new value of the UaGenericUnionValue |
bDetach | If true UaGenericUnionValue attaches value. If false value is copied. |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | const UaString & | sFieldName, |
const UaVariant & | value | ||
) |
Sets the value of the union based on the structure field name.
sFieldName | The name of the structure field to use for the value |
value | The new value of the UaGenericUnionValue |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | int | iIndex, |
const UaVariant & | value | ||
) |
Sets the value of the union based on the structure field index.
iIndex | Index of the structure field |
value | The new value of the UaGenericUnionValue |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | const UaString & | sFieldName, |
const UaGenericStructureValue & | value | ||
) |
Sets the value of the union based on the structure field name.
sFieldName | The name of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue. |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | int | iIndex, |
const UaGenericStructureValue & | value | ||
) |
Sets the value of the union based on the structure field index.
iIndex | The index of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | const UaString & | sFieldName, |
const UaGenericStructureArray & | value | ||
) |
Sets the value of the union based on the structure field name.
sFieldName | The name of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue. |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | int | iIndex, |
const UaGenericStructureArray & | value | ||
) |
Sets the value of the union based on the structure field index.
iIndex | The index of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | const UaString & | sFieldName, |
const UaGenericUnionValue & | value | ||
) |
Sets the value of the union based on the structure field name.
sFieldName | The name of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue. |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | int | iIndex, |
const UaGenericUnionValue & | value | ||
) |
Sets the value of the union based on the structure field index.
iIndex | The index of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | const UaString & | sFieldName, |
const UaGenericUnionArray & | value | ||
) |
Sets the value of the union based on the structure field name.
sFieldName | The name of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue. |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | int | iIndex, |
const UaGenericUnionArray & | value | ||
) |
Sets the value of the union based on the structure field index.
iIndex | The index of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | const UaString & | sFieldName, |
const UaGenericOptionSetValue & | value | ||
) |
Sets the value of the union based on the structure field name.
sFieldName | The name of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue. |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | int | iIndex, |
const UaGenericOptionSetValue & | value | ||
) |
Sets the value of the union based on the structure field index.
iIndex | The index of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | const UaString & | sFieldName, |
const UaGenericOptionSetArray & | value | ||
) |
Sets the value of the union based on the structure field name.
sFieldName | The name of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue. |
OpcUa_StatusCode UaGenericUnionValue::setValue | ( | int | iIndex, |
const UaGenericOptionSetArray & | value | ||
) |
Sets the value of the union based on the structure field index.
iIndex | The index of the structure field to use for the value. |
value | The new value of the UaGenericUnionValue |
UaVariant UaGenericUnionValue::value | ( | ) | const |
Returns the current value of the UaGenericUnionValue.