23 namespace onnxruntime {
57 return "INVALID_ARGUMENT";
63 return "ENGINE_ERROR";
65 return "RUNTIME_EXCEPTION";
67 return "INVALID_PROTOBUF";
69 return "MODEL_LOADED";
71 return "NOT_IMPLEMENTED";
73 return "INVALID_GRAPH";
77 return "GENERAL ERROR";
82 constexpr HRESULT StatusCodeToHRESULT(
StatusCode status) noexcept {
91 return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
93 return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
99 return HRESULT_FROM_WIN32(ERROR_FILE_CORRUPT);
101 return HRESULT_FROM_WIN32(ERROR_INTERNAL_ERROR);
105 return HRESULT_FROM_WIN32(ERROR_FILE_CORRUPT);
107 return HRESULT_FROM_WIN32(ERROR_INTERNAL_ERROR);
116 Status() noexcept =
default;
126 : state_((other.state_ ==
nullptr) ?
nullptr : new
State(*other.state_)) {}
129 if (state_ != other.state_) {
130 if (other.state_ ==
nullptr) {
133 state_.reset(
new State(*other.state_));
144 return (state_ ==
nullptr);
147 int Code()
const noexcept;
151 const std::
string& ErrorMessage()
const noexcept;
153 std::
string ToString()
const;
155 bool operator==(const
Status& other)
const {
156 return (this->state_ == other.state_) || (ToString() == other.ToString());
160 return !(*
this == other);
172 : category(cat0), code(code0), msg(msg0) {}
175 : category(cat0), code(code0), msg(msg0) {}
183 std::unique_ptr<State> state_;
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)