ONNX Runtime
Loading...
Searching...
No Matches
Ort::Status Struct Reference

The Status that holds ownership of OrtStatus received from C API Use it to safely destroy OrtStatus* returned from the C API. Use appropriate constructors to construct an instance of a Status object from exceptions. More...

#include <onnxruntime_cxx_api.h>

Inheritance diagram for Ort::Status:
Ort::detail::Base< OrtStatus >

Public Types

using Base = detail::Base< OrtStatus >
 
- Public Types inherited from Ort::detail::Base< OrtStatus >
using contained_type = OrtStatus
 

Public Member Functions

 Status (std::nullptr_t) noexcept
 Create an empty object, must be assigned a valid one to be used.
 
 Status (OrtStatus *status) noexcept
 Takes ownership of OrtStatus instance returned from the C API.
 
 Status (const Exception &) noexcept
 Creates status instance out of exception.
 
 Status (const std::exception &) noexcept
 Creates status instance out of exception.
 
 Status (const char *message, OrtErrorCode code) noexcept
 Creates status instance out of null-terminated string message.
 
std::string GetErrorMessage () const
 
OrtErrorCode GetErrorCode () const
 
bool IsOK () const noexcept
 Returns true if instance represents an OK (non-error) status.
 
- Public Member Functions inherited from Ort::detail::Base< OrtStatus >
constexpr Base ()=default
 
constexpr Base (contained_type *p) noexcept
 
 Base (const Base &)=delete
 
 Base (Base &&v) noexcept
 
 ~Base ()
 
Baseoperator= (const Base &)=delete
 
Baseoperator= (Base &&v) noexcept
 
constexpr operator contained_type * () const noexcept
 
contained_typerelease ()
 Relinquishes ownership of the contained C object pointer The underlying object is not destroyed.
 

Additional Inherited Members

- Protected Attributes inherited from Ort::detail::Base< OrtStatus >
contained_typep_
 

Detailed Description

The Status that holds ownership of OrtStatus received from C API Use it to safely destroy OrtStatus* returned from the C API. Use appropriate constructors to construct an instance of a Status object from exceptions.

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ Status() [1/5]

Ort::Status::Status ( std::nullptr_t  )
inlineexplicitnoexcept

Create an empty object, must be assigned a valid one to be used.

◆ Status() [2/5]

Ort::Status::Status ( OrtStatus status)
explicitnoexcept

Takes ownership of OrtStatus instance returned from the C API.

◆ Status() [3/5]

Ort::Status::Status ( const Exception )
explicitnoexcept

Creates status instance out of exception.

◆ Status() [4/5]

Ort::Status::Status ( const std::exception &  )
explicitnoexcept

Creates status instance out of exception.

◆ Status() [5/5]

Ort::Status::Status ( const char *  message,
OrtErrorCode  code 
)
noexcept

Creates status instance out of null-terminated string message.

Member Function Documentation

◆ GetErrorCode()

OrtErrorCode Ort::Status::GetErrorCode ( ) const

◆ GetErrorMessage()

std::string Ort::Status::GetErrorMessage ( ) const

◆ IsOK()

bool Ort::Status::IsOK ( ) const
noexcept

Returns true if instance represents an OK (non-error) status.