UA Server SDK C++ Bundle
1.4.1.271
|
Wrapper class for the UA stack structure OpcUa_EUInformation. More...
#include <uaeuinformation.h>
Public Member Functions | |
UaEUInformation () | |
Constructs an instance of the class UaEUInformation with empty default values. | |
UaEUInformation (const UaEUInformation &other) | |
Constructs an instance of the class UaEUInformation with values from another UaEUInformation object. More... | |
UaEUInformation (const OpcUa_EUInformation &other) | |
Constructs an instance of the class UaEUInformation with values from another OpcUa_EUInformation structure. More... | |
UaEUInformation (const UaString &namespaceUri, OpcUa_Int32 unitId, const UaLocalizedText &displayName, const UaLocalizedText &description) | |
Constructs an instance of the class UaEUInformation with values provided in the constructor. More... | |
UaEUInformation (const UaExtensionObject &extensionObject) | |
Constructs an instance of the class UaEUInformation initialized with value from a UaExtensionObject. More... | |
UaEUInformation (const OpcUa_ExtensionObject &extensionObject) | |
Constructs an instance of the class UaEUInformation initialized with value from an OpcUa_ExtensionObject structure. More... | |
UaEUInformation (EngineeringUnit unitId) | |
Constructs an instance of the class UaEUInformation initialized with a unitId. More... | |
~UaEUInformation () | |
Destroys the UaEUInformation object. | |
void | clear () |
Clear the data of the UaEUInformation. More... | |
bool | operator== (const UaEUInformation &other) const |
Compare two UaEUInformation if they are similar. More... | |
bool | operator!= (const UaEUInformation &other) const |
Returns true if the other UaEUInformation is not equal to this. More... | |
UaEUInformation & | operator= (const UaEUInformation &other) |
Assignment operator. More... | |
OpcUa_EUInformation * | copy () const |
Copy UaEUInformation data to a newly allocated OpcUa_EUInformation. More... | |
void | copyTo (OpcUa_EUInformation *pDst) const |
Copy UaEUInformation data to an existing OpcUa_EUInformation structure. More... | |
void | attach (OpcUa_EUInformation *pValue) |
Attaches the data of the parameter pValue. More... | |
OpcUa_EUInformation * | detach (OpcUa_EUInformation *pDst) |
Detaches the internal EUInformation structure from this class. More... | |
void | setEUInformation (EngineeringUnit unitId) |
Sets all information related to the unitId. More... | |
Static Public Member Functions | |
static OpcUa_EUInformation * | clone (const OpcUa_EUInformation &source) |
Copy OpcUa_EUInformation data to a newly allocated OpcUa_EUInformation. More... | |
static void | cloneTo (const OpcUa_EUInformation &source, OpcUa_EUInformation ©) |
Copy OpcUa_EUInformation data to an existing OpcUa_EUInformation structure. More... | |
static UaEUInformation | fromUnitId (EngineeringUnit unitId) |
Returns the EngineeringUnit with the UnitId unitId. More... | |
Wrapper class for the UA stack structure OpcUa_EUInformation.
This class encapsulates the native OpcUa_EUInformation structure and handles memory allocation and cleanup for you. UaEUInformation uses implicit sharing to avoid needless copying and to boost the performance. Only if you modify a shared EUInformation it creates a copy for that (copy-on-write). So assigning another UaEUInformation or passing it as parameter needs constant time and is nearly as fast as assigning a pointer.
Understanding the units of a measurement value is essential for a uniform system. In an open system in particular where servers from different cultures might be used, it is essential to know what the units of measurement are. Based on such knowledge, values can be converted if necessary before being used. Therefore, although defined as optional, support of the EngineeringUnits Property is strongly advised.
To facilitate interoperability, OPC UA specifies how to apply the widely accepted "Codes for Units of Measurement (Recommendation No. 20)" published by the "United Nations Centre for Trade Facilitation and Electronic Business" (see UN/CEFACT). It uses and is based on the International System of Units (SI Units) but in addition provides a fixed code that can be used for automated evaluation. This recommendation has been accepted by many industries on a global basis.
The EUInformation consists of a UnitId, a display name and description of the unit and a namespace URI for the UnitId. The class UaEUInformation provides helper functions to create the EUInformation from a unitId provided as enumeration. The namespace for this list is http://www.opcfoundation.org/UA/units/un/cefact
UaEUInformation::UaEUInformation | ( | const UaEUInformation & | other | ) |
Constructs an instance of the class UaEUInformation with values from another UaEUInformation object.
other | the other UaEUInformation used to initialize the object |
UaEUInformation::UaEUInformation | ( | const OpcUa_EUInformation & | other | ) |
Constructs an instance of the class UaEUInformation with values from another OpcUa_EUInformation structure.
other | the other OpcUa_EUInformation used to initialize the object |
UaEUInformation::UaEUInformation | ( | const UaString & | namespaceUri, |
OpcUa_Int32 | unitId, | ||
const UaLocalizedText & | displayName, | ||
const UaLocalizedText & | description | ||
) |
Constructs an instance of the class UaEUInformation with values provided in the constructor.
namespaceUri | the namespace used for the unitId |
unitId | the unitId for the unit |
displayName | the display name for the unit |
description | the description for the unit |
UaEUInformation::UaEUInformation | ( | const UaExtensionObject & | extensionObject | ) |
Constructs an instance of the class UaEUInformation initialized with value from a UaExtensionObject.
extensionObject | the extension object containing the EUInformation |
UaEUInformation::UaEUInformation | ( | const OpcUa_ExtensionObject & | extensionObject | ) |
Constructs an instance of the class UaEUInformation initialized with value from an OpcUa_ExtensionObject structure.
extensionObject | the extension object containing the EUInformation |
UaEUInformation::UaEUInformation | ( | UaEUInformation::EngineeringUnit | unitId | ) |
Constructs an instance of the class UaEUInformation initialized with a unitId.
unitId | The unitId which defines the settings to initialize the UaEUInformation with values from the namespace http://www.opcfoundation.org/UA/units/un/cefact |
void UaEUInformation::attach | ( | OpcUa_EUInformation * | pValue | ) |
Attaches the data of the parameter pValue.
Don't clear the data of pValue afterwards manually, because UaEUInformation is responsible for it now.
[in] | pValue | Parameter to attach to. |
void UaEUInformation::clear | ( | ) |
Clear the data of the UaEUInformation.
|
static |
Copy OpcUa_EUInformation data to a newly allocated OpcUa_EUInformation.
source | Source to clone. |
|
static |
Copy OpcUa_EUInformation data to an existing OpcUa_EUInformation structure.
source | the source of the clone operation. |
copy | the destination of the clone operation. |
OpcUa_EUInformation * UaEUInformation::copy | ( | ) | const |
Copy UaEUInformation data to a newly allocated OpcUa_EUInformation.
void UaEUInformation::copyTo | ( | OpcUa_EUInformation * | pDst | ) | const |
Copy UaEUInformation data to an existing OpcUa_EUInformation structure.
pDst | the destination of this copy operation. |
OpcUa_EUInformation * UaEUInformation::detach | ( | OpcUa_EUInformation * | pDst | ) |
Detaches the internal EUInformation structure from this class.
This way you take over the control of releasing the EUInformation data. If more than one reference exists, the data is copied to pDst instead of being detached.
[out] | pDst | Pointer to OpcUa_EUInformation structure that receives the EUInformation data. |
|
static |
Returns the EngineeringUnit with the UnitId unitId.
The EngineeringUnits are based on the widely accepted "Codes for Units of Measurement (Recommendation No. 20)" published by the "United Nations Centre for Trade Facilitation and Electronic Business" (see UN/CEFACT). It uses and is based on the International System of Units (SI Units) but in addition provides a fixed code that can be used for automated evaluation. This recommendation has been accepted by many industries on a global basis.
bool UaEUInformation::operator!= | ( | const UaEUInformation & | other | ) | const |
Returns true if the other UaEUInformation is not equal to this.
other | the UaEUInformation to compare. |
UaEUInformation & UaEUInformation::operator= | ( | const UaEUInformation & | other | ) |
bool UaEUInformation::operator== | ( | const UaEUInformation & | other | ) | const |
Compare two UaEUInformation if they are similar.
other | the UaEUInformation to compare. |
void UaEUInformation::setEUInformation | ( | UaEUInformation::EngineeringUnit | unitId | ) |
Sets all information related to the unitId.
The EngineeringUnits are based on the widely accepted "Codes for Units of Measurement (Recommendation No. 20)" published by the "United Nations Centre for Trade Facilitation and Electronic Business" (see UN/CEFACT). It uses and is based on the International System of Units (SI Units) but in addition provides a fixed code that can be used for automated evaluation. This recommendation has been accepted by many industries on a global basis.