MCPcopy Create free account
hub / github.com/RoboMaster/RoboRTS / ErrorInfo

Class ErrorInfo

roborts_common/include/state/error_code.h:91–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89};
90
91class ErrorInfo {
92
93 public:
94 ErrorInfo():error_code_(ErrorCode::OK),error_msg_(""){};
95 ErrorInfo(ErrorCode error_code, const std::string &error_msg=""):error_code_(error_code),error_msg_(error_msg){};
96
97 ErrorInfo& operator= ( const ErrorInfo& error_info ) {
98 if (&error_info != this) {
99 error_code_ = error_info.error_code_;
100 error_msg_ = error_info.error_msg_;
101 }
102 return *this;
103 }
104
105 static ErrorInfo OK(){
106 return ErrorInfo();
107 }
108
109 ErrorCode error_code() const { return error_code_;};
110 const std::string &error_msg() const { return error_msg_; }
111
112 bool operator==(const ErrorInfo& rhs){
113 return error_code_==rhs.error_code();
114 }
115
116 bool IsOK() const{
117 return (error_code_ == ErrorCode::OK);
118 }
119
120 ~ErrorInfo()= default;
121
122 private:
123 ErrorCode error_code_;
124 std::string error_msg_;
125
126
127};
128
129} //namespace roborts_common
130

Callers 12

InitMethod · 0.85
ConstraintSetMethod · 0.85
OKMethod · 0.85
InitMethod · 0.85
PlanThreadMethod · 0.85
PlanMethod · 0.85
SearchPathMethod · 0.85
GetMoveCostMethod · 0.85
InitMethod · 0.85
LoopMethod · 0.85
InitializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected