22 namespace onnxruntime {
56 return "INVALID_ARGUMENT";
62 return "ENGINE_ERROR";
64 return "RUNTIME_EXCEPTION";
66 return "INVALID_PROTOBUF";
68 return "MODEL_LOADED";
70 return "NOT_IMPLEMENTED";
72 return "INVALID_GRAPH";
76 return "GENERAL ERROR";
81 constexpr HRESULT StatusCodeToHRESULT(
StatusCode status) noexcept {
90 return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
92 return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
98 return HRESULT_FROM_WIN32(ERROR_FILE_CORRUPT);
100 return HRESULT_FROM_WIN32(ERROR_INTERNAL_ERROR);
104 return HRESULT_FROM_WIN32(ERROR_FILE_CORRUPT);
106 return HRESULT_FROM_WIN32(ERROR_INTERNAL_ERROR);
115 Status() noexcept =
default;
124 : state_((other.state_ == nullptr) ? nullptr : new
State(*other.state_)) {}
126 if (state_ != other.state_) {
127 if (other.state_ ==
nullptr) {
130 state_.reset(
new State(*other.state_));
141 return (state_ ==
nullptr);
144 int Code() const noexcept;
148 const std::
string& ErrorMessage() const noexcept;
150 std::
string ToString() const;
152 bool operator==(const
Status& other)
const {
153 return (this->state_ == other.state_) || (ToString() == other.ToString());
157 return !(*
this == other);
169 : category(cat0), code(code0), msg(msg0) {}
172 : category(cat0), code(code0), msg(msg0) {}
180 std::unique_ptr<State> state_;
Status(const Status &other)
GLsizei const GLchar *const * string
constexpr const char * StatusCodeToString(StatusCode status) noexcept
std::string ToString() const
bool operator!=(const Status &other) const
std::ostream & operator<<(std::ostream &out, const Status &status)
LeafData & operator=(const LeafData &)=delete
Status & operator=(const Status &other)