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

The class encapsulated OPC UA status codes and conversions from ant to Classic OPC codes. More...

#include <statuscode.h>

Inherited by UaStatus.

Public Member Functions

 UaStatusCode ()
 Construction of the status code class with initial value Good. More...
 
 UaStatusCode (const OpcUa_StatusCode &other)
 Construction of the status code class with passed code as initial value. More...
 
 ~UaStatusCode ()
 Destruction of status code class.
 
UaStatusCodeoperator= (const OpcUa_StatusCode &other)
 Implements the operator = for UaStatusCode. More...
 
UaStatusCodeoperator= (const UaStatusCode &other)
 Implements the operator = for UaStatusCode. More...
 
OpcUa_Boolean isGood () const
 Checks if the status code is GOOD.
 
OpcUa_Boolean isNotGood () const
 Checks if the status code is not GOOD.
 
OpcUa_Boolean isUncertain () const
 Checks if the status code is UNCERTAIN.
 
OpcUa_Boolean isNotUncertain () const
 Checks if the status code is not UNCERTAIN.
 
OpcUa_Boolean isBad () const
 Checks if the status code is BAD.
 
OpcUa_Boolean isNotBad () const
 Checks if the status code is not BAD.
 
OpcUa_StatusCode statusCode () const
 Get the status code value.
 
void getResponseHeader (OpcUa_RequestHeader *requestHeader, OpcUa_ResponseHeader *responseHeader)
 Creates a response header for OPC UA service calls. More...
 
UaString toString () const
 Returns the string representation of the current OPC UA status code. More...
 
void toVariant (UaVariant &variant) const
 
void toVariant (OpcUa_Variant &variant) const
 
void toDataValue (UaDataValue &dataValue, OpcUa_Boolean updateTimeStamps) const
 
void toDataValue (OpcUa_DataValue &dataValue, OpcUa_Boolean updateTimeStamps) const
 

Static Public Member Functions

static UaString toString (OpcUa_StatusCode statusCode)
 Return string representation of a known OpcUa_StatusCode. More...
 
static OpcUa_StatusCode setComDaError (long comDaError)
 Set the status code with a COM DA error code. More...
 
static OpcUa_StatusCode setComDaQuality (unsigned short comDaQuality)
 Set the status code with a COM DA quality. More...
 
static OpcUa_StatusCode setComDaStatus (long comDaError, unsigned short comDaQuality)
 Set the status code with COM DA error and quality. More...
 
static void getComDaStatus (const OpcUa_StatusCode statusCode, long &comDaError, unsigned short &comDaQuality)
 Get COM DA error and quality from the status code. More...
 

Protected Attributes

OpcUa_StatusCode m_StatusCode
 

Static Protected Attributes

static std::map
< OpcUa_StatusCode, const char * > 
s_mapStatusToString = create_map()
 

Detailed Description

The class encapsulated OPC UA status codes and conversions from ant to Classic OPC codes.

Constructor & Destructor Documentation

UaStatusCode::UaStatusCode ( )

Construction of the status code class with initial value Good.

UaStatusCode::UaStatusCode ( const OpcUa_StatusCode &  other)

Construction of the status code class with passed code as initial value.

Parameters
otherInitial status code value

Member Function Documentation

void UaStatusCode::getComDaStatus ( const OpcUa_StatusCode  statusCode,
long &  comDaError,
unsigned short &  comDaQuality 
)
static

Get COM DA error and quality from the status code.

Parameters
statusCodethe OPC UA Status code.
comDaErrora COM DA error.
comDaQualitya COM DA quality.
void UaStatusCode::getResponseHeader ( OpcUa_RequestHeader *  requestHeader,
OpcUa_ResponseHeader *  responseHeader 
)

Creates a response header for OPC UA service calls.

Parameters
requestHeaderthe request header.
responseHeaderthe response header.
UaStatusCode & UaStatusCode::operator= ( const OpcUa_StatusCode &  other)

Implements the operator = for UaStatusCode.

Parameters
otherThe OpcUa_StatusCode to assign.
Returns
Assignment operator.
UaStatusCode & UaStatusCode::operator= ( const UaStatusCode other)

Implements the operator = for UaStatusCode.

Parameters
otherthe UaStatusCode to assign.
Returns
Assignment operator.
OpcUa_StatusCode UaStatusCode::setComDaError ( long  comDaError)
static

Set the status code with a COM DA error code.

Parameters
comDaErrora COM DA error code.
Returns
the OPC UA Status Code
OpcUa_StatusCode UaStatusCode::setComDaQuality ( unsigned short  comDaQuality)
static

Set the status code with a COM DA quality.

Parameters
comDaQualitya COM DA quality.
Returns
the OPC UA Status Code
OpcUa_StatusCode UaStatusCode::setComDaStatus ( long  comDaError,
unsigned short  comDaQuality 
)
static

Set the status code with COM DA error and quality.

Parameters
comDaErrora COM DA error.
comDaQualitya COM DA quality.
Returns
the OPC UA Status Code
UaString UaStatusCode::toString ( ) const

Returns the string representation of the current OPC UA status code.

Returns
The symbolic name for the passed status code
UaString UaStatusCode::toString ( OpcUa_StatusCode  statusCode)
static

Return string representation of a known OpcUa_StatusCode.

Returns
The symbolic name for the passed status code

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