A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
Enumerator
a
b
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
c
e
i
l
o
r
s
t
v
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
ns2-mobility-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 INRIA
3
* 2009,2010 Contributors
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
* Contributors: Thomas Waldecker <twaldecker@rocketmail.com>
20
* Martín Giachino <martin.giachino@gmail.com>
21
*/
22
#ifndef NS2_MOBILITY_HELPER_H
23
#define NS2_MOBILITY_HELPER_H
24
25
#include "ns3/object.h"
26
#include "ns3/ptr.h"
27
28
#include <stdint.h>
29
#include <string>
30
31
namespace
ns3
32
{
33
34
class
ConstantVelocityMobilityModel;
35
77
class
Ns2MobilityHelper
78
{
79
public
:
84
Ns2MobilityHelper
(std::string filename);
85
92
void
Install
()
const
;
93
105
template
<
typename
T>
106
void
Install
(T begin, T end)
const
;
107
108
private
:
112
class
ObjectStore
113
{
114
public
:
115
virtual
~ObjectStore
()
116
{
117
}
118
124
virtual
Ptr<Object>
Get
(uint32_t i)
const
= 0;
125
};
126
131
void
ConfigNodesMovements
(
const
ObjectStore
& store)
const
;
138
Ptr<ConstantVelocityMobilityModel>
GetMobilityModel
(std::string idString,
139
const
ObjectStore
& store)
const
;
140
std::string
m_filename
;
141
};
142
143
}
// namespace ns3
144
145
namespace
ns3
146
{
147
148
template
<
typename
T>
149
void
150
Ns2MobilityHelper::Install
(T begin, T end)
const
151
{
152
class
MyObjectStore :
public
ObjectStore
153
{
154
public
:
155
MyObjectStore(T begin, T end)
156
: m_begin(begin),
157
m_end(end)
158
{
159
}
160
161
Ptr<Object>
Get(uint32_t i)
const override
162
{
163
T iterator = m_begin;
164
iterator += i;
165
if
(iterator >= m_end)
166
{
167
return
nullptr
;
168
}
169
return
*iterator;
170
}
171
172
private
:
173
T m_begin;
174
T m_end;
175
};
176
177
ConfigNodesMovements
(MyObjectStore(begin, end));
178
}
179
180
}
// namespace ns3
181
182
#endif
/* NS2_MOBILITY_HELPER_H */
ns3::Ns2MobilityHelper::ObjectStore
a class to hold input objects internally
Definition:
ns2-mobility-helper.h:113
ns3::Ns2MobilityHelper::ObjectStore::Get
virtual Ptr< Object > Get(uint32_t i) const =0
Return ith object in store.
ns3::Ns2MobilityHelper::ObjectStore::~ObjectStore
virtual ~ObjectStore()
Definition:
ns2-mobility-helper.h:115
ns3::Ns2MobilityHelper
Helper class which can read ns-2 movement files and configure nodes mobility.
Definition:
ns2-mobility-helper.h:78
ns3::Ns2MobilityHelper::ConfigNodesMovements
void ConfigNodesMovements(const ObjectStore &store) const
Parses ns-2 mobility file to create ns-3 mobility events.
Definition:
ns2-mobility-helper.cc:266
ns3::Ns2MobilityHelper::Install
void Install() const
Read the ns2 trace file and configure the movement patterns of all nodes contained in the global ns3:...
Definition:
ns2-mobility-helper.cc:864
ns3::Ns2MobilityHelper::m_filename
std::string m_filename
filename of file containing ns-2 mobility trace
Definition:
ns2-mobility-helper.h:140
ns3::Ns2MobilityHelper::GetMobilityModel
Ptr< ConstantVelocityMobilityModel > GetMobilityModel(std::string idString, const ObjectStore &store) const
Get or create a ConstantVelocityMobilityModel corresponding to idString.
Definition:
ns2-mobility-helper.cc:245
ns3::Ns2MobilityHelper::Ns2MobilityHelper
Ns2MobilityHelper(std::string filename)
Definition:
ns2-mobility-helper.cc:233
ns3::Ptr< Object >
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mobility
helper
ns2-mobility-helper.h
Generated on Sun Mar 3 2024 17:11:05 for ns-3 by
1.9.1