UA Server SDK C++ Bundle  1.4.1.271
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
UaArgument Class Reference

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 if they are similar. More...
 
bool operator!= (const UaArgument &other) const
 Returns true if the other UaArgument is not equal to this. More...
 
UaArgumentoperator= (const UaArgument &other)
 Assignment operator. More...
 
OpcUa_Argument * copy () 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 the data of the parameter pValue. More...
 
OpcUa_Argument * detach (OpcUa_Argument *pDst)
 Detaches the internal Argument structure from this class. More...
 

Static Public Member Functions

static OpcUa_Argument * clone (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.

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 the data of the parameter pValue.

Don't clear the data of pValue afterwards manually, because UaArgument is responsible for it now.

Parameters
[in]pValueParameter 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
new copy.
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
data 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 releasing the Argument data. If more than one reference exists, the data is copied to pDst instead of being detached.

Returns
If the function succeeds, pDst is returned, otherwise 0 is returned.
Parameters
[out]pDstPointer to OpcUa_Argument structure that receives the Argument data.
bool UaArgument::operator!= ( const UaArgument other) const

Returns true if the other UaArgument is not equal to this.

See Also
operator==
Parameters
otherthe UaArgument to compare.
Returns
true if other is not equal to this.
UaArgument & UaArgument::operator= ( const UaArgument other)

Assignment operator.

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

Compare two UaArgument if they are similar.

Parameters
otherthe UaArgument to compare.
Returns
true if similar, false if not.

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