C++ UA Server SDK  1.5.0.318
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages

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 for equality. More...
 
bool operator!= (const UaRange &other) const
 Compare two UaRange for inequality. More...
 
UaRangeoperator= (const UaRange &other)
 Assignment operator. More...
 
OpcUa_Rangecopy () 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 to an existing OpcUa_Range structure. More...
 
OpcUa_Rangedetach (OpcUa_Range *pDst)
 Detaches the internal Range structure from this class. More...
 
OpcUa_Double getLow () const
 Lowest value in the range.
 
OpcUa_Double getHigh () const
 Highest value in the range.
 
void setLow (OpcUa_Double low)
 Lowest value in the range.
 
void setHigh (OpcUa_Double high)
 Highest value in the range.
 

Static Public Member Functions

static OpcUa_Rangeclone (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.

Defines the Range for a value.

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 to an existing OpcUa_Range structure.

Don't manually free the attached structure afterwards, because UaRange is responsible for it now.

Parameters
pValue[in] Parameter 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
pointer to a newly allocated OpcUa_Range.
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
pointer 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 freeing the Range data. If more than one reference exists, the data is copied to pDst instead of being detached.

Parameters
pDst[out] Pointer to an OpcUa_Range structure that receives the Range data.
Returns
If the function succeeds, pDst is returned, otherwise 0 is returned.
bool UaRange::operator!= ( const UaRange other) const

Compare two UaRange for inequality.

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

Assignment operator.

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

Compare two UaRange for equality.

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

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