A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
waveform-generator-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010 CTTC
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: Nicola Baldo <nbaldo@cttc.es>
18
*/
19
20
#ifndef WAVEFORM_GENERATOR_HELPER_H
21
#define WAVEFORM_GENERATOR_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/queue.h>
28
29
#include <string>
30
31
namespace
ns3
32
{
33
34
class
SpectrumValue;
35
class
SpectrumChannel;
36
42
class
WaveformGeneratorHelper
43
{
44
public
:
45
WaveformGeneratorHelper
();
46
~WaveformGeneratorHelper
();
47
53
void
SetChannel
(
Ptr<SpectrumChannel>
channel
);
54
60
void
SetChannel
(std::string channelName);
61
67
void
SetTxPowerSpectralDensity
(
Ptr<SpectrumValue>
txPsd);
68
75
void
SetPhyAttribute
(std::string name,
const
AttributeValue
& v);
76
83
void
SetDeviceAttribute
(std::string n1,
const
AttributeValue
& v1);
84
92
template
<
typename
... Ts>
93
void
SetAntenna
(std::string
type
, Ts&&...
args
);
94
99
NetDeviceContainer
Install
(
NodeContainer
c)
const
;
104
NetDeviceContainer
Install
(
Ptr<Node>
node)
const
;
109
NetDeviceContainer
Install
(std::string nodeName)
const
;
110
111
protected
:
112
ObjectFactory
m_phy
;
113
ObjectFactory
m_device
;
114
ObjectFactory
m_antenna
;
115
Ptr<SpectrumChannel>
m_channel
;
116
Ptr<SpectrumValue>
m_txPsd
;
117
};
118
119
/***************************************************************
120
* Implementation of the templates declared above.
121
***************************************************************/
122
123
template
<
typename
... Ts>
124
void
125
WaveformGeneratorHelper::SetAntenna
(std::string
type
, Ts&&...
args
)
126
{
127
m_antenna
=
ObjectFactory
(
type
, std::forward<Ts>(
args
)...);
128
}
129
130
}
// namespace ns3
131
132
#endif
/* WAVEFORM_GENERATOR_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:70
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::WaveformGeneratorHelper
Create a Waveform generator, which can be used to inject specific noise in the channel.
Definition:
waveform-generator-helper.h:43
ns3::WaveformGeneratorHelper::SetTxPowerSpectralDensity
void SetTxPowerSpectralDensity(Ptr< SpectrumValue > txPsd)
Definition:
waveform-generator-helper.cc:63
ns3::WaveformGeneratorHelper::SetAntenna
void SetAntenna(std::string type, Ts &&... args)
Definition:
waveform-generator-helper.h:125
ns3::WaveformGeneratorHelper::m_txPsd
Ptr< SpectrumValue > m_txPsd
Tx power spectral density.
Definition:
waveform-generator-helper.h:116
ns3::WaveformGeneratorHelper::SetDeviceAttribute
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Definition:
waveform-generator-helper.cc:76
ns3::WaveformGeneratorHelper::~WaveformGeneratorHelper
~WaveformGeneratorHelper()
Definition:
waveform-generator-helper.cc:45
ns3::WaveformGeneratorHelper::m_phy
ObjectFactory m_phy
Object factory for the phy objects.
Definition:
waveform-generator-helper.h:112
ns3::WaveformGeneratorHelper::SetChannel
void SetChannel(Ptr< SpectrumChannel > channel)
set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
Definition:
waveform-generator-helper.cc:50
ns3::WaveformGeneratorHelper::m_channel
Ptr< SpectrumChannel > m_channel
Channel.
Definition:
waveform-generator-helper.h:115
ns3::WaveformGeneratorHelper::Install
NetDeviceContainer Install(NodeContainer c) const
Definition:
waveform-generator-helper.cc:82
ns3::WaveformGeneratorHelper::SetPhyAttribute
void SetPhyAttribute(std::string name, const AttributeValue &v)
Definition:
waveform-generator-helper.cc:70
ns3::WaveformGeneratorHelper::m_device
ObjectFactory m_device
Object factory for the NetDevice objects.
Definition:
waveform-generator-helper.h:113
ns3::WaveformGeneratorHelper::m_antenna
ObjectFactory m_antenna
Object factory for the Antenna objects.
Definition:
waveform-generator-helper.h:114
ns3::WaveformGeneratorHelper::WaveformGeneratorHelper
WaveformGeneratorHelper()
Definition:
waveform-generator-helper.cc:38
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
spectrum
helper
waveform-generator-helper.h
Generated on Sun Mar 3 2024 17:11:08 for ns-3 by
1.9.1