* Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
* MindIE is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
#ifndef MINDIE_LLM_STATUS_H
#define MINDIE_LLM_STATUS_H
#include <string>
#include "error.h"
namespace mindie_llm {
enum class NodeHealthStatus { READY, ABNORMAL };
class Status {
public:
explicit Status(Error::Code code = Error::Code::OK) noexcept { error_ = Error(code); }
explicit Status(Error::Code code, const std::string &msg) { error_ = Error(code, msg); }
explicit Status(const Error &error) { error_ = error; }
bool IsOk() const { return error_.IsOk(); }
Error::Code StatusCode() const { return error_.ErrorCode(); }
std::string StatusMsg() const { return error_.Message(); }
bool operator==(const Status &other) const { return error_.ErrorCode() == other.error_.ErrorCode(); }
private:
Error error_;
};
}
#endif