C++ UA Server SDK  1.5.0.318
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages

This class handles status codes, conversions of the status code and diagnostic information. More...

#include <statuscode.h>

Inherits UaStatusCode.

Public Member Functions

 UaStatus ()
 Constructs a status with empty diagnostic info and status code set to Good.
 
 UaStatus (const OpcUa_StatusCode &other)
 Constructs a status with empty diagnostic info and the passed status code. More...
 
 UaStatus (const UaStatusCode &other)
 Constructs a status with empty diagnostic info and the passed status code. More...
 
 UaStatus (const UaStatus &other)
 Constructs a status with another UaStatus. More...
 
 ~UaStatus ()
 Destroys the status.
 
UaStatusoperator= (const OpcUa_StatusCode &other)
 Assigns other status code to this status, resets the diagnostic information and returns a reference to this status. More...
 
UaStatusoperator= (const UaStatusCode &other)
 Assigns other status code to this status, resets the diagnostic information and returns a reference to this status. More...
 
UaStatusoperator= (const UaStatus &other)
 Assigns other status to this status and returns a reference to this status. More...
 
void setStatus (OpcUa_StatusCode statusCode, const UaString &sDiagnosticInfo)
 Set a status code and a diagnostic info. More...
 
void setDiagnosticInfo (const UaString &namespaceUri, const UaString &symbolicId, const UaLocalizedText &localizedText)
 Set a symbolicId and a diagnostic info string used to provide diagnostic information. More...
 
void setDiagnosticInfo (const UaString &namespaceUri, OpcUa_UInt32 numericReturnCode, const UaLocalizedText &localizedText)
 Set a numeric return code and a diagnostic info. More...
 
void setDiagnosticInfo (UaDiagnosticInfo *pDiagnosticInfo)
 Set a UaDiagnosticInfo object. More...
 
void setAdditionalInfo (const UaString &sAdditionalInfo)
 Set the string for additional vendor specific diagnostic information. More...
 
void setInnerStatus (const UaStatus &innerStatus)
 Set the nested inner status containing a StatusCode and optional inner DiagnosticInformation. More...
 
UaDiagnosticInfopDiagnosticInfo () const
 Provides access to the optional DiagnosticInformation. More...
 
- Public Member Functions inherited from UaStatusCode
 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...
 
bool operator== (const OpcUa_StatusCode &other)
 Implements the operator == for UaStatusCode. More...
 
bool operator== (const UaStatusCode &other)
 Implements the operator == for UaStatusCode. More...
 
bool operator!= (const OpcUa_StatusCode &other)
 Implements the operator == for UaStatusCode. More...
 
bool operator!= (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
 Gets the full status code value.
 
OpcUa_StatusCode code () const
 Gets the code part (Severity + SubCode) of the status code value.
 
OpcUa_StatusCode infoType () const
 Gets the InfoType part of the status code value.
 
OpcUa_StatusCode infoBits () const
 Gets the InfoBits part of the status code value.
 
void setOverflowBits ()
 Sets the DataValue bit in the InfoType and the Overflow bit in the InfoBits. More...
 
void setStructureChangedBit ()
 Sets the StructureChanged bit in the status code value. More...
 
bool isStructureChanged () const
 Checks if the StructureChanged bit is set in the status code value. More...
 
void setSemanticsChangedBit ()
 Sets the SemanticsChanged bit in the status code value. More...
 
bool isSemanticsChanged () const
 Checks if the SemanticsChanged bit is set in the status code value. More...
 
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from UaStatusCode
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, bool isValueRelated=false)
 Get COM DA error and quality from the status code. More...
 

Detailed Description

This class handles status codes, conversions of the status code and diagnostic information.

The class is derived from UaStatusCode and is used to combine the StatusCode with associated diagnostic information in one object. The class UaStatusCode encapsulated OPC UA data type StatusCodes and conversions from and to Classic OPC codes

