C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537

Wrapper class for the UA stack structure OpcUa_Argument. More...

#include <uaargument.h>

Public Member Functions

 UaArgument ()
 Constructs an instance of the class UaArgument with empty default values.
 
 UaArgument (const UaArgument &other)
 Constructs an instance of the class UaArgument with values from another UaArgument object. More...
 
 UaArgument (const OpcUa_Argument &other)
 Constructs an instance of the class UaArgument with values from another OpcUa_Argument structure. More...
 
 UaArgument (const UaString &name, const UaNodeId &dataType, OpcUa_Int32 valueRank, const UaUInt32Array &arrayDimensions, const UaLocalizedText &description)
 Constructs an instance of the class UaArgument with values provided in the constructor.
 
 UaArgument (const UaExtensionObject &extensionObject)
 Constructs an instance of the class UaArgument initialized with value from a UaExtensionObject. More...
 
 UaArgument (const OpcUa_ExtensionObject &extensionObject)
 Constructs an instance of the class UaArgument initialized with value from an OpcUa_ExtensionObject structure. More...
 
 ~UaArgument ()
 Destroys the UaArgument object.
 
void clear ()
 Clear the data of the UaArgument. More...
 
bool operator== (const UaArgument &other) const
 Compare two UaArgument for equality. More...
 
bool operator!= (const UaArgument &other) const
 Compare two UaArgument for inequality. More...
 
UaArgumentoperator= (const UaArgument &other)
 Assignment operator. More...
 
OpcUa_Argumentcopy () const
 Copy UaArgument data to a newly allocated OpcUa_Argument. More...
 
void copyTo (OpcUa_Argument *pDst) const
 Copy UaArgument data to an existing OpcUa_Argument structure. More...
 
void attach (OpcUa_Argument *pValue)
 Attaches to an existing OpcUa_Argument structure. More...
 
OpcUa_Argumentdetach (OpcUa_Argument *pDst)
 Detaches the internal Argument structure from this class. More...
 
UaString getName () const
 The name of the argument.
 
UaNodeId getDataType () const
 The NodeId of the DataType of this argument.
 
OpcUa_Int32 getValueRank () const
 Indicates whether the DataType is an array and how many dimensions the array has. More...
 
void getArrayDimensions (UaUInt32Array &arrayDimensions) const
 Specifies the length of each dimension for an array dataType. More...
 
UaLocalizedText getDescription () const
 A localised description of the argument.
 
void setName (const UaString &name)
 The name of the argument.
 
void setDataType (const UaNodeId &dataType)
 The NodeId of the DataType of this argument.
 
void setValueRank (OpcUa_Int32 valueRank)
 Indicates whether the DataType is an array and how many dimensions the array has. More...
 
void setArrayDimensions (const UaUInt32Array &arrayDimensions)
 Specifies the length of each dimension for an array dataType. More...
 
void setDescription (const UaLocalizedText &description)
 A localised description of the argument.
 

Static Public Member Functions

static OpcUa_Argumentclone (const OpcUa_Argument &source)
 Copy OpcUa_Argument data to a newly allocated OpcUa_Argument. More...
 
static void cloneTo (const OpcUa_Argument &source, OpcUa_Argument &copy)
 Copy OpcUa_Argument data to an existing OpcUa_Argument structure. More...
 

Detailed Description

Wrapper class for the UA stack structure OpcUa_Argument.

This class encapsulates the native OpcUa_Argument structure and handles memory allocation and cleanup for you. UaArgument uses implicit sharing to avoid needless copying and to boost the performance. Only if you modify a shared Argument it creates a copy for that (copy-on-write). So assigning another UaArgument or passing it as parameter needs constant time and is nearly as fast as assigning a pointer.

Defines a method input or output argument specification.

It is for example used in the input and output argument Properties for methods.

Constructor & Destructor Documentation

UaArgument::UaArgument ( const UaArgument other)

Constructs an instance of the class UaArgument with values from another UaArgument object.

Parameters
otherthe other UaArgument used to initialize the object
UaArgument::UaArgument ( const OpcUa_Argument other)

Constructs an instance of the class UaArgument with values from another OpcUa_Argument structure.

Parameters
otherthe other OpcUa_Argument used to initialize the object
UaArgument::UaArgument ( const UaExtensionObject extensionObject)

Constructs an instance of the class UaArgument initialized with value from a UaExtensionObject.

