C++ Based OPC UA Client/Server SDK
1.6.5.478
|
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... | |
UaExtensionObject & | operator= (const UaExtensionObject &other) |
Assignment operator. More... | |
operator const OpcUa_ExtensionObject * () const | |
Return internal OpcUa_ExtensionObject structure. More... | |
OpcUa_ExtensionObject * | copy () 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... | |
UaExtensionObject & | attach (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_ByteString * | binary () const |
Returns the binary encoded object. More... | |
const OpcUa_XmlElement * | xml () const |
Returns the XML encoded object. More... | |
const OpcUa_EncodeableType * | objectType () const |
Returns the encodeable type of the object as structure. More... | |
Static Public Member Functions | |
static OpcUa_ExtensionObject * | clone (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 OpcUa_VariableTypeAttributes data to an existing OpcUa_VariableTypeAttributes structure. More... | |
Friends | |
UABASE_EXPORT UaDataStream & | operator<< (UaDataStream &, const UaExtensionObject &) |
Writes a ExtensionObject to the stream. More... | |
UABASE_EXPORT UaDataStream & | operator>> (UaDataStream &, UaExtensionObject &) |
Reads a ExtensionObject from the stream. More... | |
Derived from OpcUa_ExtensionObject.
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. |
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.
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.
|
static |
Copy OpcUa_VariableAttributes data to a newly allocated OpcUa_VariableAttributes.
source | Source to clone. |
|
static |
Copy OpcUa_VariableTypeAttributes data to an existing OpcUa_VariableTypeAttributes structure.
source | Source OpcUa_VariableTypeAttributes to clone. |
copy | New copy of source OpcUa_VariableTypeAttributes. |
OpcUa_ExtensionObject * UaExtensionObject::copy | ( | ) | const |
Copy UaExtensionObject data to a newly allocated OpcUa_ExtensionObject.
void UaExtensionObject::copyTo | ( | OpcUa_ExtensionObject * | pDst | ) | const |
Copy UaExtensionObject data to an existing OpcUa_ExtensionObject structure.
pDst | the 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.
UaExtensionObject & UaExtensionObject::operator= | ( | const UaExtensionObject & | other | ) |
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.
|
friend |
Writes a ExtensionObject to the stream.
|
friend |
Reads a ExtensionObject from the stream.