See UaStatusCode for StatusCode related documentation and functions.

Constructor & Destructor Documentation

UaStatus::UaStatus ( const OpcUa_StatusCode other)

Constructs a status with empty diagnostic info and the passed status code.

Parameters
otherthe status code as OpcUa_StatusCode.
UaStatus::UaStatus ( const UaStatusCode other)

Constructs a status with empty diagnostic info and the passed status code.

Parameters
otherthe status code as UaStatusCode.
UaStatus::UaStatus ( const UaStatus other)

Constructs a status with another UaStatus.

Parameters
otherthe other status as UaStatus.

Member Function Documentation

UaStatus & UaStatus::operator= ( const OpcUa_StatusCode other)

Assigns other status code to this status, resets the diagnostic information and returns a reference to this status.

Parameters
otherthe status code to assign as OpcUa_StatusCode
Returns
The reference to the changes status
UaStatus & UaStatus::operator= ( const UaStatusCode other)

Assigns other status code to this status, resets the diagnostic information and returns a reference to this status.

Parameters
otherthe status code to assign as UaStatusCode
Returns
The reference to the changes status
UaStatus & UaStatus::operator= ( const UaStatus other)

Assigns other status to this status and returns a reference to this status.

Parameters
otherthe other UaStatus to assign.
Returns
The reference to the changes status
UaDiagnosticInfo* UaStatus::pDiagnosticInfo ( ) const
inline

Provides access to the optional DiagnosticInformation.

The returned pointer is NULL if there is no DiagnosticInformation available.

void UaStatus::setAdditionalInfo ( const UaString sAdditionalInfo)

Set the string for additional vendor specific diagnostic information.

Parameters
sAdditionalInfothe additional diagnostic information.
void UaStatus::setDiagnosticInfo ( const UaString namespaceUri,
const UaString symbolicId,
const UaLocalizedText localizedText 
)

Set a symbolicId and a diagnostic info string used to provide diagnostic information.

Parameters
namespaceUriThe namespace URI used together with the SymbolicId.
symbolicIdThe symbolic Id as string. A vendor-specific symbolic identifier string identifies an error or condition. The maximum length of this string is 32 characters. Servers wishing to return a numeric return code should convert the return code into a string and return the string in this identifier. The UaStatus class provides another overloaded member to pass a numeric code.
localizedTextAn optional vendor-specific localized text string describing the error condition related to the symbolic id. The maximum length of this text string is 256 characters.
void UaStatus::setDiagnosticInfo ( const UaString namespaceUri,
OpcUa_UInt32  numericReturnCode,
const UaLocalizedText localizedText 
)

Set a numeric return code and a diagnostic info.

Parameters
namespaceUriThe namespace URI used together with the numericReturnCode to compose the SymbolicId.
numericReturnCodeA numeric return code that gets converted into a string used as SymbolicId in the diagnostic information.
localizedTextAn optional vendor-specific localized text string describing the error condition related to the numeric code. The maximum length of this text string is 256 characters..
void UaStatus::setDiagnosticInfo ( UaDiagnosticInfo pDiagnosticInfo)

Set a UaDiagnosticInfo object.

The UaStatus object takes over the reference of the caller. If the caller did not create the UaDiagnosticInfo object, the caller must increment the reference count of the UaDiagnosticInfo object with addRef() before calling this function.

Parameters
pDiagnosticInfoThe UaDiagnosticInfo object to set.
void UaStatus::setInnerStatus ( const UaStatus innerStatus)

Set the nested inner status containing a StatusCode and optional inner DiagnosticInformation.

Parameters
innerStatusthe inner status.
void UaStatus::setStatus ( OpcUa_StatusCode  statusCode,
const UaString sDiagnosticInfo 
)

Set a status code and a diagnostic info.

Parameters
statusCodethe OPC UA Status code
sDiagnosticInfoAn optional vendor-specific localized text string describing the error condition. The maximum length of this text string is 256 characters..

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