open62541++ 0.13.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
Public Member Functions | List of all members
opcua::StatusCode Class Reference

#include <Builtin.h>

Inheritance diagram for opcua::StatusCode:
[legend]

Detailed Description

UA_StatusCode wrapper class.

StatusCode can be used interchangeably with UA_StatusCode due to implicit conversions (without any overhead) but provides some methods to simplify the handling with status codes.

See also
statuscodes.h
https://reference.opcfoundation.org/Core/Part4/v105/docs/7.39
Examples
server_accesscontrol.cpp.

Definition at line 41 of file Builtin.h.

Public Member Functions

constexpr StatusCode () noexcept=default
 
constexpr StatusCode (UA_StatusCode code) noexcept
 
constexpr UA_StatusCode get () const noexcept
 
std::string_view name () const noexcept
 
constexpr bool isGood () const noexcept
 
constexpr bool isUncertain () const noexcept
 
constexpr bool isBad () const noexcept
 
constexpr void throwIfBad () const
 
- Public Member Functions inherited from opcua::Wrapper< UA_StatusCode >
constexpr Wrapper ()=default
 
constexpr Wrapper (const UA_StatusCode &native)
 
constexpr Wrapper (UA_StatusCode &&native) noexcept
 
constexpr operator UA_StatusCode & () noexcept
 
constexpr operator const UA_StatusCode & () const noexcept
 
constexpr UA_StatusCodeoperator-> () noexcept
 
constexpr const UA_StatusCodeoperator-> () const noexcept
 
constexpr UA_StatusCodehandle () noexcept
 
constexpr const UA_StatusCodehandle () const noexcept
 

Additional Inherited Members

- Public Types inherited from opcua::Wrapper< UA_StatusCode >
using NativeType
 
- Protected Member Functions inherited from opcua::Wrapper< UA_StatusCode >
constexpr const UA_StatusCodenative () const noexcept
 
constexpr UA_StatusCodenative () noexcept
 

Constructor & Destructor Documentation

◆ StatusCode() [1/2]

constexpr opcua::StatusCode::StatusCode ( )
constexprdefaultnoexcept

Create a StatusCode with the default status code UA_STATUSCODE_GOOD.

◆ StatusCode() [2/2]

constexpr opcua::StatusCode::StatusCode ( UA_StatusCode code)
inlineconstexprnoexcept

Definition at line 46 of file Builtin.h.

Member Function Documentation

◆ get()

constexpr UA_StatusCode opcua::StatusCode::get ( ) const
inlineconstexprnoexcept

Explicitly get underlying UA_StatusCode.

Definition at line 50 of file Builtin.h.

◆ name()

std::string_view opcua::StatusCode::name ( ) const
inlinenoexcept

Get human-readable name of the StatusCode.

This feature might be disabled to create a smaller binary with the UA_ENABLE_STATUSCODE_DESCRIPTIONS build-flag. Then the function returns an empty string for every StatusCode.

Definition at line 58 of file Builtin.h.

◆ isGood()

constexpr bool opcua::StatusCode::isGood ( ) const
inlineconstexprnoexcept

Check if the status code is good.

Definition at line 63 of file Builtin.h.

◆ isUncertain()

constexpr bool opcua::StatusCode::isUncertain ( ) const
inlineconstexprnoexcept

Check if the status code is uncertain.

Definition at line 68 of file Builtin.h.

◆ isBad()

constexpr bool opcua::StatusCode::isBad ( ) const
inlineconstexprnoexcept

◆ throwIfBad()

constexpr void opcua::StatusCode::throwIfBad ( ) const
inlineconstexpr

Throw a BadStatus exception if the status code is bad.

Exceptions
BadStatus

Definition at line 79 of file Builtin.h.

Referenced by opcua::Result< void >::value().