A Discrete-Event Network Simulator
API
model-typeid-creator.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License version 2 as
4  * published by the Free Software Foundation;
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public License
12  * along with this program; if not, write to the Free Software
13  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14  *
15  * Author: Moatamri Faker <faker.moatamri@sophia.inria.fr>
16  */
17 
19 
20 #include "ns3/type-id.h"
21 
22 #include <gtk/gtk.h>
23 #include <vector>
24 
25 namespace ns3
26 {
27 
28 enum
29 {
32 };
33 
39 {
43  enum
44  {
45  // store TypeId + attribute name +defaultValue and index
47  // store TypeId
49  } type;
50 
52  std::string name;
54  std::string defaultValue;
58  uint32_t index;
59 };
60 
66 {
67  public:
75  void Build(GtkTreeStore* treestore);
76 
77  private:
85  void VisitAttribute(TypeId tid,
86  std::string name,
87  std::string defaultValue,
88  uint32_t index) override;
93  void StartVisitTypeId(std::string name) override;
97  void EndVisitTypeId() override;
102  void Add(ModelTypeid* node);
106  void Remove();
108  GtkTreeStore* m_treestore;
110  std::vector<GtkTreeIter*> m_iters;
111 };
112 } // namespace ns3
Iterator to iterate on the default values of attributes of an ns3::Object.
ModelTypeIdCreator class.
void EndVisitTypeId() override
Remove the last gtk tree iterator.
void StartVisitTypeId(std::string name) override
Add a node for the new TypeId object.
std::vector< GtkTreeIter * > m_iters
This contains a vector of iterators used to build the TreeStore.
void VisitAttribute(TypeId tid, std::string name, std::string defaultValue, uint32_t index) override
This method will add a ModelTypeid to the GtkTreeIterator.
void Build(GtkTreeStore *treestore)
This method will iterate on typeIds having default attributes and create a model for them,...
void Add(ModelTypeid *node)
Adds a treestore iterator to m_treestore model.
GtkTreeStore * m_treestore
this is the TreeStore model corresponding to the view
void Remove()
Removes the last GtkTreeIterator from m_iters.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
A class used in the implementation of the GtkConfigStore.
uint32_t index
stores the index of the attribute in list of attributes for a given TypeId
TypeId tid
The TypeId object and if it is an attribute, it's the TypeId object of the attribute.
std::string defaultValue
TypeId default value.
enum ns3::ModelTypeid::@5 type
Whether the node represents an attribute or TypeId.
std::string name
TypeId name.