nodestack: add get_read_from_size()
[model-checker.git] / clockvector.h
1 /** @file clockvector.h
2  *  @brief Implements a clock vector.
3  */
4
5 #ifndef __CLOCKVECTOR_H__
6 #define __CLOCKVECTOR_H__
7
8 #include "threads.h"
9 #include "mymemory.h"
10
11 typedef unsigned int modelclock_t;
12 /* Forward declaration */
13 class ModelAction;
14
15 class ClockVector {
16 public:
17         ClockVector(ClockVector *parent = NULL, ModelAction *act = NULL);
18         ~ClockVector();
19         void merge(const ClockVector *cv);
20         bool synchronized_since(const ModelAction *act) const;
21         bool has_synchronized_with(const ClockVector *cv) const;
22
23         void print() const;
24         modelclock_t getClock(thread_id_t thread);
25
26         MEMALLOC
27 private:
28         /** @brief Holds the actual clock data, as an array. */
29         modelclock_t *clock;
30
31         /** @brief The number of threads recorded in clock (i.e., its length).  */
32         int num_threads;
33 };
34
35 #endif /* __CLOCKVECTOR_H__ */