equal
deleted
inserted
replaced
|
1 #ifndef ATTRIBUTE_ITERATOR_H |
|
2 #define ATTRIBUTE_ITERATOR_H |
|
3 |
|
4 #include "ns3/ptr.h" |
|
5 #include "ns3/object.h" |
|
6 #include <vector> |
|
7 |
|
8 namespace ns3 { |
|
9 |
|
10 class AttributeIterator |
|
11 { |
|
12 public: |
|
13 AttributeIterator (); |
|
14 virtual ~AttributeIterator (); |
|
15 |
|
16 void Iterate (void); |
|
17 private: |
|
18 virtual void DoVisit (Ptr<Object> object, std::string name, std::string path) = 0; |
|
19 virtual void DoPush (std::string name, std::string path) = 0; |
|
20 virtual void DoPop (void) = 0; |
|
21 |
|
22 void DoIterate (Ptr<Object> object); |
|
23 bool IsExamined (Ptr<const Object> object); |
|
24 std::string GetCurrentPath (std::string attr) const; |
|
25 void Push (std::string name); |
|
26 void Pop (void); |
|
27 void Visit (Ptr<Object> object, std::string name); |
|
28 |
|
29 |
|
30 std::vector<Ptr<Object> > m_examined; |
|
31 std::vector<std::string> m_currentPath; |
|
32 }; |
|
33 |
|
34 class TextFileAttributeIterator : public AttributeIterator |
|
35 { |
|
36 public: |
|
37 TextFileAttributeIterator (std::ostream &os); |
|
38 void Save (void); |
|
39 private: |
|
40 virtual void DoVisit (Ptr<Object> object, std::string name, std::string path); |
|
41 virtual void DoPush (std::string name, std::string path); |
|
42 virtual void DoPop (void); |
|
43 std::ostream &m_os; |
|
44 }; |
|
45 |
|
46 |
|
47 } // namespace ns3 |
|
48 |
|
49 #endif /* ATTRIBUTE_ITERATOR_H */ |