A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
36 typedef std::map<SpectrumModelUid_t, SpectrumConverter> SpectrumConverterMap_t;
37 
38 
44 {
45 public:
47 
50 };
51 
52 typedef std::map<SpectrumModelUid_t, TxSpectrumModelInfo> TxSpectrumModelInfoMap_t;
53 
54 
60 {
61 public:
63 
65  std::set<Ptr<SpectrumPhy> > m_rxPhySet;
66 };
67 
68 typedef std::map<SpectrumModelUid_t, RxSpectrumModelInfo> RxSpectrumModelInfoMap_t;
69 
70 
71 
72 
87 {
88 
89 public:
91 
92  static TypeId GetTypeId (void);
93 
94  // inherited from SpectrumChannel
98  virtual void AddRx (Ptr<SpectrumPhy> phy);
99  virtual void StartTx (Ptr<SpectrumSignalParameters> params);
100 
101 
102  // inherited from Channel
103  virtual uint32_t GetNDevices (void) const;
104  virtual Ptr<NetDevice> GetDevice (uint32_t i) const;
105 
107 
108 
109 protected:
110  void DoDispose ();
111 
112 
113 
114 private:
125  TxSpectrumModelInfoMap_t::const_iterator FindAndEventuallyAddTxSpectrumModel (Ptr<const SpectrumModel> txSpectrumModel);
126 
133  virtual void StartRx (Ptr<SpectrumSignalParameters> params, Ptr<SpectrumPhy> receiver);
134 
135 
136 
142 
148 
154 
155 
163 
164 
171 
172  uint32_t m_numDevices;
173 
174  double m_maxLossDb;
175 
177 };
178 
179 
180 
181 }
182 
183 
184 
185 #endif /* MULTI_MODEL_SPECTRUM_CHANNEL_H */
Ptr< SpectrumPropagationLossModel > m_spectrumPropagationLoss
frequency-dependent propagation loss model to be used with this channel
std::map< SpectrumModelUid_t, RxSpectrumModelInfo > RxSpectrumModelInfoMap_t
std::set< Ptr< SpectrumPhy > > m_rxPhySet
std::map< SpectrumModelUid_t, SpectrumConverter > SpectrumConverterMap_t
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
virtual void AddPropagationLossModel(Ptr< PropagationLossModel > loss)
set the single-frequency propagation loss model to be used
RxSpectrumModelInfoMap_t m_rxSpectrumModelInfoMap
data structure holding, for each RX spectrum model, all the corresponding SpectrumPhy instances...
This SpectrumChannel implementation can handle the presence of SpectrumPhy instances which can use di...
virtual Ptr< SpectrumPropagationLossModel > GetSpectrumPropagationLossModel(void)
Ptr< const SpectrumModel > m_rxSpectrumModel
Ptr< PropagationDelayModel > m_propagationDelay
propagation delay model to be used with this channel
Ptr< PropagationLossModel > m_propagationLoss
single-frequency propagation loss model to be used with this channel
Ptr< const SpectrumModel > m_txSpectrumModel
virtual uint32_t GetNDevices(void) const
virtual void AddRx(Ptr< SpectrumPhy > phy)
add a SpectrumPhy to a channel, so it can receive packets
TxSpectrumModelInfoMap_t::const_iterator FindAndEventuallyAddTxSpectrumModel(Ptr< const SpectrumModel > txSpectrumModel)
this method checks if m_rxSpectrumModelInfoMap contains an entry for the given TX SpectrumModel...
RxSpectrumModelInfo(Ptr< const SpectrumModel > rxSpectrumModel)
void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
SpectrumConverterMap_t m_spectrumConverterMap
virtual void AddSpectrumPropagationLossModel(Ptr< SpectrumPropagationLossModel > loss)
set the frequency-dependent propagation loss model to be used
TracedCallback< Ptr< SpectrumPhy >, Ptr< SpectrumPhy >, double > m_pathLossTrace
virtual void StartTx(Ptr< SpectrumSignalParameters > params)
Used by attached PHY instances to transmit signals on the channel.
std::map< SpectrumModelUid_t, TxSpectrumModelInfo > TxSpectrumModelInfoMap_t
virtual Ptr< NetDevice > GetDevice(uint32_t i) const
virtual void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
set the propagation delay model to be used
TxSpectrumModelInfoMap_t m_txSpectrumModelInfoMap
data structure holding, for each TX SpectrumModel, all the converters to any RX SpectrumModel, and all the corresponding SpectrumPhy instances.
Defines the interface for spectrum-aware channel implementations.
TxSpectrumModelInfo(Ptr< const SpectrumModel > txSpectrumModel)
a unique identifier for an interface.
Definition: type-id.h:49
virtual void StartRx(Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver)
used internally to reschedule transmission after the propagation delay