UA Server SDK C++ Bundle
1.4.1.271
|
A class that serializes and deserializes data that is described by an UaStructureDefinition. More...
#include <uagenericvalue.h>
Inherits UaAbstractGenericValue.
Public Member Functions | |
UaGenericValue () | |
Creates an empty UaGenericValue. More... | |
UaGenericValue (const UaStructureDefinition &structureDefinition) | |
Creates a UaGenericValue with default values for each field. More... | |
UaGenericValue (const UaGenericValue &other) | |
Copy constructor. More... | |
UaGenericValue (const UaByteString &bsData, Encoding valueEncoding, const UaStructureDefinition &structureDefinition) | |
Creates a UaGenericValue. More... | |
virtual | ~UaGenericValue () |
Desctruction. | |
virtual void | clear () |
Clears the UaGenericValue. More... | |
bool | operator== (const UaGenericValue &other) const |
Compares the content of two UaGenericValues. | |
bool | operator!= (const UaGenericValue &other) const |
Checks if two UaGenericValues are unequal. More... | |
UaGenericValue & | operator= (const UaGenericValue &other) |
Assignment operator. More... | |
OpcUa_StatusCode | setGenericValue (const UaByteString &bsData, Encoding valueEncoding, const UaStructureDefinition &structureDefinition) |
Sets a UaGenericValue. More... | |
OpcUa_StatusCode | setField (const UaString &sFieldName, const UaVariant &value) |
Sets the value for a structure field based on the field name. More... | |
OpcUa_StatusCode | setField (int iIndex, const UaVariant &value) |
Sets the value for a structure field based on the field index. More... | |
UaVariant | value (const UaString &sFieldName) const |
Returns the value for a structure field based on the field name. More... | |
UaVariant | value (int iIndex) const |
Returns the value for a structure field based on the field index. More... | |
UaStructureDefinition | definition () const |
Returns the StructureDefinition of the UaGenericValue. More... | |
UaString | toString () const |
Returns a string representation of the value. 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 | |
void | toVariant (UaVariant &variant, Encoding valueEncoding=Encoding_Binary) const |
Serializes the UaGenericValue to the variant. More... | |
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 UaAbstractGenericValue | |
UaVariant | readField (UaAbstractDecoder *pDecoder, const UaStructureField &field) const |
Deserializes a field. More... | |
void | writeField (UaAbstractEncoder *pEncoder, const UaStructureField &field, const UaVariant &value) const |
Serializes a field. More... | |
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... | |
A class that serializes and deserializes data that is described by an UaStructureDefinition.
The serialized data can be accessed by index or by field name. The class can be used for DataTypes that are not registered to the stack.
UaGenericValue::UaGenericValue | ( | ) |
Creates an empty UaGenericValue.
UaGenericValue::UaGenericValue | ( | const UaStructureDefinition & | structureDefinition | ) |
Creates a UaGenericValue with default values for each field.
UaGenericValue::UaGenericValue | ( | const UaGenericValue & | other | ) |
Copy constructor.
other | the UaGenericValue. |
UaGenericValue::UaGenericValue | ( | const UaByteString & | bsData, |
UaAbstractGenericValue::Encoding | valueEncoding, | ||
const UaStructureDefinition & | structureDefinition | ||
) |
Creates a UaGenericValue.
bsData | The content that will be serialized. |
valueEncoding | The encoding of bsData. |
structureDefinition | The definition that is used for deserializing. |
|
virtual |
Clears the UaGenericValue.
Clears all values 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 StructureDefinition of the UaGenericValue.
Implements UaAbstractGenericValue.
|
virtual |
Serializing method that is used by the SDK internally.
Implements UaAbstractGenericValue.
bool UaGenericValue::operator!= | ( | const UaGenericValue & | other | ) | const |
Checks if two UaGenericValues are unequal.
UaGenericValue & UaGenericValue::operator= | ( | const UaGenericValue & | other | ) |
Assignment operator.
Sets the value for a structure field based on the field name.
sFieldName | Name of the structure field to set. |
value | The new value for the field. |
OpcUa_StatusCode UaGenericValue::setField | ( | int | iIndex, |
const UaVariant & | value | ||
) |
Sets the value for a structure field based on the field index.
iIndex | Index of the structure field to set. |
value | The new value for the field. |
OpcUa_StatusCode UaGenericValue::setGenericValue | ( | const UaByteString & | bsData, |
UaAbstractGenericValue::Encoding | valueEncoding, | ||
const UaStructureDefinition & | structureDefinition | ||
) |
Sets a UaGenericValue.
bsData | The content that will be serialized. |
valueEncoding | The encoding of bsData. |
structureDefinition | The definition that is used for deserializing. |
UaString UaGenericValue::toString | ( | ) | const |
Returns a string representation of the value.
This string can be used for showing in a GUI. There is no method fromString.
UaVariant UaGenericValue::value | ( | int | iIndex | ) | const |