toward updating predicate trees every time a function exits
[c11tester.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 "mymemory.h"
9 #include "modeltypes.h"
10 #include "classlist.h"
11
12 class ClockVector {
13 public:
14         ClockVector(ClockVector *parent = NULL, const ModelAction *act = NULL);
15         ~ClockVector();
16         bool merge(const ClockVector *cv);
17         bool synchronized_since(const ModelAction *act) const;
18
19         void print() const;
20         modelclock_t getClock(thread_id_t thread);
21
22         SNAPSHOTALLOC
23 private:
24         /** @brief Holds the actual clock data, as an array. */
25         modelclock_t *clock;
26
27         /** @brief The number of threads recorded in clock (i.e., its length).  */
28         int num_threads;
29 };
30
31 #endif  /* __CLOCKVECTOR_H__ */