P4C
The P4 Compiler
Loading...
Searching...
No Matches
backends/tofino/bf-p4c/phv/error.h
1
19#ifndef BF_P4C_PHV_ERROR_H_
20#define BF_P4C_PHV_ERROR_H_
21
22#include <sstream>
23
24namespace PHV {
25
27enum class ErrorCode {
28 ok = 0,
29 unknown,
30 // utils::is_well_formed
31 slicelist_sz_mismatch,
32};
33
37class Error : public std::stringstream {
38 public:
40 Error() : code(ErrorCode::ok) {}
41 void set(ErrorCode c) { code = c; }
42 bool is(ErrorCode c) { return code == c; }
43};
44
45} // namespace PHV
46
47#endif /* BF_P4C_PHV_ERROR_H_ */
Definition backends/tofino/bf-p4c/phv/error.h:37
The namespace encapsulating PHV-related stuff.
Definition gateway.h:32
ErrorCode
ErrorCode is the specific reason of failure of function invoke.
Definition backends/tofino/bf-p4c/phv/error.h:27
Definition common/field_defuse.cpp:590