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

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

#include <uaarraytemplates.h>

Public Member Functions

 UaByteStringArray ()
 Constructs an empty instance of the class UaByteStringArray.
 
 UaByteStringArray (const UaByteStringArray &other)
 Constructs an instance of the class ByteStringArray with values from another ByteStringArray object. More...
 
 UaByteStringArray (OpcUa_Int32 length, OpcUa_ByteString *data)
 Constructs an instance of the class UaByteString using a raw OpcUa_ByteString array. More...
 
virtual ~UaByteStringArray ()
 Destroys the UaByteStringArray object.
 
UaByteStringArrayoperator= (const UaByteStringArray &other)
 Assignment operator. More...
 
const OpcUa_ByteStringoperator[] (OpcUa_UInt32 index) const
 Index operator. More...
 
OpcUa_ByteStringoperator[] (OpcUa_UInt32 index)
 Index operator. More...
 
bool operator== (const UaByteStringArray &other) const
 Compare two UaByteStringArray. More...
 
bool operator!= (const UaByteStringArray &other) const
 Compare two UaByteStringArray. More...
 
void attach (OpcUa_UInt32 length, OpcUa_ByteString *data)
 Attach to a raw OpcUa_ByteString array. More...
 
void attach (OpcUa_Int32 length, OpcUa_ByteString *data)
 Attach to a raw OpcUa_ByteString array. More...
 
OpcUa_ByteStringdetach ()
 Detach from the internal OpcUa_ByteString 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_ByteString.

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

See also
UaByteString for information about the encapsulated structure.

Constructor & Destructor Documentation

UaByteStringArray::UaByteStringArray ( const UaByteStringArray other)

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

Parameters
otherthe other ByteStringArray used to initialize the object
UaByteStringArray::UaByteStringArray ( OpcUa_Int32  length,
OpcUa_ByteString data 
)

Constructs an instance of the class UaByteString using a raw OpcUa_ByteString array.

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

Member Function Documentation

void UaByteStringArray::attach ( OpcUa_UInt32  length,
OpcUa_ByteString data 
)

Attach to a raw OpcUa_ByteString array.

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

Attach to a raw OpcUa_ByteString array.

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

Clears the array and resizes to the given length.

Parameters
lengththe new length of the array
OpcUa_ByteString * UaByteStringArray::detach ( )

Detach from the internal OpcUa_ByteString 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_ByteString array
bool UaByteStringArray::operator!= ( const UaByteStringArray other) const

Compare two UaByteStringArray.

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

Assignment operator.

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

Compare two UaByteStringArray.

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

Index operator.

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

Index operator.

Parameters
indexthe index of the structure to return.
void UaByteStringArray::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: