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

Array class for the UA stack structure OpcUa_Variant. More...

#include <uaarraytemplates.h>

Public Member Functions

 UaVariantArray ()
 Constructs an empty instance of the class UaVariantArray.
 
 UaVariantArray (const UaVariantArray &other)
 Constructs an instance of the class VariantArray with values from another VariantArray object. More...
 
 UaVariantArray (OpcUa_Int32 length, OpcUa_Variant *data)
 Constructs an instance of the class UaVariant using a raw OpcUa_Variant array. More...
 
virtual ~UaVariantArray ()
 Destroys the UaVariantArray object.
 
UaVariantArrayoperator= (const UaVariantArray &other)
 Assignment operator. More...
 
const OpcUa_Variantoperator[] (OpcUa_UInt32 index) const
 Index operator. More...
 
OpcUa_Variantoperator[] (OpcUa_UInt32 index)
 Index operator. More...
 
bool operator== (const UaVariantArray &other) const
 Compare two UaVariantArray. More...
 
bool operator!= (const UaVariantArray &other) const
 Compare two UaVariantArray. More...
 
void attach (OpcUa_UInt32 length, OpcUa_Variant *data)
 Attach to a raw OpcUa_Variant array. More...
 
void attach (OpcUa_Int32 length, OpcUa_Variant *data)
 Attach to a raw OpcUa_Variant array. More...
 
OpcUa_Variantdetach ()
 Detach from the internal OpcUa_Variant array. More...
 
void create (OpcUa_UInt32 length)
 Clears the array and resizes to the given length. More...
 
void resize (OpcUa_UInt32 length)
 Resizes the array to a given length. More...
 
void clear ()
 Clears the array.
 

Detailed Description

Array class for the UA stack structure OpcUa_Variant.

This class encapsulates an array of the native OpcUa_Variant structure and handles memory allocation and cleanup for you.

See also
UaVariant for information about the encapsulated structure.

Constructor & Destructor Documentation

UaVariantArray::UaVariantArray ( const UaVariantArray other)

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

Parameters
otherthe other VariantArray used to initialize the object
UaVariantArray::UaVariantArray ( OpcUa_Int32  length,
OpcUa_Variant data 
)

Constructs an instance of the class UaVariant using a raw OpcUa_Variant array.

Parameters
lengththe length of the raw OpcUa_Variant array
datathe raw OpcUa_Variant array

Member Function Documentation

void UaVariantArray::attach ( OpcUa_UInt32  length,
OpcUa_Variant data 
)

Attach to a raw OpcUa_Variant array.

Note
Don't manually free the attached data afterwards, because UaVariantArray is responsible for it now.
Parameters
lengththe length of the raw OpcUa_Variant array
datathe raw OpcUa_Variant array
void UaVariantArray::attach ( OpcUa_Int32  length,
OpcUa_Variant data 
)

Attach to a raw OpcUa_Variant array.

Note
Don't manually free the attached data afterwards, because UaVariantArray is responsible for it now.
Parameters
lengththe length of the raw OpcUa_Variant array
datathe raw OpcUa_Variant array
void UaVariantArray::create ( OpcUa_UInt32  length)

Clears the array and resizes to the given length.

Parameters
lengththe new length of the array
OpcUa_Variant * UaVariantArray::detach ( )

Detach from the internal OpcUa_Variant array.

After detaching, the detached array data will not be cleared automatically anymore.

Note
Remember to retrieve the length of the array before detaching.
Returns
the detached OpcUa_Variant array
bool UaVariantArray::operator!= ( const UaVariantArray other) const

Compare two UaVariantArray.

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

Assignment operator.

Parameters
otherthe UaVariantArray to assign.
bool UaVariantArray::operator== ( const UaVariantArray other) const

Compare two UaVariantArray.

Parameters
otherthe UaVariantArray to compare with.
Returns
true if equal, false if not.
const OpcUa_Variant & UaVariantArray::operator[] ( OpcUa_UInt32  index) const

Index operator.

Parameters
indexthe index of the structure to return.
OpcUa_Variant & UaVariantArray::operator[] ( OpcUa_UInt32  index)

Index operator.

Parameters
indexthe index of the structure to return.
void UaVariantArray::resize ( OpcUa_UInt32  length)

Resizes the array to a given length.

Parameters
lengththe new length of the array

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