#include <uadatavalue.h>

List of all members.

Public Member Functions

 UaDataValue ()
 UaDataValue (const UaDataValue &other)
 UaDataValue (const OpcUa_DataValue &other)
 UaDataValue (const UaVariant &value, OpcUa_StatusCode statusCode, const UaDateTime &sourceTimestamp, const UaDateTime &serverTimestamp)
 ~UaDataValue ()
void clear ()
UaDataValueoperator= (const UaDataValue &other)
bool operator== (const UaDataValue &other) const
 < [in] the UaDataValue to compare.
bool operator!= (const UaDataValue &other) const
 < [in] the UaDataValue to compare.
 operator const OpcUa_DataValue * () const
OpcUa_DataValue * copy () const
void copyTo (OpcUa_DataValue *pDst) const
 < [in] the destination of this operation.
void attach (const OpcUa_DataValue *pValue)
OpcUa_DataValue * detach (OpcUa_DataValue *pDst)
void setDataValue (UaVariant &value, OpcUa_Boolean detachValue, OpcUa_StatusCode statusCode, OpcUa_DateTime sourceTimestamp, OpcUa_DateTime serverTimestamp)
void setDataValue (OpcUa_Variant &value, OpcUa_Boolean detachValue, OpcUa_StatusCode statusCode, OpcUa_DateTime sourceTimestamp, OpcUa_DateTime serverTimestamp)
void setValue (UaVariant &value, OpcUa_Boolean detachValue, OpcUa_Boolean updateTimeStamps=OpcUa_False)
void setValue (OpcUa_Variant &value, OpcUa_Boolean detachValue, OpcUa_Boolean updateTimeStamps=OpcUa_False)
void setStatusCode (OpcUa_StatusCode statusCode)
void setSourceTimestamp (OpcUa_DateTime sourceTimestamp)
void setServerTimestamp (OpcUa_DateTime serverTimestamp)
void setSourcePicoseconds (OpcUa_UInt16 sourcePicoseconds)
void setServerPicoseconds (OpcUa_UInt16 serverPicoseconds)
const OpcUa_Variant * value () const
OpcUa_DateTime sourceTimestamp () const
OpcUa_DateTime serverTimestamp () const
OpcUa_UInt16 sourcePicoseconds () const
OpcUa_UInt16 serverPicoseconds () const
OpcUa_Boolean isSourceTimestampSet () const
OpcUa_Boolean isServerTimestampSet () const

Static Public Member Functions

static OpcUa_DataValue * clone (const OpcUa_DataValue &source)
static void cloneTo (const OpcUa_DataValue &source, OpcUa_DataValue &copy)
static bool compare (const OpcUa_DataValue &, const OpcUa_DataValue &, OpcUa_Boolean bCompareTimestamps)

Detailed Description

Wrapper classs for the ua stack structure OpcUa_DataValue.

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


Constructor & Destructor Documentation

UaDataValue::UaDataValue (  )

construction

UaDataValue::UaDataValue ( const UaDataValue other )

construction

Parameters:
[in]otherthe OpcUa_DataValue
* UaDataValue::UaDataValue ( const OpcUa_DataValue &  other )
Parameters:
[in]otherthe OpcUa_DataValue
UaDataValue::UaDataValue ( const UaVariant value,
OpcUa_StatusCode  statusCode,
const UaDateTime sourceTimestamp,
const UaDateTime serverTimestamp 
)

construction

Parameters:
[in]valuethe value of a UaVariant.
[in]statusCodethe OPC UA Status code.
[in]sourceTimestampthe source timestamp.
[in]serverTimestampthe timestamp of the server.
UaDataValue::~UaDataValue (  )

destruction


Member Function Documentation

void UaDataValue::attach ( const OpcUa_DataValue *  pValue )

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

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

Clear the data of the UaDataValue.

OpcUa_DataValue * UaDataValue::clone ( const OpcUa_DataValue &  source ) [static]

Copy OpcUa_DataValue data to a newly allocated OpcUa_DataValue.

Returns:
a newly allocated OpcUa_DataValue.
Parameters:
[in]sourcethe source of this operation.
void UaDataValue::cloneTo ( const OpcUa_DataValue &  source,
OpcUa_DataValue &  copy 
) [static]

Copy OpcUa_DataValue data to an existing OpcUa_DataValue structure.

Parameters:
[in]sourceSource OpcUa_DataValue to clone.
[in]copyNew copy of source OpcUa_DataValue.
bool UaDataValue::compare ( const OpcUa_DataValue &  dataValue1,
const OpcUa_DataValue &  dataValue2,
OpcUa_Boolean  bCompareTimestamps 
) [static]

Compares two DataValues and returns true if they are equal.

Returns:
true if the two DataValues are equal.
See also:
operator==
Parameters:
[in]dataValue1the source to compare to.
[in]dataValue2the destination to compare to.
[in]bCompareTimestampsflag indicating if the timestamp part of the data value should be included in the compare (True) or ignored (False).
OpcUa_DataValue * UaDataValue::copy (  ) const

Copy UaDataValue data to a newly allocated OpcUa_DataValue.

Returns:
a newly allocated OpcUa_DataValue.
void UaDataValue::copyTo ( OpcUa_DataValue *  pDst ) const

< [in] the destination of this operation.

Copy UaDataValue data to an exisitng OpcUa_DataValue structure.

OpcUa_DataValue * UaDataValue::detach ( OpcUa_DataValue *  pDst )

Reset OpcUa_DataValue structure without clearing the data. You are responsible for clearing the data after detaching. void sample(UaDataValue &dataValue) { OpcUa_DataValue deepcopy; datavalue.detach(&deepcopy); m_lstValues.push_back(deepcopy); }

Returns:
pDst is returned.
Parameters:
[in]pDstPointer to OpcUa_DataValue structure that receives the DataValue data.
OpcUa_Boolean UaDataValue::isServerTimestampSet (  ) const

Check if the server timestamp is set.

Returns:
true if set false if not.
OpcUa_Boolean UaDataValue::isSourceTimestampSet (  ) const

Check if the source timestamp is set.

Returns:
true if set false if not.
UaDataValue::operator const OpcUa_DataValue * (  ) const

Return internal OpcUa_DataValue structure.

Returns:
internal OpcUa_DataValue structure.
bool UaDataValue::operator!= ( const UaDataValue other ) const

< [in] the UaDataValue to compare.

Returns true if other is not equal to this.

See also:
operator==
Returns:
true if other is not equal to this.
UaDataValue & UaDataValue::operator= ( const UaDataValue other )

Assignment operator.

Returns:
Assignment operator.
Parameters:
[in]otherthe UaDataValue to assign.
bool UaDataValue::operator== ( const UaDataValue other ) const

< [in] the UaDataValue to compare.

Compare variables if they are similar.

Returns:
true if not similar false if similar.
OpcUa_UInt16 UaDataValue::serverPicoseconds (  ) const

Get the source picoseconds of the server.

Returns:
the source picoseconds of the server.
OpcUa_DateTime UaDataValue::serverTimestamp (  ) const

Get the source timestamp of the server.

Returns:
the source timestamp of the server.
void UaDataValue::setDataValue ( UaVariant value,
OpcUa_Boolean  detachValue,
OpcUa_StatusCode  statusCode,
OpcUa_DateTime  sourceTimestamp,
OpcUa_DateTime  serverTimestamp 
)

Sets all fields of the data value.

Parameters:
[in]valueThe value to set as UaVariant
[in]detachValueFlag indicating if the passed variant should be detached
[in]statusCodeThe status code to set
[in]sourceTimestampthe source timestamp
[in]serverTimestampthe server timestamp
void UaDataValue::setDataValue ( OpcUa_Variant &  value,
OpcUa_Boolean  detachValue,
OpcUa_StatusCode  statusCode,
OpcUa_DateTime  sourceTimestamp,
OpcUa_DateTime  serverTimestamp 
)

Sets all fields of the data value.

Parameters:
[in]valueThe value to set as UaVariant
[in]detachValueFlag indicating if the passed variant should be detached
[in]statusCodeThe status code to set
[in]sourceTimestampthe source timestamp
[in]serverTimestampthe server timestamp
void UaDataValue::setServerPicoseconds ( OpcUa_UInt16  serverPicoseconds )

Sets the source picoseconds of the server.

Parameters:
[in]serverPicosecondsthe source picoseconds of the server.
void UaDataValue::setServerTimestamp ( OpcUa_DateTime  serverTimestamp )

Sets the source timestamp of the server.

Parameters:
[in]serverTimestampthe source timestamp of the server.
void UaDataValue::setSourcePicoseconds ( OpcUa_UInt16  sourcePicoseconds )

Sets the source picoseconds.

Parameters:
[in]sourcePicosecondsthe source picoseconds to set.
void UaDataValue::setSourceTimestamp ( OpcUa_DateTime  sourceTimestamp )

Sets the source timestamp.

Parameters:
[in]sourceTimestampthe timestamp to set.
void UaDataValue::setStatusCode ( OpcUa_StatusCode  statusCode )

Set the status code.

Parameters:
[in]statusCodethe OPC UA Status code.
void UaDataValue::setValue ( UaVariant value,
OpcUa_Boolean  detachValue,
OpcUa_Boolean  updateTimeStamps = OpcUa_False 
)

Sets the value field of the data value and provides functionality to update the timestamp fields.

Parameters:
[in]valueThe value to set as UaVariant
[in]detachValueFlag indicating if the passed variant should be detached
[in]updateTimeStampsFlag indicating if the timestamp fields should be updated
void UaDataValue::setValue ( OpcUa_Variant &  value,
OpcUa_Boolean  detachValue,
OpcUa_Boolean  updateTimeStamps = OpcUa_False 
)

Sets the value field of the data value and provides functionality to update the timestamp fields.

Parameters:
[in]valueThe value to set as UaVariant
[in]detachValueFlag indicating if the passed variant should be detached
[in]updateTimeStampsFlag indicating if the timestamp fields should be updated
OpcUa_UInt16 UaDataValue::sourcePicoseconds (  ) const

Get the source picoseconds.

Returns:
the source picoseconds.
OpcUa_DateTime UaDataValue::sourceTimestamp (  ) const

Get the source timestamp.

Returns:
the source timestamp.
const OpcUa_Variant * UaDataValue::value (  ) const

Get the value of a variable.

Returns:
the value of a variable.

The documentation for this class was generated from the following files:
  • /home/buildbot/work/uasdkcpp/src/uabase/uabasecpp/uadatavalue.h
  • /home/buildbot/work/uasdkcpp/src/uabase/uabasecpp/uadatavalue.cpp