12 typedef enum action_type {
21 /* Forward declaration */
25 * The ModelAction class encapsulates an atomic action.
30 ModelAction(action_type_t type, memory_order order, void *loc, int value);
34 thread_id_t get_tid() { return tid; }
35 action_type get_type() { return type; }
36 memory_order get_mo() { return order; }
37 void * get_location() { return location; }
38 int get_seq_number() const { return seq_number; }
40 Node * get_node() { return node; }
41 void set_node(Node *n) { node = n; }
47 bool same_var(ModelAction *act);
48 bool same_thread(ModelAction *act);
49 bool is_dependent(ModelAction *act);
51 void create_cv(ModelAction *parent = NULL);
52 void read_from(ModelAction *act);
54 inline bool operator <(const ModelAction& act) const {
55 return get_seq_number() < act.get_seq_number();
57 inline bool operator >(const ModelAction& act) const {
58 return get_seq_number() > act.get_seq_number();
64 /** Type of action (read, write, thread create, thread yield, thread join) */
67 /** The memory order for this operation. */
70 /** A pointer to the memory location for this action. */
73 /** The thread id that performed this action. */
76 /** The value written. This should probably be something longer. */
83 /** The clock vector stored with this action if this action is a
89 typedef std::list<class ModelAction *> action_list_t;
91 #endif /* __ACTION_H__ */