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

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

#include <uaarraytemplates.h>

Public Member Functions

 UaSByteArray ()
 Constructs an empty instance of the class UaSByteArray.
 
 UaSByteArray (const UaSByteArray &other)
 Constructs an instance of the class SByteArray with values from another SByteArray object. More...
 
 UaSByteArray (OpcUa_Int32 length, OpcUa_SByte *data)
 Constructs an instance of the class UaSByte using a raw OpcUa_SByte array. More...
 
virtual ~UaSByteArray ()
 Destroys the UaSByteArray object.
 
UaSByteArrayoperator= (const UaSByteArray &other)
 Assignment operator. More...
 
const OpcUa_SByte & operator[] (OpcUa_UInt32 index) const
 Index operator. More...
 
OpcUa_SByte & operator[] (OpcUa_UInt32 index)
 Index operator. More...
 
bool operator== (const UaSByteArray &other) const
 Compare two UaSByteArray. More...
 
bool operator!= (const UaSByteArray &other) const
 Compare two UaSByteArray. More...
 
void attach (OpcUa_UInt32 length, OpcUa_SByte *data)
 Attach to a raw OpcUa_SByte array. More...
 
void attach (OpcUa_Int32 length, OpcUa_SByte *data)
 Attach to a raw OpcUa_SByte array. More...
 
OpcUa_SByte * detach ()
 Detach from the internal OpcUa_SByte 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_SByte.

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

Constructor & Destructor Documentation

UaSByteArray::UaSByteArray ( const UaSByteArray other)

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

Parameters
otherthe other SByteArray used to initialize the object
UaSByteArray::UaSByteArray ( OpcUa_Int32  length,
OpcUa_SByte *  data 
)

Constructs an instance of the class UaSByte using a raw OpcUa_SByte array.

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

Member Function Documentation

void UaSByteArray::attach ( OpcUa_UInt32  length,
OpcUa_SByte *  data 
)

Attach to a raw OpcUa_SByte array.

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

Attach to a raw OpcUa_SByte array.

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

Clears the array and resizes to the given length.

Parameters
lengththe new length of the array
OpcUa_SByte * UaSByteArray::detach ( )

Detach from the internal OpcUa_SByte 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_SByte array
bool UaSByteArray::operator!= ( const UaSByteArray other) const

Compare two UaSByteArray.

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

Assignment operator.

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

Compare two UaSByteArray.

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

Index operator.

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

Index operator.

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