Trigger constructor (and factoring) to support lower-level constructions

This commit is contained in:
Vern Paxson 2021-05-30 17:28:25 -07:00
parent a16a25efbd
commit b1e95d68e0
2 changed files with 45 additions and 28 deletions

View file

@ -38,7 +38,9 @@ public:
// instantiation. Note that if the condition is already true, the
// statements are executed immediately and the object is deleted
// right away.
Trigger(Expr* cond, Stmt* body, Stmt* timeout_stmts, Expr* timeout,
Trigger(const Expr* cond, Stmt* body, Stmt* timeout_stmts, Expr* timeout,
Frame* f, bool is_return, const Location* loc);
Trigger(const Expr* cond, Stmt* body, Stmt* timeout_stmts, double timeout,
Frame* f, bool is_return, const Location* loc);
~Trigger() override;
@ -95,12 +97,16 @@ private:
friend class TriggerTraversalCallback;
friend class TriggerTimer;
void Init(std::vector<IntrusivePtr<Val>> index_expr_results);
void Init(const Expr* cond, Stmt* body, Stmt* timeout_stmts, Frame* frame,
bool is_return, const Location* location);
void ReInit(std::vector<IntrusivePtr<Val>> index_expr_results);
void Register(ID* id);
void Register(Val* val);
void UnregisterAll();
Expr* cond;
const Expr* cond;
Stmt* body;
Stmt* timeout_stmts;
Expr* timeout;