microsoft/onnxruntime-extensions

Public

mirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
3649db065d6cff05ee0f29e4a886b2b13fcf8d3e

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

base/status.h

31lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3#pragma once
4
5#include <string>
6#include <memory>
7#include "ortx_types.h"
8
9struct OrtStatus;
10
11struct OrtxStatus {
12 OrtxStatus();
13 ~OrtxStatus();
14 OrtxStatus(extError_t code, const std::string& error_message);
15 OrtxStatus(const OrtxStatus& s);
16 OrtxStatus& operator=(const OrtxStatus& s);
17 bool operator==(const OrtxStatus& s) const;
18 bool operator!=(const OrtxStatus& s) const;
19 [[nodiscard]] inline bool IsOk() const { return rep_ == nullptr; }
20
21 void SetErrorMessage(const char* str);
22 [[nodiscard]] const char* Message() const;
23 [[nodiscard]] extError_t Code() const;
24 std::string ToString() const;
25
26 OrtStatus* CreateOrtStatus() const;
27
28 private:
29 struct Rep;
30 std::unique_ptr<Rep> rep_;
31};
32