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

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

#include <uaarraytemplates.h>

Public Member Functions

 UaStringArray ()
 Constructs an empty instance of the class UaStringArray.
 
 UaStringArray (const UaStringArray &other)
 Constructs an instance of the class StringArray with values from another StringArray object. More...
 
 UaStringArray (OpcUa_Int32 length, OpcUa_String *data)
 Constructs an instance of the class UaString using a raw OpcUa_String array. More...
 
virtual ~UaStringArray ()
 Destroys the UaStringArray object.
 
UaStringArrayoperator= (const UaStringArray &other)
 Assignment operator. More...
 
const OpcUa_Stringoperator[] (OpcUa_UInt32 index) const
 Index operator. More...
 
OpcUa_Stringoperator[] (OpcUa_UInt32 index)
 Index operator. More...
 
bool operator== (const UaStringArray &other) const
 Compare two UaStringArray. More...
 
bool operator!= (const UaStringArray &other) const
 Compare two UaStringArray. More...
 
void attach (OpcUa_UInt32 length, OpcUa_String *data)
 Attach to a raw OpcUa_String array. More...
 
void attach (OpcUa_Int32 length, OpcUa_String *data)
 Attach to a raw OpcUa_String array. More...
 
OpcUa_Stringdetach ()
 Detach from the internal OpcUa_String 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_String.

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

See also
UaString for information about the encapsulated structure.

Constructor & Destructor Documentation

UaStringArray::UaStringArray ( const UaStringArray other)

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

Parameters
otherthe other StringArray used to initialize the object
UaStringArray::UaStringArray ( OpcUa_Int32  length,
OpcUa_String data 
)

Constructs an instance of the class UaString using a raw OpcUa_String array.

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

Member Function Documentation

void UaStringArray::attach ( OpcUa_UInt32  length,
OpcUa_String data 
)

Attach to a raw OpcUa_String array.

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

Attach to a raw OpcUa_String array.

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

Clears the array and resizes to the given length.

Parameters
lengththe new length of the array
OpcUa_String * UaStringArray::detach ( )

Detach from the internal OpcUa_String 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_String array
bool UaStringArray::operator!= ( const UaStringArray other) const

Compare two UaStringArray.

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

Assignment operator.

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

Compare two UaStringArray.

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

Index operator.

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

Index operator.

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