LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License version 2 as | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
11 * | 11 * |
12 * You should have received a copy of the GNU General Public License | 12 * You should have received a copy of the GNU General Public License |
13 * along with this program; if not, write to the Free Software | 13 * along with this program; if not, write to the Free Software |
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 *· | 15 *· |
16 * Author: Moatamri Faker <faker.moatamri@sophia.inria.fr> | 16 * Author: Moatamri Faker <faker.moatamri@sophia.inria.fr> |
17 */ | 17 */ |
18 | 18 |
19 #include "attribute-default-iterator.h" | 19 #include "attribute-default-iterator.h" |
20 #include "ns3/type-id.h" | 20 #include "ns3/type-id.h" |
21 #include <gtk/gtk.h> | 21 #include <gtk/gtk.h> |
22 #include <vector> | 22 #include <vector> |
23 | 23 |
24 namespace ns3 { | 24 namespace ns3 { |
25 | 25 |
26 enum | 26 /** |
| 27 * \enum typeColumn |
| 28 * \brief column enumeration |
| 29 * |
| 30 */ |
| 31 enum typeColumn |
27 { | 32 { |
28 COL_TYPEID = 0, COL_LASTID | 33 COL_TYPEID = 0, COL_LASTID |
29 }; | 34 }; |
30 | 35 |
31 /** | 36 /** |
32 * \ingroup configstore | 37 * \ingroup configstore |
33 * \brief ModelTypeId class | 38 * \brief A class used in the implementation of the GtkConfigStore |
34 */ | 39 */ |
35 struct ModelTypeid | 40 struct ModelTypeid |
36 { | 41 { |
37 /** | 42 /** |
38 * \enum node type | 43 * \enum nodeType |
39 * \brief node type | 44 * \brief Whether the node represents an attribute or TypeId |
40 */ | 45 */ |
41 enum | 46 enum nodeType |
42 { | 47 { |
43 // store TypeId + attribute name +defaultValue and index | 48 /// store TypeId + attribute name +defaultValue and index |
44 NODE_ATTRIBUTE, | 49 NODE_ATTRIBUTE, |
45 // store TypeId | 50 /// store TypeId |
46 NODE_TYPEID | 51 NODE_TYPEID |
47 } type; ///< node type | 52 } type; ///< node type |
48 /// TypeId name | 53 /// TypeId name |
49 std::string name; | 54 std::string name; |
50 /// TypeId default value | 55 /// TypeId default value |
51 std::string defaultValue; | 56 std::string defaultValue; |
52 /// The TypeId object and if it is an attribute, it's the TypeId object of the
attribute | 57 /// The TypeId object and if it is an attribute, it's the TypeId object of the
attribute |
53 TypeId tid; | 58 TypeId tid; |
54 /// stores the index of the attribute in list of attributes for a given TypeId | 59 /// stores the index of the attribute in list of attributes for a given TypeId |
55 uint32_t index; | 60 uint32_t index; |
56 }; | 61 }; |
57 | 62 |
58 /** | 63 /** |
59 * \ingroup configstore | 64 * \ingroup configstore |
60 * \brief ModelTypeIdCreator class | 65 * \brief ModelTypeIdCreator class |
61 */ | 66 */ |
62 class ModelTypeidCreator : public AttributeDefaultIterator | 67 class ModelTypeidCreator : public AttributeDefaultIterator |
63 { | 68 { |
64 public: | 69 public: |
65 ModelTypeidCreator (); | 70 ModelTypeidCreator (); |
66 /** | 71 /** |
67 * \brief This method will iterate on typeIds having default attributes and cr
eate a model | 72 * \brief This method will iterate on typeIds having default attributes and cr
eate a model |
68 * for them, this model will be used by the view. | 73 * for them, this model will be used by the view. |
| 74 * \param treestore the GTK tree store |
69 */ | 75 */ |
70 void Build (GtkTreeStore *treestore); | 76 void Build (GtkTreeStore *treestore); |
71 private: | 77 private: |
72 /** | 78 /** |
73 * \brief This method will add a ModelTypeid to the GtkTreeIterator | 79 * \brief This method will add a ModelTypeid to the GtkTreeIterator |
| 80 *· |
| 81 * \param tid the type ID |
| 82 * \param name the attribute name |
| 83 * \param defaultValue the default value |
| 84 * \param index |
74 */ | 85 */ |
75 virtual void VisitAttribute (TypeId tid, std::string name, std::string default
Value, uint32_t index); | 86 virtual void VisitAttribute (TypeId tid, std::string name, std::string default
Value, uint32_t index); |
76 /** | 87 /** |
77 * \brief Add a node for the new TypeId object | 88 * \brief Add a node for the new TypeId object |
| 89 * \param name the attribute name |
78 */ | 90 */ |
79 virtual void StartVisitTypeId (std::string name); | 91 virtual void StartVisitTypeId (std::string name); |
80 /** | 92 /** |
81 * \brief Remove the last gtk tree iterator | 93 * \brief Remove the last gtk tree iterator |
82 */ | 94 */ |
83 virtual void EndVisitTypeId (void); | 95 virtual void EndVisitTypeId (void); |
84 /** | 96 /** |
85 * \brief Adds a treestore iterator to m_treestore model | 97 * \brief Adds a treestore iterator to m_treestore model |
| 98 * \param node the node |
86 */ | 99 */ |
87 void Add (ModelTypeid *node); | 100 void Add (ModelTypeid *node); |
88 /** | 101 /** |
89 * Removes the last GtkTreeIterator from m_iters | 102 * Removes the last GtkTreeIterator from m_iters |
90 */ | 103 */ |
91 void Remove (void); | 104 void Remove (void); |
92 /// this is the TreeStore model corresponding to the view | 105 /// this is the TreeStore model corresponding to the view |
93 GtkTreeStore *m_treestore; | 106 GtkTreeStore *m_treestore; |
94 /// This contains a vector of iterators used to build the TreeStore | 107 /// This contains a vector of iterators used to build the TreeStore |
95 std::vector<GtkTreeIter *> m_iters; | 108 std::vector<GtkTreeIter *> m_iters; |
96 }; | 109 }; |
97 } | 110 } |
LEFT | RIGHT |