C++ Based OPC UA Client/Server/PubSub SDK
1.7.8.584
|
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. | |
UaStatus & | operator= (const OpcUa_StatusCode &other) |
Assigns other status code to this status, resets the diagnostic information and returns a reference to this status. More... | |
UaStatus & | operator= (const UaStatusCode &other) |
Assigns other status code to this status, resets the diagnostic information and returns a reference to this status. More... | |
UaStatus & | operator= (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... | |
UaDiagnosticInfo * | pDiagnosticInfo () 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 (const UaStatusCode &other) | |
Construction of the status code class with passed other status code class. More... | |
~UaStatusCode () | |
Destruction of status code class. | |
UaStatusCode & | operator= (const OpcUa_StatusCode &other) |
Implements the operator = for UaStatusCode. More... | |
UaStatusCode & | 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... | |
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... | |
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.
UaStatus::UaStatus | ( | const OpcUa_StatusCode & | other | ) |
Constructs a status with empty diagnostic info and the passed status code.
other | the status code as OpcUa_StatusCode. |
UaStatus::UaStatus | ( | const UaStatusCode & | other | ) |
Constructs a status with empty diagnostic info and the passed status code.
other | the status code as UaStatusCode. |
UaStatus::UaStatus | ( | const UaStatus & | other | ) |
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.
other | the status code to assign as OpcUa_StatusCode |
UaStatus & UaStatus::operator= | ( | const UaStatusCode & | other | ) |
Assigns other status code to this status, resets the diagnostic information and returns a reference to this status.
other | the status code to assign as UaStatusCode |
Assigns other status to this status and returns a reference to this status.
other | the other UaStatus to assign. |
|
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.
sAdditionalInfo | the 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.
namespaceUri | The namespace URI used together with the SymbolicId. |
symbolicId | The 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. |
localizedText | An 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.
namespaceUri | The namespace URI used together with the numericReturnCode to compose the SymbolicId. |
numericReturnCode | A numeric return code that gets converted into a string used as SymbolicId in the diagnostic information. |
localizedText | An 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.
pDiagnosticInfo | The UaDiagnosticInfo object to set. |
void UaStatus::setInnerStatus | ( | const UaStatus & | innerStatus | ) |
Set the nested inner status containing a StatusCode and optional inner DiagnosticInformation.
innerStatus | the inner status. |
void UaStatus::setStatus | ( | OpcUa_StatusCode | statusCode, |
const UaString & | sDiagnosticInfo | ||
) |
Set a status code and a diagnostic info.
statusCode | the OPC UA Status code |
sDiagnosticInfo | An optional vendor-specific localized text string describing the error condition. The maximum length of this text string is 256 characters.. |