MCPcopy Create free account
hub / github.com/catboost/catboost / TIOStatus

Class TIOStatus

library/cpp/coroutine/engine/iostatus.h:5–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <util/generic/yexception.h>
4
5class TIOStatus {
6public:
7 TIOStatus(int status) noexcept
8 : Status_(status)
9 {
10 }
11
12 static TIOStatus Error(int status) noexcept {
13 return TIOStatus(status);
14 }
15
16 static TIOStatus Error() noexcept {
17 return TIOStatus(LastSystemError());
18 }
19
20 static TIOStatus Success() noexcept {
21 return TIOStatus(0);
22 }
23
24 void Check() const {
25 if (Status_) {
26 ythrow TSystemError(Status_) << "io error";
27 }
28 }
29
30 bool Failed() const noexcept {
31 return (bool)Status_;
32 }
33
34 bool Succeed() const noexcept {
35 return !Failed();
36 }
37
38 int Status() const noexcept {
39 return Status_;
40 }
41
42private:
43 int Status_;
44};
45
46
47class TContIOStatus {

Callers 2

ErrorMethod · 0.85
SuccessMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected