A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
model-node-creator.h
Go to the documentation of this file.
1
/*
2
* SPDX-License-Identifier: GPL-2.0-only
3
*
4
* Authors: Faker Moatamri <faker.moatamri@sophia.inria.fr>
5
* Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
6
*/
7
8
#include "
attribute-iterator.h
"
9
10
#include <gtk/gtk.h>
11
12
namespace
ns3
13
{
14
15
enum
16
{
17
COL_NODE
= 0,
18
COL_LAST
19
};
20
21
/**
22
* \ingroup configstore
23
* \brief A class used in the implementation of the GtkConfigStore
24
*/
25
struct
ModelNode
26
{
27
/**
28
* \brief node type structure
29
*/
30
enum
31
{
32
// store object + attribute name
33
NODE_ATTRIBUTE
,
34
// store object + attribute name
35
NODE_POINTER
,
36
// store object + attribute name
37
NODE_VECTOR
,
38
// store index + value (object)
39
NODE_VECTOR_ITEM
,
40
// store object
41
NODE_OBJECT
42
}
type
;
///< node type
43
44
std::string
name
;
///< node name
45
Ptr<Object>
object
;
///< the object
46
uint32_t
index
;
///< index
47
};
48
49
/**
50
* \ingroup configstore
51
* \brief ModelCreator class
52
*
53
*/
54
class
ModelCreator
:
public
AttributeIterator
55
{
56
public
:
57
ModelCreator
();
58
59
/**
60
* Allocate attribute tree
61
* \param treestore GtkTreeStore *
62
*/
63
void
Build
(GtkTreeStore* treestore);
64
65
private
:
66
void
DoVisitAttribute
(
Ptr<Object>
object
, std::string name)
override
;
67
void
DoStartVisitObject
(
Ptr<Object>
object
)
override
;
68
void
DoEndVisitObject
()
override
;
69
void
DoStartVisitPointerAttribute
(
Ptr<Object>
object
,
70
std::string name,
71
Ptr<Object>
value)
override
;
72
void
DoEndVisitPointerAttribute
()
override
;
73
void
DoStartVisitArrayAttribute
(
Ptr<Object>
object
,
74
std::string name,
75
const
ObjectPtrContainerValue
& vector)
override
;
76
void
DoEndVisitArrayAttribute
()
override
;
77
void
DoStartVisitArrayItem
(
const
ObjectPtrContainerValue
& vector,
78
uint32_t
index,
79
Ptr<Object>
item)
override
;
80
void
DoEndVisitArrayItem
()
override
;
81
/**
82
* Add item to attribute tree
83
* \param node The model node
84
*/
85
void
Add
(
ModelNode
* node);
86
/// Remove current tree item
87
void
Remove
();
88
89
GtkTreeStore*
m_treestore
;
///< attribute tree
90
std::vector<GtkTreeIter*>
m_iters
;
///< attribute tree item
91
};
92
}
// namespace ns3
attribute-iterator.h
ns3::AttributeIterator
Iterator to iterate on the values of attributes of an ns3::Object.
Definition
attribute-iterator.h:26
ns3::ModelCreator
ModelCreator class.
Definition
model-node-creator.h:55
ns3::ModelCreator::DoEndVisitArrayAttribute
void DoEndVisitArrayAttribute() override
End the visit to the attribute of type ns3::ObjectVectorValue.
Definition
model-node-creator.cc:102
ns3::ModelCreator::DoEndVisitPointerAttribute
void DoEndVisitPointerAttribute() override
End the visit to the attribute of type ns3::PointerValue.
Definition
model-node-creator.cc:84
ns3::ModelCreator::m_treestore
GtkTreeStore * m_treestore
attribute tree
Definition
model-node-creator.h:89
ns3::ModelCreator::ModelCreator
ModelCreator()
Definition
model-node-creator.cc:13
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:59
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:74
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:108
ns3::ModelCreator::m_iters
std::vector< GtkTreeIter * > m_iters
attribute tree item
Definition
model-node-creator.h:90
ns3::ModelCreator::Build
void Build(GtkTreeStore *treestore)
Allocate attribute tree.
Definition
model-node-creator.cc:19
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:90
ns3::ModelCreator::Add
void Add(ModelNode *node)
Add item to attribute tree.
Definition
model-node-creator.cc:30
ns3::ModelCreator::Remove
void Remove()
Remove current tree item.
Definition
model-node-creator.cc:40
ns3::ModelCreator::DoEndVisitArrayItem
void DoEndVisitArrayItem() override
End the visit to the array item.
Definition
model-node-creator.cc:124
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:68
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:48
ns3::ObjectPtrContainerValue
Container for a set of ns3::Object pointers.
Definition
object-ptr-container.h:46
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::COL_LAST
@ COL_LAST
Definition
model-node-creator.h:18
ns3::COL_NODE
@ COL_NODE
Definition
model-node-creator.h:17
ns3::ModelNode
A class used in the implementation of the GtkConfigStore.
Definition
model-node-creator.h:26
ns3::ModelNode::NODE_VECTOR
@ NODE_VECTOR
Definition
model-node-creator.h:37
ns3::ModelNode::NODE_OBJECT
@ NODE_OBJECT
Definition
model-node-creator.h:41
ns3::ModelNode::NODE_POINTER
@ NODE_POINTER
Definition
model-node-creator.h:35
ns3::ModelNode::NODE_VECTOR_ITEM
@ NODE_VECTOR_ITEM
Definition
model-node-creator.h:39
ns3::ModelNode::NODE_ATTRIBUTE
@ NODE_ATTRIBUTE
Definition
model-node-creator.h:33
ns3::ModelNode::type
enum ns3::ModelNode::@1 type
node type structure
ns3::ModelNode::object
Ptr< Object > object
the object
Definition
model-node-creator.h:45
ns3::ModelNode::index
uint32_t index
index
Definition
model-node-creator.h:46
ns3::ModelNode::name
std::string name
node name
Definition
model-node-creator.h:44
src
config-store
model
model-node-creator.h
Generated on Fri Nov 8 2024 13:58:59 for ns-3 by
1.11.0