A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
uan-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 University of Washington
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Leonard Tracy <lentracy@u.washington.edu>
18
*/
19
20
#ifndef UAN_HELPER_H
21
#define UAN_HELPER_H
22
23
#include "ns3/attribute.h"
24
#include "ns3/net-device-container.h"
25
#include "ns3/node-container.h"
26
#include "ns3/object-factory.h"
27
#include "ns3/uan-net-device.h"
28
29
#include <string>
30
31
namespace
ns3
32
{
33
34
class
UanChannel;
35
41
class
UanHelper
42
{
43
public
:
44
UanHelper
();
45
virtual
~UanHelper
();
46
57
template
<
typename
... Ts>
58
void
SetMac
(std::string
type
, Ts&&...
args
);
59
70
template
<
typename
... Ts>
71
void
SetPhy
(std::string phyType, Ts&&...
args
);
72
83
template
<
typename
... Ts>
84
void
SetTransducer
(std::string
type
, Ts&&...
args
);
94
static
void
EnableAscii
(std::ostream& os, uint32_t nodeid, uint32_t deviceid);
104
static
void
EnableAscii
(std::ostream& os,
NetDeviceContainer
d);
114
static
void
EnableAscii
(std::ostream& os,
NodeContainer
n);
122
static
void
EnableAsciiAll
(std::ostream& os);
123
137
NetDeviceContainer
Install
(
NodeContainer
c)
const
;
138
151
NetDeviceContainer
Install
(
NodeContainer
c,
Ptr<UanChannel>
channel
)
const
;
152
169
Ptr<UanNetDevice>
Install
(
Ptr<Node>
node,
Ptr<UanChannel>
channel
)
const
;
170
182
int64_t
AssignStreams
(
NetDeviceContainer
c, int64_t stream);
183
184
private
:
185
ObjectFactory
m_device
;
186
ObjectFactory
m_mac
;
187
ObjectFactory
m_phy
;
188
ObjectFactory
m_transducer
;
189
};
190
191
/***************************************************************
192
* Implementation of the templates declared above.
193
***************************************************************/
194
195
template
<
typename
... Ts>
196
void
197
UanHelper::SetMac
(std::string
type
, Ts&&...
args
)
198
{
199
m_mac
=
ObjectFactory
(
type
, std::forward<Ts>(
args
)...);
200
}
201
202
template
<
typename
... Ts>
203
void
204
UanHelper::SetPhy
(std::string phyType, Ts&&...
args
)
205
{
206
m_phy
=
ObjectFactory
(phyType, std::forward<Ts>(
args
)...);
207
}
208
209
template
<
typename
... Ts>
210
void
211
UanHelper::SetTransducer
(std::string
type
, Ts&&...
args
)
212
{
213
m_transducer
=
ObjectFactory
(
type
, std::forward<Ts>(
args
)...);
214
}
215
216
}
// end namespace ns3
217
218
#endif
/* UAN_HELPER_H */
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:43
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:40
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:48
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::UanHelper
UAN configuration helper.
Definition:
uan-helper.h:42
ns3::UanHelper::m_device
ObjectFactory m_device
The device.
Definition:
uan-helper.h:185
ns3::UanHelper::SetPhy
void SetPhy(std::string phyType, Ts &&... args)
Set PHY attributes.
Definition:
uan-helper.h:204
ns3::UanHelper::SetTransducer
void SetTransducer(std::string type, Ts &&... args)
Set the transducer attributes.
Definition:
uan-helper.h:211
ns3::UanHelper::SetMac
void SetMac(std::string type, Ts &&... args)
Set MAC attributes.
Definition:
uan-helper.h:197
ns3::UanHelper::m_phy
ObjectFactory m_phy
The PHY layer.
Definition:
uan-helper.h:187
ns3::UanHelper::m_transducer
ObjectFactory m_transducer
The transducer.
Definition:
uan-helper.h:188
ns3::UanHelper::EnableAscii
static void EnableAscii(std::ostream &os, uint32_t nodeid, uint32_t deviceid)
Enable ascii output on the specified deviceid within the specified nodeid if it is of type ns3::UanNe...
Definition:
uan-helper.cc:99
ns3::UanHelper::m_mac
ObjectFactory m_mac
The MAC layer.
Definition:
uan-helper.h:186
ns3::UanHelper::Install
NetDeviceContainer Install(NodeContainer c) const
This method creates a simple ns3::UanChannel (with a default ns3::UanNoiseModelDefault and ns3::UanPr...
Definition:
uan-helper.cc:145
ns3::UanHelper::AssignStreams
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition:
uan-helper.cc:192
ns3::UanHelper::EnableAsciiAll
static void EnableAsciiAll(std::ostream &os)
Enable ascii output on each device which is of the ns3::UanNetDevice type and dump that to the specif...
Definition:
uan-helper.cc:139
ns3::UanHelper::UanHelper
UanHelper()
Default constructor.
Definition:
uan-helper.cc:87
ns3::UanHelper::~UanHelper
virtual ~UanHelper()
Destructor.
Definition:
uan-helper.cc:94
check-style-clang-format.args
args
Definition:
check-style-clang-format.py:754
check-style-clang-format.type
type
Definition:
check-style-clang-format.py:704
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
third.channel
channel
Definition:
third.py:88
src
uan
helper
uan-helper.h
Generated on Sun Mar 3 2024 17:11:09 for ns-3 by
1.9.1