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

Wrapper class for the UA stack structure OpcUa_Annotation. More...

#include <uaannotation.h>

Public Member Functions

 UaAnnotation ()
 Constructs an instance of the class UaAnnotation with empty default values.
 
 UaAnnotation (const UaAnnotation &other)
 Constructs an instance of the class UaAnnotation with values from another UaAnnotation object. More...
 
 UaAnnotation (const OpcUa_Annotation &other)
 Constructs an instance of the class UaAnnotation with values from another OpcUa_Annotation structure. More...
 
 UaAnnotation (const UaString &message, const UaString &userName, const UaDateTime &annotationTime)
 Constructs an instance of the class UaAnnotation with values provided in the constructor.
 
 UaAnnotation (const UaExtensionObject &extensionObject)
 Constructs an instance of the class UaAnnotation initialized with value from a UaExtensionObject. More...
 
 UaAnnotation (const OpcUa_ExtensionObject &extensionObject)
 Constructs an instance of the class UaAnnotation initialized with value from an OpcUa_ExtensionObject structure. More...
 
 ~UaAnnotation ()
 Destroys the UaAnnotation object.
 
void clear ()
 Clear the data of the UaAnnotation. More...
 
bool operator== (const UaAnnotation &other) const
 Compare two UaAnnotation if they are similar. More...
 
bool operator!= (const UaAnnotation &other) const
 Returns true if the other UaAnnotation is not equal to this. More...
 
UaAnnotationoperator= (const UaAnnotation &other)
 Assignment operator. More...
 
OpcUa_Annotation * copy () const
 Copy UaAnnotation data to a newly allocated OpcUa_Annotation. More...
 
void copyTo (OpcUa_Annotation *pDst) const
 Copy UaAnnotation data to an existing OpcUa_Annotation structure. More...
 
void attach (OpcUa_Annotation *pValue)
 Attaches the data of the parameter pValue. More...
 
OpcUa_Annotation * detach (OpcUa_Annotation *pDst)
 Detaches the internal Annotation structure from this class. More...
 

Static Public Member Functions

static OpcUa_Annotation * clone (const OpcUa_Annotation &source)
 Copy OpcUa_Annotation data to a newly allocated OpcUa_Annotation. More...
 
static void cloneTo (const OpcUa_Annotation &source, OpcUa_Annotation &copy)
 Copy OpcUa_Annotation data to an existing OpcUa_Annotation structure. More...
 

Detailed Description

Wrapper class for the UA stack structure OpcUa_Annotation.

This class encapsulates the native OpcUa_Annotation structure and handles memory allocation and cleanup for you. UaAnnotation uses implicit sharing to avoid needless copying and to boost the performance. Only if you modify a shared Annotation it creates a copy for that (copy-on-write). So assigning another UaAnnotation or passing it as parameter needs constant time and is nearly as fast as assigning a pointer.

Constructor & Destructor Documentation

UaAnnotation::UaAnnotation ( const UaAnnotation other)

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

Parameters
otherthe other UaAnnotation used to initialize the object
UaAnnotation::UaAnnotation ( const OpcUa_Annotation &  other)

Constructs an instance of the class UaAnnotation with values from another OpcUa_Annotation structure.

Parameters
otherthe other OpcUa_Annotation used to initialize the object
UaAnnotation::UaAnnotation ( const UaExtensionObject extensionObject)

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

Parameters
extensionObjectthe extension object containing the Annotation
UaAnnotation::UaAnnotation ( const OpcUa_ExtensionObject &  extensionObject)

Constructs an instance of the class UaAnnotation initialized with value from an OpcUa_ExtensionObject structure.

Parameters
extensionObjectthe extension object containing the Annotation

Member Function Documentation

void UaAnnotation::attach ( OpcUa_Annotation *  pValue)

Attaches the data of the parameter pValue.

Don't clear the data of pValue afterwards manually, because UaAnnotation is responsible for it now.

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

Clear the data of the UaAnnotation.

OpcUa_Annotation * UaAnnotation::clone ( const OpcUa_Annotation &  source)
static

Copy OpcUa_Annotation data to a newly allocated OpcUa_Annotation.

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

Copy OpcUa_Annotation data to an existing OpcUa_Annotation structure.

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

Copy UaAnnotation data to a newly allocated OpcUa_Annotation.

Returns
data to a newly allocated OpcUa_Annotation.
void UaAnnotation::copyTo ( OpcUa_Annotation *  pDst) const

Copy UaAnnotation data to an existing OpcUa_Annotation structure.

Parameters
pDstthe destination of this copy operation.
OpcUa_Annotation * UaAnnotation::detach ( OpcUa_Annotation *  pDst)

Detaches the internal Annotation structure from this class.

This way you take over the control of releasing the Annotation 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_Annotation structure that receives the Annotation data.
bool UaAnnotation::operator!= ( const UaAnnotation other) const

Returns true if the other UaAnnotation is not equal to this.

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

Assignment operator.

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

Compare two UaAnnotation if they are similar.

Parameters
otherthe UaAnnotation to compare.
Returns
true if similar, false if not.

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