P4C
The P4 Compiler
Loading...
Searching...
No Matches
trace_event.h
1#ifndef BACKENDS_P4TOOLS_COMMON_LIB_TRACE_EVENT_H_
2#define BACKENDS_P4TOOLS_COMMON_LIB_TRACE_EVENT_H_
3
4#include <iosfwd>
5
6#include "backends/p4tools/common/lib/model.h"
7#include "backends/p4tools/common/lib/symbolic_env.h"
8#include "ir/visitor.h"
9#include "lib/castable.h"
10
11namespace P4::P4Tools {
12
14class TraceEvent : public ICastable {
15 private:
16 friend std::ostream &operator<<(std::ostream &os, const TraceEvent &event);
17
18 public:
19 virtual ~TraceEvent() = default;
20 TraceEvent();
21
25 [[nodiscard]] virtual const TraceEvent *subst(const SymbolicEnv &env) const;
26
28 virtual const TraceEvent *apply(Transform &visitor) const;
29
32 [[nodiscard]] virtual const TraceEvent *evaluate(const Model &model, bool doComplete) const;
33
34 protected:
36 virtual void print(std::ostream &) const = 0;
37
38 DECLARE_TYPEINFO(TraceEvent);
39};
40
41} // namespace P4::P4Tools
42
43#endif /* BACKENDS_P4TOOLS_COMMON_LIB_TRACE_EVENT_H_ */
Definition castable.h:36
Definition backends/p4tools/common/lib/model.h:18
Definition symbolic_env.h:12
An event in a trace of the execution of a P4 program.
Definition trace_event.h:14
virtual const TraceEvent * apply(Transform &visitor) const
Applies the given IR transform to the expressions in this trace event.
Definition trace_event.cpp:14
virtual void print(std::ostream &) const =0
Prints this trace event to the given ostream.
virtual const TraceEvent * subst(const SymbolicEnv &env) const
Definition trace_event.cpp:12
virtual const TraceEvent * evaluate(const Model &model, bool doComplete) const
Definition trace_event.cpp:16
Definition visitor.h:424
Definition common/compiler/compiler_result.cpp:3