ROSE  0.11.50.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_BINARY_ANALYSIS
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
PathPtr takeNext()
Take the next path from this queue.
bool isEmpty() const
Test emptiness.
Main namespace for the ROSE library.
size_t size() const
Property: Size of queue.
void traverse(Visitor &) const
Visit each path in the queue.
List of path endpoints in an execution tree.
Definition: PathQueue.h:16
void insert(const PathPtr &)
Insert a path.
PathPrioritizerPtr prioritizer() const
Property: Prioritization predicate.
virtual bool operator()(const PathPtr &)=0
Callback.