A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
model-node-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
* Authors: Faker Moatamri <faker.moatamri@sophia.inria.fr>
16
* Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
17
*/
18
19
#include "
attribute-iterator.h
"
20
21
#include <gtk/gtk.h>
22
23
namespace
ns3
24
{
25
26
enum
27
{
28
COL_NODE
= 0,
29
COL_LAST
30
};
31
36
struct
ModelNode
37
{
41
enum
42
{
43
// store object + attribute name
44
NODE_ATTRIBUTE
,
45
// store object + attribute name
46
NODE_POINTER
,
47
// store object + attribute name
48
NODE_VECTOR
,
49
// store index + value (object)
50
NODE_VECTOR_ITEM
,
51
// store object
52
NODE_OBJECT
53
}
type
;
54
55
std::string
name
;
56
Ptr<Object>
object
;
57
uint32_t
index
;
58
};
59
65
class
ModelCreator
:
public
AttributeIterator
66
{
67
public
:
68
ModelCreator
();
69
74
void
Build
(GtkTreeStore* treestore);
75
76
private
:
77
void
DoVisitAttribute
(
Ptr<Object>
object
, std::string name)
override
;
78
void
DoStartVisitObject
(
Ptr<Object>
object
)
override
;
79
void
DoEndVisitObject
()
override
;
80
void
DoStartVisitPointerAttribute
(
Ptr<Object>
object
,
81
std::string name,
82
Ptr<Object>
value)
override
;
83
void
DoEndVisitPointerAttribute
()
override
;
84
void
DoStartVisitArrayAttribute
(
Ptr<Object>
object
,
85
std::string name,
86
const
ObjectPtrContainerValue
& vector)
override
;
87
void
DoEndVisitArrayAttribute
()
override
;
88
void
DoStartVisitArrayItem
(
const
ObjectPtrContainerValue
& vector,
89
uint32_t index,
90
Ptr<Object>
item)
override
;
91
void
DoEndVisitArrayItem
()
override
;
96
void
Add
(
ModelNode
* node);
98
void
Remove
();
99
100
GtkTreeStore*
m_treestore
;
101
std::vector<GtkTreeIter*>
m_iters
;
102
};
103
}
// namespace ns3
attribute-iterator.h
ns3::AttributeIterator
Iterator to iterate on the values of attributes of an ns3::Object.
Definition:
attribute-iterator.h:37
ns3::ModelCreator
ModelCreator class.
Definition:
model-node-creator.h:66
ns3::ModelCreator::DoEndVisitArrayAttribute
void DoEndVisitArrayAttribute() override
End the visit to the attribute of type ns3::ObjectVectorValue.
Definition:
model-node-creator.cc:113
ns3::ModelCreator::DoEndVisitPointerAttribute
void DoEndVisitPointerAttribute() override
End the visit to the attribute of type ns3::PointerValue.
Definition:
model-node-creator.cc:95
ns3::ModelCreator::m_treestore
GtkTreeStore * m_treestore
attribute tree
Definition:
model-node-creator.h:100
ns3::ModelCreator::ModelCreator
ModelCreator()
Definition:
model-node-creator.cc:24
ns3::ModelCreator::DoStartVisitObject
void DoStartVisitObject(Ptr< Object > object) override
This method is called to start the process of visiting the input object.
Definition:
model-node-creator.cc:70
ns3::ModelCreator::DoStartVisitPointerAttribute
void DoStartVisitPointerAttribute(Ptr< Object > object, std::string name, Ptr< Object > value) override
Visit the attribute of type ns3::PointerValue, with the provided name, found on the object pointed to...
Definition:
model-node-creator.cc:85
ns3::ModelCreator::DoStartVisitArrayItem
void DoStartVisitArrayItem(const ObjectPtrContainerValue &vector, uint32_t index, Ptr< Object > item) override
Start to visit the object found in the input array at the provided index.
Definition:
model-node-creator.cc:119
ns3::ModelCreator::m_iters
std::vector< GtkTreeIter * > m_iters
attribute tree item
Definition:
model-node-creator.h:101
ns3::ModelCreator::Build
void Build(GtkTreeStore *treestore)
Allocate attribute tree.
Definition:
model-node-creator.cc:30
ns3::ModelCreator::DoStartVisitArrayAttribute
void DoStartVisitArrayAttribute(Ptr< Object > object, std::string name, const ObjectPtrContainerValue &vector) override
Visit the attribute of type ns3::ObjectVectorValue, with the provided name, found on the object point...
Definition:
model-node-creator.cc:101
ns3::ModelCreator::Add
void Add(ModelNode *node)
Add item to attribute tree.
Definition:
model-node-creator.cc:41
ns3::ModelCreator::Remove
void Remove()
Remove current tree item.
Definition:
model-node-creator.cc:51
ns3::ModelCreator::DoEndVisitArrayItem
void DoEndVisitArrayItem() override
End the visit to the array item.
Definition:
model-node-creator.cc:135
ns3::ModelCreator::DoEndVisitObject
void DoEndVisitObject() override
This method is called to end the process of visiting the currently visited object.
Definition:
model-node-creator.cc:79
ns3::ModelCreator::DoVisitAttribute
void DoVisitAttribute(Ptr< Object > object, std::string name) override
This method visits and performs a config-store action (such as saving to a text file) on the attribut...
Definition:
model-node-creator.cc:59
ns3::ObjectPtrContainerValue
Container for a set of ns3::Object pointers.
Definition:
object-ptr-container.h:46
ns3::Ptr< Object >
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::COL_LAST
@ COL_LAST
Definition:
model-node-creator.h:29
ns3::COL_NODE
@ COL_NODE
Definition:
model-node-creator.h:28
ns3::ModelNode
A class used in the implementation of the GtkConfigStore.
Definition:
model-node-creator.h:37
ns3::ModelNode::object
Ptr< Object > object
the object
Definition:
model-node-creator.h:56
ns3::ModelNode::index
uint32_t index
index
Definition:
model-node-creator.h:57
ns3::ModelNode::NODE_VECTOR
@ NODE_VECTOR
Definition:
model-node-creator.h:48
ns3::ModelNode::NODE_OBJECT
@ NODE_OBJECT
Definition:
model-node-creator.h:52
ns3::ModelNode::NODE_POINTER
@ NODE_POINTER
Definition:
model-node-creator.h:46
ns3::ModelNode::NODE_VECTOR_ITEM
@ NODE_VECTOR_ITEM
Definition:
model-node-creator.h:50
ns3::ModelNode::NODE_ATTRIBUTE
@ NODE_ATTRIBUTE
Definition:
model-node-creator.h:44
ns3::ModelNode::name
std::string name
node name
Definition:
model-node-creator.h:55
ns3::ModelNode::type
enum ns3::ModelNode::@3 type
node type structure
src
config-store
model
model-node-creator.h
Generated on Sun Mar 3 2024 17:10:55 for ns-3 by
1.9.1