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

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...
 
UaEUInformationoperator= (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)
 Copy OpcUa_EUInformation data to an existing OpcUa_EUInformation structure. More...
 
static UaEUInformation fromUnitId (EngineeringUnit unitId)
 Returns the EngineeringUnit with the UnitId unitId. More...
 

Detailed Description

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

Constructor & Destructor Documentation

UaEUInformation::UaEUInformation ( const UaEUInformation other)

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

Parameters
otherthe 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.

Parameters
otherthe 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.

Parameters
namespaceUrithe namespace used for the unitId
unitIdthe unitId for the unit
displayNamethe display name for the unit
descriptionthe description for the unit
UaEUInformation::UaEUInformation ( const UaExtensionObject extensionObject)

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

Parameters
extensionObjectthe 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.

Parameters
extensionObjectthe extension object containing the EUInformation
UaEUInformation::UaEUInformation ( UaEUInformation::EngineeringUnit  unitId)

Constructs an instance of the class UaEUInformation initialized with a unitId.

Parameters
unitIdThe unitId which defines the settings to initialize the UaEUInformation with values from the namespace http://www.opcfoundation.org/UA/units/un/cefact

Member Function Documentation

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.

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

Clear the data of the UaEUInformation.

OpcUa_EUInformation * UaEUInformation::clone ( const OpcUa_EUInformation &  source)
static

Copy OpcUa_EUInformation data to a newly allocated OpcUa_EUInformation.

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

Copy OpcUa_EUInformation data to an existing OpcUa_EUInformation structure.

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

Copy UaEUInformation data to a newly allocated OpcUa_EUInformation.

Returns
data to a newly allocated OpcUa_EUInformation.
void UaEUInformation::copyTo ( OpcUa_EUInformation *  pDst) const

Copy UaEUInformation data to an existing OpcUa_EUInformation structure.

Parameters
pDstthe 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.

Returns
If the function succeeds, pDst is returned, otherwise 0 is returned.
Parameters
[out]pDstPointer to OpcUa_EUInformation structure that receives the EUInformation data.
UaEUInformation UaEUInformation::fromUnitId ( UaEUInformation::EngineeringUnit  unitId)
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.

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

Assignment operator.

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

Compare two UaEUInformation if they are similar.

Parameters
otherthe UaEUInformation to compare.
Returns
true if similar, false if not.
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.


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