nodestack: add print_may_read_from()
[model-checker.git] / action.h
index 0200111df387e586c4346c1858c0f139a6c6f4ce..f9c6d417084e62d39956ad1b1775c236b7bc48b8 100644 (file)
--- a/action.h
+++ b/action.h
@@ -21,7 +21,8 @@ typedef enum action_type {
        THREAD_JOIN,
        ATOMIC_READ,
        ATOMIC_WRITE,
-       ATOMIC_RMW
+       ATOMIC_RMW,
+       ATOMIC_INIT
 } action_type_t;
 
 /* Forward declaration */
@@ -51,6 +52,7 @@ public:
        bool is_read() const;
        bool is_write() const;
        bool is_rmw() const;
+       bool is_initialization() const;
        bool is_acquire() const;
        bool is_release() const;
        bool is_seqcst() const;
@@ -58,11 +60,11 @@ public:
        bool same_thread(const ModelAction *act) const;
        bool is_synchronizing(const ModelAction *act) const;
 
-       void create_cv(ModelAction *parent = NULL);
+       void create_cv(const ModelAction *parent = NULL);
        ClockVector * get_cv() const { return cv; }
-       void read_from(ModelAction *act);
+       void read_from(const ModelAction *act);
 
-       bool happens_before(ModelAction *act);
+       bool happens_before(const ModelAction *act) const;
 
        inline bool operator <(const ModelAction& act) const {
                return get_seq_number() < act.get_seq_number();
@@ -101,6 +103,6 @@ private:
        ClockVector *cv;
 };
 
-typedef std::list<class ModelAction *> action_list_t;
+typedef std::list<ModelAction *> action_list_t;
 
 #endif /* __ACTION_H__ */