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

Wrapper class for the UA stack structure OpcUa_Range. More...

#include <uarange.h>

Public Member Functions

 UaRange ()
 Constructs an instance of the class UaRange with empty default values.
 
 UaRange (const UaRange &other)
 Constructs an instance of the class UaRange with values from another UaRange object. More...
 
 UaRange (const OpcUa_Range &other)
 Constructs an instance of the class UaRange with values from another OpcUa_Range structure. More...
 
 UaRange (OpcUa_Double low, OpcUa_Double high)
 Constructs an instance of the class UaRange with values provided in the constructor.
 
 UaRange (const UaExtensionObject &extensionObject)
 Constructs an instance of the class UaRange initialized with value from a UaExtensionObject. More...
 
 UaRange (const OpcUa_ExtensionObject &extensionObject)
 Constructs an instance of the class UaRange initialized with value from an OpcUa_ExtensionObject structure. More...
 
 ~UaRange ()
 Destroys the UaRange object.
 
void clear ()
 Clear the data of the UaRange. More...
 
bool operator== (const UaRange &other) const
 Compare two UaRange if they are similar. More...
 
bool operator!= (const UaRange &other) const
 Returns true if the other UaRange is not equal to this. More...
 
UaRangeoperator= (const UaRange &other)
 Assignment operator. More...
 
OpcUa_Range * copy () const
 Copy UaRange data to a newly allocated OpcUa_Range. More...
 
void copyTo (OpcUa_Range *pDst) const
 Copy UaRange data to an existing OpcUa_Range structure. More...
 
void attach (OpcUa_Range *pValue)
 Attaches the data of the parameter pValue. More...
 
OpcUa_Range * detach (OpcUa_Range *pDst)
 Detaches the internal Range structure from this class. More...
 

Static Public Member Functions

static OpcUa_Range * clone (const OpcUa_Range &source)
 Copy OpcUa_Range data to a newly allocated OpcUa_Range. More...
 
static void cloneTo (const OpcUa_Range &source, OpcUa_Range &copy)
 Copy OpcUa_Range data to an existing OpcUa_Range structure. More...
 

Detailed Description

Wrapper class for the UA stack structure OpcUa_Range.

This class encapsulates the native OpcUa_Range structure and handles memory allocation and cleanup for you. UaRange uses implicit sharing to avoid needless copying and to boost the performance. Only if you modify a shared Range it creates a copy for that (copy-on-write). So assigning another UaRange or passing it as parameter needs constant time and is nearly as fast as assigning a pointer.

Constructor & Destructor Documentation

UaRange::UaRange ( const UaRange other)

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

Parameters
otherthe other UaRange used to initialize the object
UaRange::UaRange ( const OpcUa_Range &  other)

Constructs an instance of the class UaRange with values from another OpcUa_Range structure.

Parameters
otherthe other OpcUa_Range used to initialize the object
UaRange::UaRange ( const UaExtensionObject extensionObject)

Constructs an instance of the class UaRange initialized with value from a UaExtensionObject.

Parameters
extensionObjectthe extension object containing the Range
UaRange::UaRange ( const OpcUa_ExtensionObject &  extensionObject)

Constructs an instance of the class UaRange initialized with value from an OpcUa_ExtensionObject structure.

Parameters
extensionObjectthe extension object containing the Range

Member Function Documentation

void UaRange::attach ( OpcUa_Range *  pValue)

Attaches the data of the parameter pValue.

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

Parameters
[in]pValueParameter to attach to.
void UaRange::clear ( )

Clear the data of the UaRange.

OpcUa_Range * UaRange::clone ( const OpcUa_Range &  source)
static

Copy OpcUa_Range data to a newly allocated OpcUa_Range.

Parameters
sourceSource to clone.
Returns
new copy.
void UaRange::cloneTo ( const OpcUa_Range &  source,
OpcUa_Range &  copy 
)
static

Copy OpcUa_Range data to an existing OpcUa_Range structure.

Parameters
sourcethe source of the clone operation.
copythe destination of the clone operation.
OpcUa_Range * UaRange::copy ( ) const

Copy UaRange data to a newly allocated OpcUa_Range.

Returns
data to a newly allocated OpcUa_Range.
void UaRange::copyTo ( OpcUa_Range *  pDst) const

Copy UaRange data to an existing OpcUa_Range structure.

Parameters
pDstthe destination of this copy operation.
OpcUa_Range * UaRange::detach ( OpcUa_Range *  pDst)

Detaches the internal Range structure from this class.

This way you take over the control of releasing the Range 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_Range structure that receives the Range data.
bool UaRange::operator!= ( const UaRange other) const

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

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

Assignment operator.

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

Compare two UaRange if they are similar.

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

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