A Discrete-Event Network Simulator
API
spectrum-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 CTTC
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: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 #ifndef SPECTRUM_HELPER_H
22 #define SPECTRUM_HELPER_H
23 
24 #include <string>
25 #include <ns3/attribute.h>
26 #include <ns3/object-factory.h>
27 #include <ns3/node-container.h>
28 #include <ns3/net-device-container.h>
29 #include <ns3/propagation-loss-model.h>
30 #include <ns3/spectrum-propagation-loss-model.h>
31 
32 namespace ns3 {
33 
34 class SpectrumPhy;
35 class SpectrumChannel;
36 class Node;
37 class NetDevice;
38 
39 
45 {
46 public:
56 
76  void SetChannel (std::string type,
77  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
78  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
79  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
80  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
81  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
82  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
83  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
84  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
106  void AddPropagationLoss (std::string name,
107  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
108  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
109  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
110  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
111  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
112  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
113  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
114  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
115 
116 
123 
145  void AddSpectrumPropagationLoss (std::string name,
146  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
147  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
148  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
149  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
150  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
151  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
152  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
153  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
154 
161 
183  void SetPropagationDelay (std::string name,
184  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
185  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
186  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
187  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
188  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
189  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
190  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
191  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
192 
198  Ptr<SpectrumChannel> Create (void) const;
199 
200 private:
205 };
206 
207 
208 
215 {
216 public:
236  void SetPhy (std::string name,
237  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
238  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
239  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
240  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
241  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
242  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
243  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
244  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
245 
252 
258  void SetChannel (std::string channelName);
259 
266  void SetPhyAttribute (std::string name, const AttributeValue &v);
267 
275  Ptr<SpectrumPhy> Create (Ptr<Node> node, Ptr<NetDevice> device) const;
276 
277 
278 
279 private:
282 };
283 
284 
285 } // namespace ns3
286 
287 #endif /* SPECTRUM_HELPER_H */
void SetChannel(Ptr< SpectrumChannel > channel)
set the channel that will be used by SpectrumPhy instances created by this helper ...
Hold a value for an Attribute.
Definition: attribute.h:68
ObjectFactory m_propagationDelay
Propagation delay.
Ptr< SpectrumChannel > m_channel
Channel.
ObjectFactory m_channel
Channel.
ObjectFactory m_phy
Object factory for the phy objects.
Ptr< SpectrumPropagationLossModel > m_spectrumPropagationLossModel
Spectrum propagation loss model.
channel
Definition: third.py:85
void AddPropagationLoss(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
A class for an empty attribute value.
Definition: attribute.h:232
void SetPropagationDelay(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Ptr< PropagationLossModel > m_propagationLossModel
Propagation loss model.
void SetPhy(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetChannel(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
void AddSpectrumPropagationLoss(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Instantiate subclasses of ns3::Object.
static SpectrumChannelHelper Default()
Setup a default SpectrumChannel.
Create and configure several SpectrumPhy instances and connect them to a channel. ...
void SetPhyAttribute(std::string name, const AttributeValue &v)
Setup a SpectrumChannel.
Ptr< SpectrumChannel > Create(void) const
Ptr< SpectrumPhy > Create(Ptr< Node > node, Ptr< NetDevice > device) const