A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
topology-reader.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 Universita' di Firenze, Italy
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Tommaso Pecorella (tommaso.pecorella@unifi.it)
19
* Author: Valerio Sartini (valesar@gmail.com)
20
*/
21
22
#ifndef TOPOLOGY_READER_H
23
#define TOPOLOGY_READER_H
24
25
#include <string>
26
#include <map>
27
#include <list>
28
29
#include "ns3/object.h"
30
#include "ns3/node-container.h"
31
32
33
namespace
ns3 {
34
43
class
TopologyReader
:
public
Object
44
{
45
46
public
:
54
class
Link
55
{
56
public
:
60
typedef
std::map<std::string, std::string>::const_iterator
ConstAttributesIterator
;
61
69
Link
(
Ptr<Node>
fromPtr,
const
std::string &fromName,
Ptr<Node>
toPtr,
const
std::string &toName );
70
75
Ptr<Node>
GetFromNode
(
void
)
const
;
80
std::string
GetFromNodeName
(
void
)
const
;
85
Ptr<Node>
GetToNode
(
void
)
const
;
90
std::string
GetToNodeName
(
void
)
const
;
98
std::string
GetAttribute
(
const
std::string &name)
const
;
106
bool
GetAttributeFailSafe
(
const
std::string &name, std::string &value)
const
;
112
void
SetAttribute
(
const
std::string &name,
const
std::string &value);
117
ConstAttributesIterator
AttributesBegin
(
void
);
122
ConstAttributesIterator
AttributesEnd
(
void
);
123
124
private
:
125
Link
();
126
std::string
m_fromName
;
127
Ptr< Node >
m_fromPtr
;
128
std::string
m_toName
;
129
Ptr< Node >
m_toPtr
;
130
std::map<std::string, std::string>
m_linkAttr
;
131
};
132
136
typedef
std::list< Link >::const_iterator
ConstLinksIterator
;
137
138
static
TypeId
GetTypeId
(
void
);
139
140
TopologyReader
();
141
virtual
~TopologyReader
();
142
154
virtual
NodeContainer
Read
(
void
) = 0;
155
160
void
SetFileName
(
const
std::string &fileName);
161
166
std::string
GetFileName
(
void
)
const
;
167
172
ConstLinksIterator
LinksBegin
(
void
)
const
;
173
178
ConstLinksIterator
LinksEnd
(
void
)
const
;
179
184
int
LinksSize
(
void
)
const
;
185
190
bool
LinksEmpty
(
void
)
const
;
191
196
void
AddLink
(
Link
link);
197
198
private
:
199
TopologyReader
(
const
TopologyReader
&);
200
TopologyReader
&
operator=
(
const
TopologyReader
&);
201
202
std::string
m_fileName
;
203
std::list<Link>
m_linksList
;
204
205
// end class TopologyReader
206
};
207
208
// end namespace ns3
209
};
210
211
212
#endif
/* TOPOLOGY_READER_H */
src
topology-read
model
topology-reader.h
Generated on Tue Nov 13 2012 10:32:23 for ns-3 by
1.8.1.2