A Discrete-Event Network Simulator
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#ifndef MODEL_NODE_CREATOR_H
9#define MODEL_NODE_CREATOR_H
10
11#include "attribute-iterator.h"
12
13#include <gtk/gtk.h>
14
15namespace ns3
16{
17
18enum
19{
22};
23
24/**
25 * @ingroup configstore
26 * @brief A class used in the implementation of the GtkConfigStore
27 */
29{
30 /**
31 * @brief node type structure
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; ///< node type
46
47 std::string name; ///< node name
48 Ptr<Object> object; ///< the object
49 uint32_t index; ///< index
50};
51
52/**
53 * @ingroup configstore
54 * @brief ModelCreator class
55 *
56 */
58{
59 public:
61
62 /**
63 * Allocate attribute tree
64 * @param treestore GtkTreeStore *
65 */
66 void Build(GtkTreeStore* treestore);
67
68 private:
69 void DoVisitAttribute(Ptr<Object> object, std::string name) override;
70 void DoStartVisitObject(Ptr<Object> object) override;
71 void DoEndVisitObject() override;
73 std::string name,
74 Ptr<Object> value) override;
75 void DoEndVisitPointerAttribute() override;
77 std::string name,
78 const ObjectPtrContainerValue& vector) override;
79 void DoEndVisitArrayAttribute() override;
81 uint32_t index,
82 Ptr<Object> item) override;
83 void DoEndVisitArrayItem() override;
84 /**
85 * Add item to attribute tree
86 * @param node The model node
87 */
88 void Add(ModelNode* node);
89 /// Remove current tree item
90 void Remove();
91
92 GtkTreeStore* m_treestore; ///< attribute tree
93 std::vector<GtkTreeIter*> m_iters; ///< attribute tree item
94};
95} // namespace ns3
96
97#endif // MODEL_NODE_CREATOR_H
void DoEndVisitArrayAttribute() override
End the visit to the attribute of type ns3::ObjectVectorValue.
void DoEndVisitPointerAttribute() override
End the visit to the attribute of type ns3::PointerValue.
GtkTreeStore * m_treestore
attribute tree
void DoStartVisitObject(Ptr< Object > object) override
This method is called to start the process of visiting the input object.
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...
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.
std::vector< GtkTreeIter * > m_iters
attribute tree item
void Build(GtkTreeStore *treestore)
Allocate attribute tree.
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...
void Add(ModelNode *node)
Add item to attribute tree.
void Remove()
Remove current tree item.
void DoEndVisitArrayItem() override
End the visit to the array item.
void DoEndVisitObject() override
This method is called to end the process of visiting the currently visited object.
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...
Container for a set of ns3::Object pointers.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
STL class.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
A class used in the implementation of the GtkConfigStore.
Ptr< Object > object
the object
uint32_t index
index
std::string name
node name
enum ns3::ModelNode::@353265371332124272263363322234150343123022342154 type
node type structure