C++ Based OPC UA Client/Server/PubSub SDK
1.7.8.584
|
Wrapper class for the UA stack structure OpcUa_KeyValuePair. More...
#include <uakeyvaluepair.h>
Public Member Functions | |
UaKeyValuePair () | |
Constructs an instance of the class UaKeyValuePair with empty default values. | |
UaKeyValuePair (const UaKeyValuePair &other) | |
Constructs an instance of the class UaKeyValuePair with values from another UaKeyValuePair object. More... | |
UaKeyValuePair (const OpcUa_KeyValuePair &other) | |
Constructs an instance of the class UaKeyValuePair with values from another OpcUa_KeyValuePair structure. More... | |
UaKeyValuePair (const UaQualifiedName &key, const UaVariant &value) | |
Constructs an instance of the class UaKeyValuePair with values provided in the constructor. | |
UaKeyValuePair (const UaExtensionObject &extensionObject) | |
Constructs an instance of the class UaKeyValuePair initialized with value from a UaExtensionObject. More... | |
UaKeyValuePair (const OpcUa_ExtensionObject &extensionObject) | |
Constructs an instance of the class UaKeyValuePair initialized with value from an OpcUa_ExtensionObject structure. More... | |
~UaKeyValuePair () | |
Destroys the UaKeyValuePair object. | |
void | clear () |
Clear the data of the UaKeyValuePair. More... | |
bool | operator== (const UaKeyValuePair &other) const |
Compare two UaKeyValuePair for equality. More... | |
bool | operator!= (const UaKeyValuePair &other) const |
Compare two UaKeyValuePair for inequality. More... | |
UaKeyValuePair & | operator= (const UaKeyValuePair &other) |
Assignment operator. More... | |
OpcUa_KeyValuePair * | copy () const |
Copy UaKeyValuePair data to a newly allocated OpcUa_KeyValuePair. More... | |
void | copyTo (OpcUa_KeyValuePair *pDst) const |
Copy UaKeyValuePair data to an existing OpcUa_KeyValuePair structure. More... | |
void | attach (OpcUa_KeyValuePair *pValue) |
Attaches to an existing OpcUa_KeyValuePair structure. More... | |
OpcUa_KeyValuePair * | detach (OpcUa_KeyValuePair *pDst) |
Detaches the internal KeyValuePair structure from this class. More... | |
UaQualifiedName | getKey () const |
Returns the Key. | |
UaVariant | getValue () const |
Returns the Value. | |
void | setKey (const UaQualifiedName &key) |
Sets the Key. | |
void | setValue (const UaVariant &value) |
Sets the Value. | |
Static Public Member Functions | |
static OpcUa_KeyValuePair * | clone (const OpcUa_KeyValuePair &source) |
Copy OpcUa_KeyValuePair data to a newly allocated OpcUa_KeyValuePair. More... | |
static void | cloneTo (const OpcUa_KeyValuePair &source, OpcUa_KeyValuePair ©) |
Copy OpcUa_KeyValuePair data to an existing OpcUa_KeyValuePair structure. More... | |
Wrapper class for the UA stack structure OpcUa_KeyValuePair.
This class encapsulates the native OpcUa_KeyValuePair structure and handles memory allocation and cleanup for you. UaKeyValuePair uses implicit sharing to avoid needless copying and to boost the performance. Only if you modify a shared KeyValuePair it creates a copy for that (copy-on-write). So assigning another UaKeyValuePair or passing it as parameter needs constant time and is nearly as fast as assigning a pointer.
UaKeyValuePair::UaKeyValuePair | ( | const UaKeyValuePair & | other | ) |
Constructs an instance of the class UaKeyValuePair with values from another UaKeyValuePair object.
other | the other UaKeyValuePair used to initialize the object |
UaKeyValuePair::UaKeyValuePair | ( | const OpcUa_KeyValuePair & | other | ) |
Constructs an instance of the class UaKeyValuePair with values from another OpcUa_KeyValuePair structure.
other | the other OpcUa_KeyValuePair used to initialize the object |
UaKeyValuePair::UaKeyValuePair | ( | const UaExtensionObject & | extensionObject | ) |
Constructs an instance of the class UaKeyValuePair initialized with value from a UaExtensionObject.
extensionObject | the extension object containing the KeyValuePair |
UaKeyValuePair::UaKeyValuePair | ( | const OpcUa_ExtensionObject & | extensionObject | ) |
Constructs an instance of the class UaKeyValuePair initialized with value from an OpcUa_ExtensionObject structure.
extensionObject | the extension object containing the KeyValuePair |
void UaKeyValuePair::attach | ( | OpcUa_KeyValuePair * | pValue | ) |
Attaches to an existing OpcUa_KeyValuePair structure.
Don't manually free the attached structure afterwards, because UaKeyValuePair is responsible for it now.
pValue | [in] Parameter to attach to. |
void UaKeyValuePair::clear | ( | ) |
Clear the data of the UaKeyValuePair.
|
static |
Copy OpcUa_KeyValuePair data to a newly allocated OpcUa_KeyValuePair.
source | Source to clone. |
|
static |
Copy OpcUa_KeyValuePair data to an existing OpcUa_KeyValuePair structure.
source | the source of the clone operation. |
copy | the destination of the clone operation. |
OpcUa_KeyValuePair * UaKeyValuePair::copy | ( | ) | const |
Copy UaKeyValuePair data to a newly allocated OpcUa_KeyValuePair.
void UaKeyValuePair::copyTo | ( | OpcUa_KeyValuePair * | pDst | ) | const |
Copy UaKeyValuePair data to an existing OpcUa_KeyValuePair structure.
pDst | the destination of this copy operation. |
OpcUa_KeyValuePair * UaKeyValuePair::detach | ( | OpcUa_KeyValuePair * | pDst | ) |
Detaches the internal KeyValuePair structure from this class.
This way you take over the control of freeing the KeyValuePair data. If more than one reference exists, the data is copied to pDst instead of being detached.
pDst | [out] Pointer to an OpcUa_KeyValuePair structure that receives the KeyValuePair data. |
bool UaKeyValuePair::operator!= | ( | const UaKeyValuePair & | other | ) | const |
Compare two UaKeyValuePair for inequality.
other | the UaKeyValuePair to compare with. |
UaKeyValuePair & UaKeyValuePair::operator= | ( | const UaKeyValuePair & | other | ) |
bool UaKeyValuePair::operator== | ( | const UaKeyValuePair & | other | ) | const |
Compare two UaKeyValuePair for equality.
other | the UaKeyValuePair to compare with. |