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
adhoc-aloha-noack-ideal-phy-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 ADHOC_ALOHA_NOACK_IDEAL_PHY_HELPER_H
21
#define ADHOC_ALOHA_NOACK_IDEAL_PHY_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
37
/**
38
* \ingroup spectrum
39
* \brief create the AlohaNoackNetDevice
40
*/
41
class
AdhocAlohaNoackIdealPhyHelper
42
{
43
public
:
44
AdhocAlohaNoackIdealPhyHelper
();
45
~AdhocAlohaNoackIdealPhyHelper
();
46
47
/**
48
* set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
49
*
50
* @param channel
51
*/
52
void
SetChannel
(
Ptr<SpectrumChannel>
channel);
53
54
/**
55
* set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
56
*
57
* @param channelName
58
*/
59
void
SetChannel
(std::string channelName);
60
61
/**
62
*
63
* @param txPsd the Power Spectral Density to be used for transmission by all created PHY
64
* instances
65
*/
66
void
SetTxPowerSpectralDensity
(
Ptr<SpectrumValue>
txPsd);
67
68
/**
69
*
70
* @param noisePsd the Power Spectral Density to be used for transmission by all created PHY
71
* instances
72
*/
73
void
SetNoisePowerSpectralDensity
(
Ptr<SpectrumValue>
noisePsd);
74
75
/**
76
* @param name the name of the attribute to set
77
* @param v the value of the attribute
78
*
79
* Set these attributes on each HdOfdmSpectrumPhy instance to be created
80
*/
81
void
SetPhyAttribute
(std::string name,
const
AttributeValue
& v);
82
83
/**
84
* @param n1 the name of the attribute to set
85
* @param v1 the value of the attribute to set
86
*
87
* Set these attributes on each AlohaNoackNetDevice created
88
*/
89
void
SetDeviceAttribute
(std::string n1,
const
AttributeValue
& v1);
90
91
/**
92
* \tparam Ts \deduced Argument types
93
* \param type the type of the model to set
94
* \param [in] args Name and AttributeValue pairs to set.
95
*
96
* Configure the AntennaModel instance for each new device to be created
97
*/
98
template
<
typename
... Ts>
99
void
SetAntenna
(std::string type, Ts&&... args);
100
101
/**
102
* @param c the set of nodes on which a device must be created
103
* @return a device container which contains all the devices created by this method.
104
*/
105
NetDeviceContainer
Install
(
NodeContainer
c)
const
;
106
/**
107
* @param node the node on which a device must be created
108
* \returns a device container which contains all the devices created by this method.
109
*/
110
NetDeviceContainer
Install
(
Ptr<Node>
node)
const
;
111
/**
112
* @param nodeName the name of node on which a device must be created
113
* @return a device container which contains all the devices created by this method.
114
*/
115
NetDeviceContainer
Install
(std::string nodeName)
const
;
116
117
protected
:
118
ObjectFactory
m_phy
;
//!< Object factory for the phy objects
119
ObjectFactory
m_device
;
//!< Object factory for the NetDevice objects
120
ObjectFactory
m_queue
;
//!< Object factory for the Queue objects
121
ObjectFactory
m_antenna
;
//!< Object factory for the Antenna objects
122
Ptr<SpectrumChannel>
m_channel
;
//!< Channel
123
Ptr<SpectrumValue>
m_txPsd
;
//!< Tx power spectral density
124
Ptr<SpectrumValue>
m_noisePsd
;
//!< Noise power spectral density
125
};
126
127
/***************************************************************
128
* Implementation of the templates declared above.
129
***************************************************************/
130
131
template
<
typename
... Ts>
132
void
133
AdhocAlohaNoackIdealPhyHelper::SetAntenna
(std::string type, Ts&&... args)
134
{
135
m_antenna
=
ObjectFactory
(std::forward<Ts>(args)...);
136
}
137
138
}
// namespace ns3
139
140
#endif
/* ADHOC_ALOHA_NOACK_IDEAL_PHY_HELPER_H */
ns3::AdhocAlohaNoackIdealPhyHelper
create the AlohaNoackNetDevice
Definition:
adhoc-aloha-noack-ideal-phy-helper.h:42
ns3::AdhocAlohaNoackIdealPhyHelper::SetPhyAttribute
void SetPhyAttribute(std::string name, const AttributeValue &v)
Definition:
adhoc-aloha-noack-ideal-phy-helper.cc:79
ns3::AdhocAlohaNoackIdealPhyHelper::m_queue
ObjectFactory m_queue
Object factory for the Queue objects.
Definition:
adhoc-aloha-noack-ideal-phy-helper.h:120
ns3::AdhocAlohaNoackIdealPhyHelper::SetTxPowerSpectralDensity
void SetTxPowerSpectralDensity(Ptr< SpectrumValue > txPsd)
Definition:
adhoc-aloha-noack-ideal-phy-helper.cc:65
ns3::AdhocAlohaNoackIdealPhyHelper::m_channel
Ptr< SpectrumChannel > m_channel
Channel.
Definition:
adhoc-aloha-noack-ideal-phy-helper.h:122
ns3::AdhocAlohaNoackIdealPhyHelper::AdhocAlohaNoackIdealPhyHelper
AdhocAlohaNoackIdealPhyHelper()
Definition:
adhoc-aloha-noack-ideal-phy-helper.cc:39
ns3::AdhocAlohaNoackIdealPhyHelper::SetDeviceAttribute
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Definition:
adhoc-aloha-noack-ideal-phy-helper.cc:85
ns3::AdhocAlohaNoackIdealPhyHelper::m_noisePsd
Ptr< SpectrumValue > m_noisePsd
Noise power spectral density.
Definition:
adhoc-aloha-noack-ideal-phy-helper.h:124
ns3::AdhocAlohaNoackIdealPhyHelper::SetAntenna
void SetAntenna(std::string type, Ts &&... args)
Definition:
adhoc-aloha-noack-ideal-phy-helper.h:133
ns3::AdhocAlohaNoackIdealPhyHelper::m_txPsd
Ptr< SpectrumValue > m_txPsd
Tx power spectral density.
Definition:
adhoc-aloha-noack-ideal-phy-helper.h:123
ns3::AdhocAlohaNoackIdealPhyHelper::SetNoisePowerSpectralDensity
void SetNoisePowerSpectralDensity(Ptr< SpectrumValue > noisePsd)
Definition:
adhoc-aloha-noack-ideal-phy-helper.cc:72
ns3::AdhocAlohaNoackIdealPhyHelper::m_phy
ObjectFactory m_phy
Object factory for the phy objects.
Definition:
adhoc-aloha-noack-ideal-phy-helper.h:118
ns3::AdhocAlohaNoackIdealPhyHelper::m_antenna
ObjectFactory m_antenna
Object factory for the Antenna objects.
Definition:
adhoc-aloha-noack-ideal-phy-helper.h:121
ns3::AdhocAlohaNoackIdealPhyHelper::m_device
ObjectFactory m_device
Object factory for the NetDevice objects.
Definition:
adhoc-aloha-noack-ideal-phy-helper.h:119
ns3::AdhocAlohaNoackIdealPhyHelper::SetChannel
void SetChannel(Ptr< SpectrumChannel > channel)
set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
Definition:
adhoc-aloha-noack-ideal-phy-helper.cc:52
ns3::AdhocAlohaNoackIdealPhyHelper::~AdhocAlohaNoackIdealPhyHelper
~AdhocAlohaNoackIdealPhyHelper()
Definition:
adhoc-aloha-noack-ideal-phy-helper.cc:47
ns3::AdhocAlohaNoackIdealPhyHelper::Install
NetDeviceContainer Install(NodeContainer c) const
Definition:
adhoc-aloha-noack-ideal-phy-helper.cc:91
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
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
spectrum
helper
adhoc-aloha-noack-ideal-phy-helper.h
Generated on Tue May 28 2024 23:39:15 for ns-3 by
1.9.6