A Discrete-Event Network Simulator
API
multi-model-spectrum-channel.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 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 
22 #ifndef MULTI_MODEL_SPECTRUM_CHANNEL_H
23 #define MULTI_MODEL_SPECTRUM_CHANNEL_H
24 
25 #include <ns3/spectrum-value.h>
26 #include <ns3/spectrum-converter.h>
27 #include <ns3/spectrum-channel.h>
28 #include <ns3/spectrum-propagation-loss-model.h>
29 #include <ns3/propagation-delay-model.h>
30 #include <map>
31 #include <set>
32 
33 namespace ns3 {
34 
35 
40 typedef std::map<SpectrumModelUid_t, SpectrumConverter> SpectrumConverterMap_t;
41 
48 {
49 public:
55 
58 };
59 
60 
65 typedef std::map<SpectrumModelUid_t, TxSpectrumModelInfo> TxSpectrumModelInfoMap_t;
66 
67 
74 {
75 public:
81 
83  std::vector<Ptr<SpectrumPhy> > m_rxPhys;
84 };
85 
90 typedef std::map<SpectrumModelUid_t, RxSpectrumModelInfo> RxSpectrumModelInfoMap_t;
91 
92 
107 {
108 
109 public:
111 
116  static TypeId GetTypeId (void);
117 
118  // inherited from SpectrumChannel
119  virtual void AddRx (Ptr<SpectrumPhy> phy);
120  virtual void StartTx (Ptr<SpectrumSignalParameters> params);
121 
122 
123  // inherited from Channel
124  virtual std::size_t GetNDevices (void) const;
125  virtual Ptr<NetDevice> GetDevice (std::size_t i) const;
126 
127 
128 protected:
129  void DoDispose ();
130 
131 private:
142  TxSpectrumModelInfoMap_t::const_iterator FindAndEventuallyAddTxSpectrumModel (Ptr<const SpectrumModel> txSpectrumModel);
143 
150  virtual void StartRx (Ptr<SpectrumSignalParameters> params, Ptr<SpectrumPhy> receiver);
151 
159 
160 
166 
170  std::size_t m_numDevices;
171 
172 };
173 
174 
175 
176 }
177 
178 
179 
180 #endif /* MULTI_MODEL_SPECTRUM_CHANNEL_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::TxSpectrumModelInfoMap_t
std::map< SpectrumModelUid_t, TxSpectrumModelInfo > TxSpectrumModelInfoMap_t
Container: SpectrumModelUid_t, TxSpectrumModelInfo.
Definition: multi-model-spectrum-channel.h:65
ns3::TxSpectrumModelInfo::m_spectrumConverterMap
SpectrumConverterMap_t m_spectrumConverterMap
Spectrum converter.
Definition: multi-model-spectrum-channel.h:57
ns3::SpectrumConverterMap_t
std::map< SpectrumModelUid_t, SpectrumConverter > SpectrumConverterMap_t
Container: SpectrumModelUid_t, SpectrumConverter.
Definition: multi-model-spectrum-channel.h:40
ns3::TxSpectrumModelInfo::TxSpectrumModelInfo
TxSpectrumModelInfo(Ptr< const SpectrumModel > txSpectrumModel)
Constructor.
Definition: multi-model-spectrum-channel.cc:71
ns3::SpectrumChannel
Defines the interface for spectrum-aware channel implementations.
Definition: spectrum-channel.h:49
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::RxSpectrumModelInfo::m_rxSpectrumModel
Ptr< const SpectrumModel > m_rxSpectrumModel
Rx Spectrum model.
Definition: multi-model-spectrum-channel.h:82
ns3::MultiModelSpectrumChannel::DoDispose
void DoDispose()
Destructor implementation.
Definition: multi-model-spectrum-channel.cc:88
ns3::MultiModelSpectrumChannel::FindAndEventuallyAddTxSpectrumModel
TxSpectrumModelInfoMap_t::const_iterator FindAndEventuallyAddTxSpectrumModel(Ptr< const SpectrumModel > txSpectrumModel)
This method checks if m_rxSpectrumModelInfoMap contains an entry for the given TX SpectrumModel.
Definition: multi-model-spectrum-channel.cc:175
ns3::MultiModelSpectrumChannel::m_rxSpectrumModelInfoMap
RxSpectrumModelInfoMap_t m_rxSpectrumModelInfoMap
Data structure holding, for each RX spectrum model, all the corresponding SpectrumPhy instances.
Definition: multi-model-spectrum-channel.h:165
ns3::MultiModelSpectrumChannel::GetNDevices
virtual std::size_t GetNDevices(void) const
Definition: multi-model-spectrum-channel.cc:359
ns3::MultiModelSpectrumChannel::MultiModelSpectrumChannel
MultiModelSpectrumChannel()
Definition: multi-model-spectrum-channel.cc:81
ns3::MultiModelSpectrumChannel::m_numDevices
std::size_t m_numDevices
Number of devices connected to the channel.
Definition: multi-model-spectrum-channel.h:170
ns3::Ptr< const SpectrumModel >
ns3::MultiModelSpectrumChannel::StartRx
virtual void StartRx(Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver)
Used internally to reschedule transmission after the propagation delay.
Definition: multi-model-spectrum-channel.cc:352
ns3::MultiModelSpectrumChannel::m_txSpectrumModelInfoMap
TxSpectrumModelInfoMap_t m_txSpectrumModelInfoMap
Data structure holding, for each TX SpectrumModel, all the converters to any RX SpectrumModel,...
Definition: multi-model-spectrum-channel.h:158
ns3::TxSpectrumModelInfo::m_txSpectrumModel
Ptr< const SpectrumModel > m_txSpectrumModel
Tx Spectrum model.
Definition: multi-model-spectrum-channel.h:56
ns3::RxSpectrumModelInfo::m_rxPhys
std::vector< Ptr< SpectrumPhy > > m_rxPhys
Container of the Rx Spectrum phy objects.
Definition: multi-model-spectrum-channel.h:83
ns3::TxSpectrumModelInfo
The Tx spectrum model information.
Definition: multi-model-spectrum-channel.h:48
ns3::MultiModelSpectrumChannel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: multi-model-spectrum-channel.cc:97
ns3::RxSpectrumModelInfo
The Rx spectrum model information.
Definition: multi-model-spectrum-channel.h:74
ns3::MultiModelSpectrumChannel::AddRx
virtual void AddRx(Ptr< SpectrumPhy > phy)
Add a SpectrumPhy to a channel, so it can receive packets.
Definition: multi-model-spectrum-channel.cc:109
ns3::RxSpectrumModelInfoMap_t
std::map< SpectrumModelUid_t, RxSpectrumModelInfo > RxSpectrumModelInfoMap_t
Container: SpectrumModelUid_t, RxSpectrumModelInfo.
Definition: multi-model-spectrum-channel.h:90
ns3::MultiModelSpectrumChannel::GetDevice
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
Definition: multi-model-spectrum-channel.cc:365
ns3::MultiModelSpectrumChannel
This SpectrumChannel implementation can handle the presence of SpectrumPhy instances which can use di...
Definition: multi-model-spectrum-channel.h:107
ns3::MultiModelSpectrumChannel::StartTx
virtual void StartTx(Ptr< SpectrumSignalParameters > params)
Used by attached PHY instances to transmit signals on the channel.
Definition: multi-model-spectrum-channel.cc:217
ns3::RxSpectrumModelInfo::RxSpectrumModelInfo
RxSpectrumModelInfo(Ptr< const SpectrumModel > rxSpectrumModel)
Constructor.
Definition: multi-model-spectrum-channel.cc:76
third.phy
phy
Definition: third.py:93