A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
model-node-creator.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
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
5  * published by the Free Software Foundation;
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
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
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  * Authors: Faker Moatamri <faker.moatamri@sophia.inria.fr>
17  * Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  */
19 
20 #include "attribute-iterator.h"
21 #include <gtk/gtk.h>
22 
23 namespace ns3
24 {
25 
26 enum
27 {
29 };
30 
31 struct ModelNode
32 {
33  enum
34  {
35  // store object + attribute name
37  // store object + attribute name
39  // store object + attribute name
41  // store index + value (object)
43  // store object
45  } type;
46  std::string name;
48  uint32_t index;
49 };
55 {
56 public:
57  ModelCreator ();
58 
59  void Build (GtkTreeStore *treestore);
60 private:
61  virtual void DoVisitAttribute (Ptr<Object> object, std::string name);
62  virtual void DoStartVisitObject (Ptr<Object> object);
63  virtual void DoEndVisitObject (void);
64  virtual void DoStartVisitPointerAttribute (Ptr<Object> object, std::string name, Ptr<Object> value);
65  virtual void DoEndVisitPointerAttribute (void);
66  virtual void DoStartVisitArrayAttribute (Ptr<Object> object, std::string name,
67  const ObjectPtrContainerValue &vector);
68  virtual void DoEndVisitArrayAttribute (void);
69  virtual void DoStartVisitArrayItem (const ObjectPtrContainerValue &vector,
70  uint32_t index, Ptr<Object> item);
71  virtual void DoEndVisitArrayItem (void);
72  void Add (ModelNode *node);
73  void Remove (void);
74 
75  GtkTreeStore *m_treestore;
76  std::vector<GtkTreeIter *> m_iters;
77 };
78 }
virtual void DoStartVisitArrayAttribute(Ptr< Object > object, std::string name, const ObjectPtrContainerValue &vector)
GtkTreeStore * m_treestore
enum ns3::ModelNode::@1 type
virtual void DoEndVisitPointerAttribute(void)
void Build(GtkTreeStore *treestore)
void Add(ModelNode *node)
virtual void DoStartVisitArrayItem(const ObjectPtrContainerValue &vector, uint32_t index, Ptr< Object > item)
virtual void DoEndVisitObject(void)
virtual void DoEndVisitArrayItem(void)
Ptr< Object > object
This class is used internally by ConfigStore and GtkConfigStore.
contain a set of ns3::Object pointers.
virtual void DoStartVisitPointerAttribute(Ptr< Object > object, std::string name, Ptr< Object > value)
virtual void DoStartVisitObject(Ptr< Object > object)
virtual void DoVisitAttribute(Ptr< Object > object, std::string name)
std::vector< GtkTreeIter * > m_iters
virtual void DoEndVisitArrayAttribute(void)