A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
waveform-generator-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010 CTTC
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Nicola Baldo <nbaldo@cttc.es>
7
*/
8
9
#ifndef WAVEFORM_GENERATOR_HELPER_H
10
#define WAVEFORM_GENERATOR_HELPER_H
11
12
#include <ns3/attribute.h>
13
#include <ns3/net-device-container.h>
14
#include <ns3/node-container.h>
15
#include <ns3/object-factory.h>
16
#include <ns3/queue.h>
17
18
#include <string>
19
20
namespace
ns3
21
{
22
23
class
SpectrumValue;
24
class
SpectrumChannel;
25
26
/**
27
* \ingroup spectrum
28
*
29
* Create a Waveform generator, which can be used to inject specific noise in the channel.
30
*/
31
class
WaveformGeneratorHelper
32
{
33
public
:
34
WaveformGeneratorHelper
();
35
~WaveformGeneratorHelper
();
36
37
/**
38
* set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
39
*
40
* @param channel
41
*/
42
void
SetChannel
(
Ptr<SpectrumChannel>
channel);
43
44
/**
45
* set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
46
*
47
* @param channelName
48
*/
49
void
SetChannel
(std::string channelName);
50
51
/**
52
*
53
* @param txPsd the Power Spectral Density to be used for transmission by all created PHY
54
* instances
55
*/
56
void
SetTxPowerSpectralDensity
(
Ptr<SpectrumValue>
txPsd);
57
58
/**
59
* @param name the name of the attribute to set
60
* @param v the value of the attribute
61
*
62
* Set these attributes on each HdOfdmSpectrumPhy instance to be created
63
*/
64
void
SetPhyAttribute
(std::string name,
const
AttributeValue
& v);
65
66
/**
67
* @param n1 the name of the attribute to set
68
* @param v1 the value of the attribute to set
69
*
70
* Set these attributes on each AlohaNoackNetDevice created
71
*/
72
void
SetDeviceAttribute
(std::string n1,
const
AttributeValue
& v1);
73
74
/**
75
* \tparam Ts \deduced Argument types
76
* \param type the type of the model to set
77
* \param [in] args Name and AttributeValue pairs to set.
78
*
79
* Configure the AntennaModel instance for each new device to be created
80
*/
81
template
<
typename
... Ts>
82
void
SetAntenna
(std::string type, Ts&&... args);
83
84
/**
85
* @param c the set of nodes on which a device must be created
86
* @return a device container which contains all the devices created by this method.
87
*/
88
NetDeviceContainer
Install
(
NodeContainer
c)
const
;
89
/**
90
* @param node the node on which a device must be created
91
* \returns a device container which contains all the devices created by this method.
92
*/
93
NetDeviceContainer
Install
(
Ptr<Node>
node)
const
;
94
/**
95
* @param nodeName the name of node on which a device must be created
96
* @return a device container which contains all the devices created by this method.
97
*/
98
NetDeviceContainer
Install
(std::string nodeName)
const
;
99
100
protected
:
101
ObjectFactory
m_phy
;
//!< Object factory for the phy objects
102
ObjectFactory
m_device
;
//!< Object factory for the NetDevice objects
103
ObjectFactory
m_antenna
;
//!< Object factory for the Antenna objects
104
Ptr<SpectrumChannel>
m_channel
;
//!< Channel
105
Ptr<SpectrumValue>
m_txPsd
;
//!< Tx power spectral density
106
};
107
108
/***************************************************************
109
* Implementation of the templates declared above.
110
***************************************************************/
111
112
template
<
typename
... Ts>
113
void
114
WaveformGeneratorHelper::SetAntenna
(std::string type, Ts&&... args)
115
{
116
m_antenna
=
ObjectFactory
(type, std::forward<Ts>(args)...);
117
}
118
119
}
// namespace ns3
120
121
#endif
/* WAVEFORM_GENERATOR_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition
net-device-container.h:32
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::WaveformGeneratorHelper
Create a Waveform generator, which can be used to inject specific noise in the channel.
Definition
waveform-generator-helper.h:32
ns3::WaveformGeneratorHelper::SetTxPowerSpectralDensity
void SetTxPowerSpectralDensity(Ptr< SpectrumValue > txPsd)
Definition
waveform-generator-helper.cc:52
ns3::WaveformGeneratorHelper::SetAntenna
void SetAntenna(std::string type, Ts &&... args)
Definition
waveform-generator-helper.h:114
ns3::WaveformGeneratorHelper::m_txPsd
Ptr< SpectrumValue > m_txPsd
Tx power spectral density.
Definition
waveform-generator-helper.h:105
ns3::WaveformGeneratorHelper::SetDeviceAttribute
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Definition
waveform-generator-helper.cc:65
ns3::WaveformGeneratorHelper::~WaveformGeneratorHelper
~WaveformGeneratorHelper()
Definition
waveform-generator-helper.cc:34
ns3::WaveformGeneratorHelper::m_phy
ObjectFactory m_phy
Object factory for the phy objects.
Definition
waveform-generator-helper.h:101
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:39
ns3::WaveformGeneratorHelper::m_channel
Ptr< SpectrumChannel > m_channel
Channel.
Definition
waveform-generator-helper.h:104
ns3::WaveformGeneratorHelper::Install
NetDeviceContainer Install(NodeContainer c) const
Definition
waveform-generator-helper.cc:71
ns3::WaveformGeneratorHelper::SetPhyAttribute
void SetPhyAttribute(std::string name, const AttributeValue &v)
Definition
waveform-generator-helper.cc:59
ns3::WaveformGeneratorHelper::m_device
ObjectFactory m_device
Object factory for the NetDevice objects.
Definition
waveform-generator-helper.h:102
ns3::WaveformGeneratorHelper::m_antenna
ObjectFactory m_antenna
Object factory for the Antenna objects.
Definition
waveform-generator-helper.h:103
ns3::WaveformGeneratorHelper::WaveformGeneratorHelper
WaveformGeneratorHelper()
Definition
waveform-generator-helper.cc:27
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
spectrum
helper
waveform-generator-helper.h
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0