C++ Based OPC UA Client/Server SDK
1.6.5.478
|
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... | |
UaRange & | operator= (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 to an existing OpcUa_Range structure. More... | |
OpcUa_Range * | detach (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_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 OpcUa_Range data to an existing OpcUa_Range structure. More... | |
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.
UaRange::UaRange | ( | const UaRange & | other | ) |
UaRange::UaRange | ( | const OpcUa_Range & | other | ) |
Constructs an instance of the class UaRange with values from another OpcUa_Range structure.
other | the 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.
extensionObject | the 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.
extensionObject | the extension object containing the Range |
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.
pValue | [in] Parameter to attach to. |
void UaRange::clear | ( | ) |
Clear the data of the UaRange.
|
static |
Copy OpcUa_Range data to a newly allocated OpcUa_Range.
source | Source to clone. |
|
static |
Copy OpcUa_Range data to an existing OpcUa_Range structure.
source | the source of the clone operation. |
copy | the destination of the clone operation. |
OpcUa_Range * UaRange::copy | ( | ) | const |
Copy UaRange data to a newly allocated OpcUa_Range.
void UaRange::copyTo | ( | OpcUa_Range * | pDst | ) | const |
Copy UaRange data to an existing OpcUa_Range structure.
pDst | the 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.
pDst | [out] Pointer to an OpcUa_Range structure that receives the Range data. |
bool UaRange::operator!= | ( | const UaRange & | other | ) | const |
bool UaRange::operator== | ( | const UaRange & | other | ) | const |