A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
model-typeid-creator.h
Go to the documentation of this file.
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
* Author: Moatamri Faker <faker.moatamri@sophia.inria.fr>
17
*/
18
19
#include "
attribute-default-iterator.h
"
20
#include "ns3/type-id.h"
21
#include <gtk/gtk.h>
22
#include <vector>
23
24
namespace
ns3
{
25
26
enum
27
{
28
COL_TYPEID
= 0,
COL_LASTID
29
};
30
35
struct
ModelTypeid
36
{
41
enum
42
{
43
// store TypeId + attribute name +defaultValue and index
44
NODE_ATTRIBUTE
,
45
// store TypeId
46
NODE_TYPEID
47
}
type
;
49
std::string
name
;
51
std::string
defaultValue
;
53
TypeId
tid
;
55
uint32_t
index
;
56
};
57
62
class
ModelTypeidCreator
:
public
AttributeDefaultIterator
63
{
64
public
:
65
ModelTypeidCreator
();
72
void
Build
(GtkTreeStore *treestore);
73
private
:
81
virtual
void
VisitAttribute
(
TypeId
tid, std::string name, std::string defaultValue, uint32_t index);
86
virtual
void
StartVisitTypeId
(std::string name);
90
virtual
void
EndVisitTypeId
(
void
);
95
void
Add
(
ModelTypeid
*node);
99
void
Remove
(
void
);
101
GtkTreeStore *
m_treestore
;
103
std::vector<GtkTreeIter *>
m_iters
;
104
};
105
}
attribute-default-iterator.h
ns3::AttributeDefaultIterator
Iterator to iterate on the default values of attributes of an ns3::Object.
Definition:
attribute-default-iterator.h:34
ns3::ModelTypeidCreator
ModelTypeIdCreator class.
Definition:
model-typeid-creator.h:63
ns3::ModelTypeidCreator::Build
void Build(GtkTreeStore *treestore)
This method will iterate on typeIds having default attributes and create a model for them,...
Definition:
model-typeid-creator.cc:28
ns3::ModelTypeidCreator::ModelTypeidCreator
ModelTypeidCreator()
Definition:
model-typeid-creator.cc:23
ns3::ModelTypeidCreator::Add
void Add(ModelTypeid *node)
Adds a treestore iterator to m_treestore model.
Definition:
model-typeid-creator.cc:37
ns3::ModelTypeidCreator::Remove
void Remove(void)
Removes the last GtkTreeIterator from m_iters.
Definition:
model-typeid-creator.cc:47
ns3::ModelTypeidCreator::m_treestore
GtkTreeStore * m_treestore
this is the TreeStore model corresponding to the view
Definition:
model-typeid-creator.h:101
ns3::ModelTypeidCreator::StartVisitTypeId
virtual void StartVisitTypeId(std::string name)
Add a node for the new TypeId object.
Definition:
model-typeid-creator.cc:68
ns3::ModelTypeidCreator::EndVisitTypeId
virtual void EndVisitTypeId(void)
Remove the last gtk tree iterator.
Definition:
model-typeid-creator.cc:77
ns3::ModelTypeidCreator::VisitAttribute
virtual void VisitAttribute(TypeId tid, std::string name, std::string defaultValue, uint32_t index)
This method will add a ModelTypeid to the GtkTreeIterator.
Definition:
model-typeid-creator.cc:55
ns3::ModelTypeidCreator::m_iters
std::vector< GtkTreeIter * > m_iters
This contains a vector of iterators used to build the TreeStore.
Definition:
model-typeid-creator.h:103
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::COL_TYPEID
@ COL_TYPEID
Definition:
model-typeid-creator.h:28
ns3::COL_LASTID
@ COL_LASTID
Definition:
model-typeid-creator.h:28
ns3::ModelTypeid
A class used in the implementation of the GtkConfigStore.
Definition:
model-typeid-creator.h:36
ns3::ModelTypeid::index
uint32_t index
stores the index of the attribute in list of attributes for a given TypeId
Definition:
model-typeid-creator.h:55
ns3::ModelTypeid::tid
TypeId tid
The TypeId object and if it is an attribute, it's the TypeId object of the attribute.
Definition:
model-typeid-creator.h:53
ns3::ModelTypeid::type
enum ns3::ModelTypeid::@4 type
node type
ns3::ModelTypeid::NODE_TYPEID
@ NODE_TYPEID
Definition:
model-typeid-creator.h:46
ns3::ModelTypeid::NODE_ATTRIBUTE
@ NODE_ATTRIBUTE
Definition:
model-typeid-creator.h:44
ns3::ModelTypeid::defaultValue
std::string defaultValue
TypeId default value.
Definition:
model-typeid-creator.h:51
ns3::ModelTypeid::name
std::string name
TypeId name.
Definition:
model-typeid-creator.h:49
src
config-store
model
model-typeid-creator.h
Generated on Tue Feb 6 2024 19:21:16 for ns-3 by
1.9.1