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