ROSE  0.11.52.0
baseCFGIterator.h
1 #include <featureTests.h>
2 #ifdef ROSE_ENABLE_SOURCE_ANALYSIS
3 
4 #ifndef BASE_CFG_ITERATOR
5 #define BASE_CFG_ITERATOR
6 
7 #include "virtualCFG.h"
8 #include "DataflowCFG.h"
9 
10 #include <list>
11 #include <set>
12 
13 namespace BaseCFG{
14 
15 class iterator : public printable
16 {
17  //protected:
18  public:
19 
20  std::list<DataflowNode> remainingNodes;
21  //map<DataflowNode, bool> visited;
22  std::set<DataflowNode> visited;
23 
24  public:
25  virtual void operator ++ (int)=0;
26 
27  virtual bool eq(const iterator& other_it) const=0;
28 
29  virtual bool operator==(const iterator& other_it) const=0;
30 
31  virtual bool operator!=(const iterator& it) const=0;
32 
33  virtual DataflowNode& operator * ()=0;
34 
35  //virtual static iterator begin(DataflowNode n)=0;
36 
37  //virtual static iterator end()=0;
38 
39  // Contains the state of an iterator, allowing iterators to be
40  // checkpointed and restarted.
41  class checkpoint : public printable
42  {
43  // string str(string indent="");
44  };
45 
46  // Returns a checkpoint of this iterator's progress.
47  virtual checkpoint* getChkpt()=0;
48 
49  // Loads this iterator's state from the given checkpoint.
50  virtual void restartFromChkpt(checkpoint& chkpt)=0;
51 
52  // string str(string indent="");
53 };
54 
55 class back_iterator : public virtual iterator
56 {
57 };
58 
59 class dataflow : public virtual iterator
60 {
61  virtual void add(const DataflowNode &next)=0;
62 };
63 
64 class back_dataflow : public back_iterator, public dataflow
65 {
66 };
67 }
68 #endif
69 #endif