ROSE  0.11.109.0
PathQueue.h
1 #ifndef ROSE_BinaryAnalysis_ModelChecker_PathQueue_H
2 #define ROSE_BinaryAnalysis_ModelChecker_PathQueue_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_MODEL_CHECKER
5 
6 #include <Rose/BinaryAnalysis/ModelChecker/Types.h>
7 
8 namespace Rose {
9 namespace BinaryAnalysis {
10 namespace ModelChecker {
11 
16 class PathQueue final {
17 public:
19  class Visitor {
20  public:
21  virtual ~Visitor() {}
22 
27  virtual bool operator()(const PathPtr&) = 0;
28  };
29 
30 private:
31  mutable SAWYER_THREAD_TRAITS::Mutex mutex_; // protects all following data members
32  PathPrioritizerPtr prioritizer_;
33  std::vector<PathPtr> paths_;
34 
35 public:
36  PathQueue() = delete;
37 
41  PathQueue(const PathPrioritizerPtr&);
42  ~PathQueue();
43 
44 public:
56  PathPrioritizerPtr prioritizer() const;
57  void prioritizer(const PathPrioritizerPtr&);
65  size_t size() const;
66 
72  bool isEmpty() const;
73 
79  void reset();
80 
86  void insert(const PathPtr&);
87 
95  PathPtr takeNext();
96 
103  void traverse(Visitor&) const;
104 };
105 
106 } // namespace
107 } // namespace
108 } // namespace
109 
110 #endif
111 #endif
Main namespace for the ROSE library.