add a new data structure in execution.h, which is used by history.cc to link FuncInsts
[c11tester.git] / funcinst.h
1 #include "action.h"
2 #include "hashtable.h"
3
4 class ModelAction;
5
6 typedef ModelList<FuncInst *> func_inst_list_mt;
7
8 class FuncInst {
9 public:
10         FuncInst(ModelAction *act);
11         ~FuncInst();
12
13         //ModelAction * get_action() const { return action; }
14         const char * get_position() const { return position; }
15         void * get_location() const { return location; }
16         action_type get_type() const { return type; }
17
18         bool add_pred(FuncInst * other);
19         bool add_succ(FuncInst * other);
20
21         FuncInst * search_in_collision(ModelAction *act);
22
23         func_inst_list_mt * get_collisions() { return &collisions; }
24         func_inst_list_mt * get_preds() { return &predecessors; }
25         func_inst_list_mt * get_succs() { return &successors; }
26
27         MEMALLOC
28 private:
29         //ModelAction * const action;
30         const char * position;
31         void *location;
32         action_type type;
33
34         func_inst_list_mt collisions;
35         func_inst_list_mt predecessors;
36         func_inst_list_mt successors;
37 };