A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
model-node-creator.h
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
{
28
COL_NODE = 0, COL_LAST
29
};
30
31
struct
ModelNode
32
{
33
enum
34
{
35
// store object + attribute name
36
NODE_ATTRIBUTE,
37
// store object + attribute name
38
NODE_POINTER,
39
// store object + attribute name
40
NODE_VECTOR,
41
// store index + value (object)
42
NODE_VECTOR_ITEM,
43
// store object
44
NODE_OBJECT
45
} type;
46
std::string name;
47
Ptr<Object>
object;
48
uint32_t index;
49
};
54
class
ModelCreator
:
public
AttributeIterator
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
}
ns3::Ptr< Object >
ns3::ModelCreator
Definition:
model-node-creator.h:54
ns3::ModelNode
Definition:
model-node-creator.h:31
ns3::AttributeIterator
Definition:
attribute-iterator.h:34
ns3::ObjectPtrContainerValue
contain a set of ns3::Object pointers.
Definition:
object-ptr-container.h:38
src
config-store
model
model-node-creator.h
Generated on Sun Mar 16 2014 11:25:01 for ns-3 by
1.8.6