P4C
The P4 Compiler
Loading...
Searching...
No Matches
gress.h
1
19#ifndef BF_P4C_IR_GRESS_H_
20#define BF_P4C_IR_GRESS_H_
21
22#include <iosfwd>
23#include <optional>
24
25#include "lib/cstring.h"
26
27using namespace P4;
28
30enum gress_t {
31 INGRESS = 0,
32 EGRESS = 1,
33 GHOST = 2,
34 GRESS_T_COUNT // number of different threads (max of all targets)
35};
36
39inline gress_t operator~(const gress_t &gress) { return gress_t((gress & 1) ^ 1); }
40
41cstring toString(gress_t gress);
42cstring toSymbol(gress_t gress);
43cstring createThreadName(gress_t gress, cstring name);
44cstring stripThreadPrefix(cstring name);
45
46std::ostream &operator<<(std::ostream &out, gress_t gress);
47std::ostream &operator<<(std::ostream &out, std::optional<gress_t> gress);
48bool operator>>(cstring s, gress_t &gressOut);
49
50#endif /* BF_P4C_IR_GRESS_H_ */
Definition cstring.h:85
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24