C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
UaGenericOptionSetValue Class Reference

A class that serializes and deserializes data that is described by an UaOptionSetDefinition. More...

#include <uagenericoptionsetvalue.h>

Inherits UaAbstractGenericValue.

Public Member Functions

 UaGenericOptionSetValue ()
 Creates an empty UaGenericOptionSetValue. More...
 
 UaGenericOptionSetValue (const UaOptionSetDefinition &optionSetDefinition)
 Creates a UaGenericOptionSetValue with each bit set to 0. More...
 
 UaGenericOptionSetValue (const UaGenericOptionSetValue &other)
 Copy constructor. More...
 
 UaGenericOptionSetValue (const UaVariant &value, const UaOptionSetDefinition &optionSetDefinition)
 Creates a UaGenericOptionSetValue. More...
 
virtual ~UaGenericOptionSetValue ()
 Desctruction.
 
virtual void clear ()
 Clears the UaGenericOptionSetValue. More...
 
bool operator== (const UaGenericOptionSetValue &other) const
 Compares the content of two UaGenericOptionSetValues.
 
bool operator!= (const UaGenericOptionSetValue &other) const
 Checks if two UaGenericOptionSetValues are unequal. More...
 
UaGenericOptionSetValueoperator= (const UaGenericOptionSetValue &other)
 Assignment operator. More...
 
OpcUa_StatusCode setOptionSetValue (const UaVariant &value, const UaOptionSetDefinition &optionSetDefinition)
 Sets a UaGenericOptionSetValue. More...
 
OpcUa_StatusCode setValue (const UaString &sFieldName, OpcUa_Boolean bValue)
 Sets the value for a OptionSet field based on the field name. More...
 
OpcUa_StatusCode setValue (int iIndex, OpcUa_Boolean bValue)
 Sets the value for a OptionSet field based on the field index. More...
 
OpcUa_Boolean value (const UaString &sFieldName, OpcUa_StatusCode *status=0) const
 Returns the value for a OptionSet field based on the field name. More...
 
OpcUa_Boolean value (int iIndex, OpcUa_StatusCode *status=0) const
 Returns the value for a OptionSet field based on the field index. More...
 
UaOptionSetDefinition optionSetDefinition () const
 Returns the OptionSetDefinition of the UaGenericOptionSetValue. More...
 
void setOptionSetDefinition (const UaOptionSetDefinition &definition)
 Clears the UaGenericOptionSetValue and sets the OptionSet definition. More...
 
UaString toString () const
 Returns a string representation of the value. More...
 
virtual OpcUa_StatusCode toVariant (UaVariant &variant, Encoding valueEncoding=Encoding_Binary) const
 Serializes the UaGenericValue to the variant. More...
 
virtual OpcUa_StatusCode toVariant (OpcUa_Variant &variant, Encoding valueEncoding=Encoding_Binary) const
 Serializes the UaGenericValue to the variant. More...
 
OpcUa_StatusCode decode (UaAbstractDecoder *pDecoder)
 Deserializing method that is used by the SDK internally. More...
 
OpcUa_StatusCode encode (UaAbstractEncoder *pEncoder) const
 Serializing method that is used by the SDK internally. More...
 
- Public Member Functions inherited from UaAbstractGenericValue
OpcUa_StatusCode toDataValue (UaDataValue &dataValue, OpcUa_Boolean updateTimeStamps, Encoding valueEncoding=Encoding_Binary) const
 Serializes the UaGenericValue to the dataValue. More...
 
OpcUa_StatusCode toDataValue (OpcUa_DataValue &dataValue, OpcUa_Boolean updateTimeStamps, Encoding valueEncoding=Encoding_Binary) const
 Serializes the UaGenericValue to the dataValue. More...
 
OpcUa_StatusCode toExtensionObject (UaExtensionObject &extensionObject, Encoding valueEncoding=Encoding_Binary) const
 Serializes the UaGenericValue to the extensionObject. More...
 
OpcUa_StatusCode 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
UaStructureFieldData readField (UaAbstractDecoder *pDecoder, const UaStructureField &field, OpcUa_StatusCode &readStatus) const
 Deserializes a field. More...
 
OpcUa_StatusCode writeField (UaAbstractEncoder *pEncoder, const UaStructureField &field, const UaStructureFieldData &value) const
 Serializes a field. More...
 

Detailed Description

A class that serializes and deserializes data that is described by an UaOptionSetDefinition.

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.

Constructor & Destructor Documentation

UaGenericOptionSetValue::UaGenericOptionSetValue ( )

Creates an empty UaGenericOptionSetValue.

UaGenericOptionSetValue::UaGenericOptionSetValue ( const UaOptionSetDefinition optionSetDefinition)

Creates a UaGenericOptionSetValue with each bit set to 0.

UaGenericOptionSetValue::UaGenericOptionSetValue ( const UaGenericOptionSetValue other)

Copy constructor.

Parameters
otherThe UaGenericOptionSetValue to copy.
UaGenericOptionSetValue::UaGenericOptionSetValue ( const UaVariant value,
const UaOptionSetDefinition optionSetDefinition 
)

Creates a UaGenericOptionSetValue.

Parameters
valueThe value that will be serialized.
optionSetDefinitionThe definition that is used for deserializing.

Member Function Documentation

void UaGenericOptionSetValue::clear ( )
virtual

Clears the UaGenericOptionSetValue.

Clears all values and sets the OptionSetDefinition to an invalid definition.

Implements UaAbstractGenericValue.

OpcUa_StatusCode UaGenericOptionSetValue::decode ( UaAbstractDecoder pDecoder)
virtual

Deserializing method that is used by the SDK internally.

Implements UaAbstractGenericValue.

OpcUa_StatusCode UaGenericOptionSetValue::encode ( UaAbstractEncoder pEncoder) const
virtual

Serializing method that is used by the SDK internally.

Implements UaAbstractGenericValue.

bool UaGenericOptionSetValue::operator!= ( const UaGenericOptionSetValue other) const

Checks if two UaGenericOptionSetValues are unequal.

UaGenericOptionSetValue & UaGenericOptionSetValue::operator= ( const UaGenericOptionSetValue other)

Assignment operator.

UaOptionSetDefinition UaGenericOptionSetValue::optionSetDefinition ( ) const

Returns the OptionSetDefinition of the UaGenericOptionSetValue.

void UaGenericOptionSetValue::setOptionSetDefinition ( const UaOptionSetDefinition definition)

Clears the UaGenericOptionSetValue and sets the OptionSet definition.

Parameters
definitionThe new OptionSet definition
OpcUa_StatusCode UaGenericOptionSetValue::setOptionSetValue ( const UaVariant value,
const UaOptionSetDefinition optionSetDefinition 
)

Sets a UaGenericOptionSetValue.

Parameters
valueThe value that will be serialized.
optionSetDefinitionThe definition that is used for deserializing.
OpcUa_StatusCode UaGenericOptionSetValue::setValue ( const UaString sFieldName,
OpcUa_Boolean  bValue 
)

Sets the value for a OptionSet field based on the field name.

Parameters
sFieldNameName of the OptionSet field to set.
bValueThe new value for the field.
Returns
OpcUa_Good if the value was updated, OpcUa_BadInvalidArgument if the name was invalid.
OpcUa_StatusCode UaGenericOptionSetValue::setValue ( int  iIndex,
OpcUa_Boolean  bValue 
)

Sets the value for a OptionSet field based on the field index.

Parameters
iIndexIndex of the OptionSet field to set.
bValueThe new value for the field.
Returns
OpcUa_Good if the value was updated, OpcUa_BadInvalidArgument if the index was out of range.
UaString UaGenericOptionSetValue::toString ( ) const

Returns a string representation of the value.

This string can be used for showing in a GUI. There is no method fromString.

OpcUa_StatusCode UaGenericOptionSetValue::toVariant ( UaVariant variant,
Encoding  valueEncoding = Encoding_Binary 
) const
virtual

Serializes the UaGenericValue to the variant.

Reimplemented from UaAbstractGenericValue.

OpcUa_StatusCode UaGenericOptionSetValue::toVariant ( OpcUa_Variant variant,
Encoding  valueEncoding = Encoding_Binary 
) const
virtual

Serializes the UaGenericValue to the variant.

Reimplemented from UaAbstractGenericValue.

OpcUa_Boolean UaGenericOptionSetValue::value ( const UaString sFieldName,
OpcUa_StatusCode status = 0 
) const

Returns the value for a OptionSet field based on the field name.

Parameters
sFieldNameName of the OptionSet field value to return.
statusWill be set to OpcUa_BadInvalidArgument if the name is invalid, OpcUa_Good otherwise. This argument can be null.
Returns
The value of the field.
OpcUa_Boolean UaGenericOptionSetValue::value ( int  iIndex,
OpcUa_StatusCode status = 0 
) const

Returns the value for a OptionSet field based on the field index.

Parameters
iIndexIndex of the OptionSet field value to return.
statusWill be set to OpcUa_BadInvalidArgument if the name is invalid, OpcUa_Good otherwise. This argument can be null.
Returns
The value of the field.

The documentation for this class was generated from the following files: