C++ Based OPC UA Client/Server SDK  1.5.5.355
UaExtensionObject Class Reference

Derived from OpcUa_ExtensionObject. More...

#include <uaextensionobject.h>

Inherits OpcUa_ExtensionObject.

Public Types

enum  ExtensionObjectEncoding { None = OpcUa_ExtensionObjectEncoding_None, Binary = OpcUa_ExtensionObjectEncoding_Binary, Xml = OpcUa_ExtensionObjectEncoding_Xml, EncodeableObject = OpcUa_ExtensionObjectEncoding_EncodeableObject }
 Definition of the ExtensionObjectEncoding Enumeration. More...
 

Public Member Functions

 UaExtensionObject ()
 Constructs an empty extension object.
 
 UaExtensionObject (const UaExtensionObject &other)
 Constructs an extension object with the other extension object.
 
 UaExtensionObject (const OpcUa_ExtensionObject &other)
 Constructs an extension object with the other extension object.
 
 ~UaExtensionObject ()
 destruction
 
void clear ()
 Clear the data of the UaExtensionObject. More...
 
UaExtensionObjectoperator= (const UaExtensionObject &other)
 Assignment operator. More...
 
 operator const OpcUa_ExtensionObject * () const
 Return internal OpcUa_ExtensionObject structure. More...
 
OpcUa_ExtensionObjectcopy () const
 Copy UaExtensionObject data to a newly allocated OpcUa_ExtensionObject. More...
 
void copyTo (OpcUa_ExtensionObject *pDst) const
 Copy UaExtensionObject data to an existing OpcUa_ExtensionObject structure. More...
 
void detach ()
 Reset OpcUa_ExtensionObject structure without clearing the data. More...
 
UaExtensionObjectattach (const OpcUa_ExtensionObject *pSrc)
 Attaches an existing OpcUa_ExtensionObject structure. More...
 
ExtensionObjectEncoding encoding () const
 Returns the encoding of the extension object. More...
 
UaStatus changeEncoding (ExtensionObjectEncoding newEncoding)
 Changes the encoding of the extension object. More...
 
UaNodeId encodingTypeId () const
 Returns the NodeId for the DataTypeEncoding node in the server's address space. More...
 
UaNodeId dataTypeId () const
 Returns the data type id of the encodeable object. More...
 
UaNodeId dataTypeId (const UaStringArray &namespaceTable) const
 Returns the data type id of the encodeable object. More...
 
const OpcUa_Void * object () const
 Returns a pointer to the object as structure. More...
 
UaGenericStructureValue value (UaStructureDefinition structureDefinition) const
 Returns the deserialized generic value. More...
 
void setValue (const UaGenericStructureValue &genericStructure, UaAbstractGenericValue::Encoding valueEncoding)
 Set a generic value. More...
 
const OpcUa_ByteStringbinary () const
 Returns the binary encoded object. More...
 
const OpcUa_XmlElementxml () const
 Returns the XML encoded object. More...
 
const OpcUa_EncodeableTypeobjectType () const
 Returns the encodeable type of the object as structure. More...
 

Static Public Member Functions

static OpcUa_ExtensionObjectclone (const OpcUa_ExtensionObject &source)
 Copy OpcUa_VariableAttributes data to a newly allocated OpcUa_VariableAttributes. More...
 
static void cloneTo (const OpcUa_ExtensionObject &source, OpcUa_ExtensionObject &copy)
 Copy OpcUa_VariableTypeAttributes data to an existing OpcUa_VariableTypeAttributes structure. More...
 

Detailed Description

Derived from OpcUa_ExtensionObject.

Member Enumeration Documentation

Definition of the ExtensionObjectEncoding Enumeration.

Enumerator
None 

None: The ExtensionObject does not contain an data.

Binary 

Binary: The data of the ExtensionObject is encoded as a binary string. Call binary() const to receive the raw data. If there is structure information available, you can call value(UaStructureDefinition structureDefinition) const.

Xml 

Xml: The data of the ExtensionObject is encoded as an XML string. Call xml() const to receive the raw data.

EncodeableObject 

EncodableObject: The ExtensionObject is encoded as object. Call object() const to receive the decoded structure. Use the constructors of the DataType classes for deserializing the ExtensionObject.

Member Function Documentation

UaExtensionObject & UaExtensionObject::attach ( const OpcUa_ExtensionObject pSrc)

Attaches an existing OpcUa_ExtensionObject structure.

Don't manually free the attached structure afterwards, because UaExtensionObject is responsible for it now.

Parameters
pSrc[in] Parameter to attach.
const OpcUa_ByteString * UaExtensionObject::binary ( ) const

Returns the binary encoded object.

If the ExtensionObject body is not encoded as Binary (see encoding()), NULL is returned.

UaStatus UaExtensionObject::changeEncoding ( ExtensionObjectEncoding  newEncoding)

Changes the encoding of the extension object.

The current version only supports the conversion from EncodeableObject to Binary.

The return value indicates success of the conversion.

void UaExtensionObject::clear ( )

Clear the data of the UaExtensionObject.

OpcUa_ExtensionObject * UaExtensionObject::clone ( const OpcUa_ExtensionObject source)
static

Copy OpcUa_VariableAttributes data to a newly allocated OpcUa_VariableAttributes.

Parameters
sourceSource to clone.
Returns
new copy.
void UaExtensionObject::cloneTo ( const OpcUa_ExtensionObject source,
OpcUa_ExtensionObject copy 
)
static

Copy OpcUa_VariableTypeAttributes data to an existing OpcUa_VariableTypeAttributes structure.

Parameters
sourceSource OpcUa_VariableTypeAttributes to clone.
copyNew copy of source OpcUa_VariableTypeAttributes.
OpcUa_ExtensionObject * UaExtensionObject::copy ( ) const

Copy UaExtensionObject data to a newly allocated OpcUa_ExtensionObject.

Returns
a newly allocated OpcUa_ExtensionObject.
void UaExtensionObject::copyTo ( OpcUa_ExtensionObject pDst) const

Copy UaExtensionObject data to an existing OpcUa_ExtensionObject structure.

Parameters
pDstthe destination of this operation.
UaNodeId UaExtensionObject::dataTypeId ( ) const

Returns the data type id of the encodeable object.

If the ExtensionObject is not encoded as EncodeableObject, a NULL NodeId is returned. If the EncodeableType is not a standard OPC UA type and the TypeId is NULL, a NULL NodeId is retured. You can call UaExtensionObject::dataTypeId(const UaStringArray &namespaceTable) const to get the DataType Id in this case. E.g. the TypeId of the ExtensionObject is NULL if you call [StructuredDataType]::toExtensionObject.

UaNodeId UaExtensionObject::dataTypeId ( const UaStringArray namespaceTable) const

Returns the data type id of the encodeable object.

If the ExtensionObject body is not encoded as EncodeableObject or the NamespaceUri of the EncodeableObject is not part of the namespaceTable, a NULL NodeId is returned. It is recommended that the namespaceTable starts with "http://opcfoundation.org/UA/".

void UaExtensionObject::detach ( )

Reset OpcUa_ExtensionObject structure without clearing the data.

UaExtensionObject::ExtensionObjectEncoding UaExtensionObject::encoding ( ) const

Returns the encoding of the extension object.

The return value indicates how to get the content of the ExtensionObject (see UaExtensionObject::ExtensionObjectEncoding).

UaNodeId UaExtensionObject::encodingTypeId ( ) const

Returns the NodeId for the DataTypeEncoding node in the server's address space.

const OpcUa_Void * UaExtensionObject::object ( ) const

Returns a pointer to the object as structure.

If the ExtensionObject body is not encoded as EncodeableObject (see encoding()), NULL is returned.

const OpcUa_EncodeableType * UaExtensionObject::objectType ( ) const

Returns the encodeable type of the object as structure.

UaExtensionObject::operator const OpcUa_ExtensionObject * ( ) const

Return internal OpcUa_ExtensionObject structure.

Returns
internal OpcUa_ExtensionObject structure.
UaExtensionObject & UaExtensionObject::operator= ( const UaExtensionObject other)

Assignment operator.

Parameters
otherthe UaExtensionObject to assign.
Returns
Assignment operator.
void UaExtensionObject::setValue ( const UaGenericStructureValue genericStructure,
UaAbstractGenericValue::Encoding  valueEncoding 
)

Set a generic value.

This method is deprecated. Use UaGenericUnionValue::toExtensionObject instead.

UaGenericStructureValue UaExtensionObject::value ( UaStructureDefinition  structureDefinition) const

Returns the deserialized generic value.

If the ExtensionObject body is encoded as EncodeableObject, an empty GenericValue is returned.

This method is deprecated. Use UaGenericUnionValue(const UaExtensionObject &extensionObject, const UaStructureDefinition &structureDefinition) instead.

const OpcUa_XmlElement * UaExtensionObject::xml ( ) const

Returns the XML encoded object.

If the ExtensionObject body is not encoded as XML element (see encoding()), NULL is returned.


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