# OnnxRuntime: Ort::Status Struct Reference

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:

## Public Member Functions

| Status (std::nullptr_t)
| Create an empty object, must be assigned a valid one to be used.
| Status (OrtStatus *status)
| Takes ownership of OrtStatus instance returned from the C API. Must be non-null.
| Status (const Exception &)
| Creates status instance out of exception.
| Status (const std::exception &)
| Creates status instance out of exception.
std::string | GetErrorMessage () const
OrtErrorCode | GetErrorCode () const
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 ()
Base & | operator= (const Base &)=delete
Base & | operator= (Base &&v) noexcept
constexpr | operator contained_type * () const noexcept
contained_type * | release ()
| Relinquishes ownership of the contained C object pointer The underlying object is not destroyed.

## Additional Inherited Members

Public Types inherited from Ort::detail::Base< OrtStatus >
using | contained_type = OrtStatus
Protected Attributes inherited from Ort::detail::Base< OrtStatus >
contained_type * | p_

## 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.

## Constructor & Destructor Documentation

## Status() [1/4]

Ort::Status::Status | ( | std::nullptr_t |  | ) |

inlineexplicit

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

## Status() [2/4]

Ort::Status::Status | ( | OrtStatus * | status | ) |

explicit

Takes ownership of OrtStatus instance returned from the C API. Must be non-null.

## Status() [3/4]

Ort::Status::Status | ( | const Exception & |  | ) |

explicit

Creates status instance out of exception.

## Status() [4/4]

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

explicit

Creates status instance out of exception.

## Member Function Documentation

## GetErrorCode()

OrtErrorCode Ort::Status::GetErrorCode | ( |  | ) | const

## GetErrorMessage()

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