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
9
10#include <gtk/gtk.h>
11
12namespace ns3
13{
14
15enum
16{
19};
20
21/**
22 * \ingroup configstore
23 * \brief A class used in the implementation of the GtkConfigStore
24 */
26{
27 /**
28 * \brief node type structure
29 */
30 enum
31 {
32 // store object + attribute name
34 // store object + attribute name
36 // store object + attribute name
38 // store index + value (object)
40 // store 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 */
55{
56 public:
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;
70 std::string name,
71 Ptr<Object> value) override;
72 void DoEndVisitPointerAttribute() override;
74 std::string name,
75 const ObjectPtrContainerValue& vector) override;
76 void DoEndVisitArrayAttribute() override;
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
Iterator to iterate on the values of attributes of an ns3::Object.
ModelCreator class.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
A class used in the implementation of the GtkConfigStore.
enum ns3::ModelNode::@1 type
node type structure
Ptr< Object > object
the object
uint32_t index
index
std::string name
node name