author | Nicola Baldo <nbaldo@cttc.es> |
Fri, 11 May 2012 16:42:40 +0200 | |
changeset 8749 | 4462ac63d4cf |
parent 8254 | 221fd655f652 |
child 12878 | ea2f69f2d08c |
permissions | -rw-r--r-- |
5992
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
2 |
/* |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
3 |
* This program is free software; you can redistribute it and/or modify |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
4 |
* it under the terms of the GNU General Public License version 2 as |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
5 |
* published by the Free Software Foundation; |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
6 |
* |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
7 |
* This program is distributed in the hope that it will be useful, |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
8 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
9 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
10 |
* GNU General Public License for more details. |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
11 |
* |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
12 |
* You should have received a copy of the GNU General Public License |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
13 |
* along with this program; if not, write to the Free Software |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
14 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
15 |
* |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
16 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
17 |
*/ |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
4273
diff
changeset
|
18 |
|
3063
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
#ifndef ATTRIBUTE_ITERATOR_H |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
#define ATTRIBUTE_ITERATOR_H |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
|
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
#include "ns3/ptr.h" |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
#include "ns3/object.h" |
8749
4462ac63d4cf
merge of the code from the LENA project into ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8254
diff
changeset
|
24 |
#include "ns3/object-ptr-container.h" |
3063
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#include <vector> |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
namespace ns3 { |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
|
7234
0572de06ae29
Make some modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6941
diff
changeset
|
29 |
/** |
0572de06ae29
Make some modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6941
diff
changeset
|
30 |
* \ingroup configstore |
0572de06ae29
Make some modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6941
diff
changeset
|
31 |
* |
0572de06ae29
Make some modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6941
diff
changeset
|
32 |
* This class is used internally by ConfigStore and GtkConfigStore. |
0572de06ae29
Make some modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6941
diff
changeset
|
33 |
*/ |
3063
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
class AttributeIterator |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
{ |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
36 |
public: |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
AttributeIterator (); |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
38 |
virtual ~AttributeIterator (); |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
|
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
void Iterate (void); |
3069
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
41 |
protected: |
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
42 |
std::string GetCurrentPath (void) const; |
3063
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
private: |
3069
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
44 |
virtual void DoVisitAttribute (Ptr<Object> object, std::string name) = 0; |
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
45 |
virtual void DoStartVisitObject (Ptr<Object> object); |
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
46 |
virtual void DoEndVisitObject (void); |
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
47 |
virtual void DoStartVisitPointerAttribute (Ptr<Object> object, std::string name, Ptr<Object> value); |
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
48 |
virtual void DoEndVisitPointerAttribute (void); |
8749
4462ac63d4cf
merge of the code from the LENA project into ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8254
diff
changeset
|
49 |
virtual void DoStartVisitArrayAttribute (Ptr<Object> object, std::string name, const ObjectPtrContainerValue &vector); |
3069
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
50 |
virtual void DoEndVisitArrayAttribute (void); |
8749
4462ac63d4cf
merge of the code from the LENA project into ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8254
diff
changeset
|
51 |
virtual void DoStartVisitArrayItem (const ObjectPtrContainerValue &vector, uint32_t index, Ptr<Object> item); |
3069
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
52 |
virtual void DoEndVisitArrayItem (void); |
3063
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
53 |
|
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
54 |
void DoIterate (Ptr<Object> object); |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
55 |
bool IsExamined (Ptr<const Object> object); |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
56 |
std::string GetCurrentPath (std::string attr) const; |
3069
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
57 |
|
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
58 |
void VisitAttribute (Ptr<Object> object, std::string name); |
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
59 |
void StartVisitObject (Ptr<Object> object); |
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
60 |
void EndVisitObject (void); |
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
61 |
void StartVisitPointerAttribute (Ptr<Object> object, std::string name, Ptr<Object> value); |
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
62 |
void EndVisitPointerAttribute (void); |
8749
4462ac63d4cf
merge of the code from the LENA project into ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8254
diff
changeset
|
63 |
void StartVisitArrayAttribute (Ptr<Object> object, std::string name, const ObjectPtrContainerValue &vector); |
3069
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
64 |
void EndVisitArrayAttribute (void); |
8749
4462ac63d4cf
merge of the code from the LENA project into ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8254
diff
changeset
|
65 |
void StartVisitArrayItem (const ObjectPtrContainerValue &vector, uint32_t index, Ptr<Object> item); |
3069
4730d8d6d63c
make the iteration code more flexible. add tooltips to gtk config store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3063
diff
changeset
|
66 |
void EndVisitArrayItem (void); |
8749
4462ac63d4cf
merge of the code from the LENA project into ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8254
diff
changeset
|
67 |
|
3063
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
68 |
|
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
69 |
std::vector<Ptr<Object> > m_examined; |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
70 |
std::vector<std::string> m_currentPath; |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
71 |
}; |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
72 |
|
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
73 |
} // namespace ns3 |
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
74 |
|
a1c532e3bf18
a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
75 |
#endif /* ATTRIBUTE_ITERATOR_H */ |