Parameters
extensionObjectthe extension object containing the Argument
UaArgument::UaArgument ( const OpcUa_ExtensionObject extensionObject)

Constructs an instance of the class UaArgument initialized with value from an OpcUa_ExtensionObject structure.

Parameters
extensionObjectthe extension object containing the Argument

Member Function Documentation

void UaArgument::attach ( OpcUa_Argument pValue)

Attaches to an existing OpcUa_Argument structure.

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

Parameters
pValue[in] Parameter to attach to.
void UaArgument::clear ( )

Clear the data of the UaArgument.

OpcUa_Argument * UaArgument::clone ( const OpcUa_Argument source)
static

Copy OpcUa_Argument data to a newly allocated OpcUa_Argument.

Parameters
sourceSource to clone.
Returns
pointer to a newly allocated OpcUa_Argument.
void UaArgument::cloneTo ( const OpcUa_Argument source,
OpcUa_Argument copy 
)
static

Copy OpcUa_Argument data to an existing OpcUa_Argument structure.

Parameters
sourcethe source of the clone operation.
copythe destination of the clone operation.
OpcUa_Argument * UaArgument::copy ( ) const

Copy UaArgument data to a newly allocated OpcUa_Argument.

Returns
pointer to a newly allocated OpcUa_Argument.
void UaArgument::copyTo ( OpcUa_Argument pDst) const

Copy UaArgument data to an existing OpcUa_Argument structure.

Parameters
pDstthe destination of this copy operation.
OpcUa_Argument * UaArgument::detach ( OpcUa_Argument pDst)

Detaches the internal Argument structure from this class.

This way you take over the control of freeing the Argument data. If more than one reference exists, the data is copied to pDst instead of being detached.

Parameters
pDst[out] Pointer to an OpcUa_Argument structure that receives the Argument data.
Returns
If the function succeeds, pDst is returned, otherwise 0 is returned.
void UaArgument::getArrayDimensions ( UaUInt32Array arrayDimensions) const

Specifies the length of each dimension for an array dataType.

It is intended to describe the capability of the DataType, not the current size.

The number of elements shall be equal to the value of the valueRank. Shall be null if valueRank ≦ 0.

A value of 0 for an individual dimension indicates that the dimension has a variable length.

OpcUa_Int32 UaArgument::getValueRank ( ) const

Indicates whether the DataType is an array and how many dimensions the array has.

It may have the following values:

n > 1
The DataType is an array with the specified number of dimensions.
OneDimension (1)
The DataType is an array with one dimension.
OneOrMoreDimensions (0)
The dataType is an array with one or more dimensions.
Scalar (−1)
The DataType is not an array.
Any (−2)
The DataType can be a scalar or an array with any number of dimensions.
ScalarOrOneDimension (−3)
The DataType can be a scalar or a one dimensional array.
Note
All DataTypes are considered to be scalar, even if they have array-like semantics like ByteString and String.
bool UaArgument::operator!= ( const UaArgument other) const

Compare two UaArgument for inequality.

See also
operator==
Parameters
otherthe UaArgument to compare with.
Returns
true if not equal, false otherwise.
UaArgument & UaArgument::operator= ( const UaArgument other)

Assignment operator.

Parameters
otherthe UaArgument to assign.
Returns
reference to itself.
bool UaArgument::operator== ( const UaArgument other) const

Compare two UaArgument for equality.

Parameters
otherthe UaArgument to compare with.
Returns
true if equal, false if not.
void UaArgument::setArrayDimensions ( const UaUInt32Array arrayDimensions)

Specifies the length of each dimension for an array dataType.

It is intended to describe the capability of the DataType, not the current size.

The number of elements shall be equal to the value of the valueRank. Shall be null if valueRank ≦ 0.

A value of 0 for an individual dimension indicates that the dimension has a variable length.

void UaArgument::setValueRank ( OpcUa_Int32  valueRank)

Indicates whether the DataType is an array and how many dimensions the array has.

It may have the following values:

n > 1
The DataType is an array with the specified number of dimensions.
OneDimension (1)
The DataType is an array with one dimension.
OneOrMoreDimensions (0)
The dataType is an array with one or more dimensions.
Scalar (−1)
The DataType is not an array.
Any (−2)
The DataType can be a scalar or an array with any number of dimensions.
ScalarOrOneDimension (−3)
The DataType can be a scalar or a one dimensional array.
Note
All DataTypes are considered to be scalar, even if they have array-like semantics like ByteString and String.

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