A Discrete-Event Network Simulator
API
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 SPECTRUM_CHANNEL_H
23 #define SPECTRUM_CHANNEL_H
24 
25 #include <ns3/object.h>
26 #include <ns3/nstime.h>
27 #include <ns3/channel.h>
28 #include <ns3/spectrum-signal-parameters.h>
29 #include <ns3/spectrum-propagation-loss-model.h>
30 #include <ns3/propagation-delay-model.h>
31 #include <ns3/propagation-loss-model.h>
32 #include <ns3/spectrum-phy.h>
33 #include <ns3/traced-callback.h>
34 #include <ns3/mobility-model.h>
35 
36 namespace ns3 {
37 
38 
39 class PacketBurst;
40 class SpectrumValue;
41 
48 class SpectrumChannel : public Channel
49 {
50 public:
51 
56  SpectrumChannel ();
61  virtual ~SpectrumChannel ();
62 
63  // inherited from Object
64  virtual void DoDispose (void);
65 
70  static TypeId GetTypeId (void);
71 
79 
85 
91 
97 
103 
109  virtual void StartTx (Ptr<SpectrumSignalParameters> params) = 0;
110 
126  virtual void AddRx (Ptr<SpectrumPhy> phy) = 0;
127 
135  typedef void (* LossTracedCallback)
137  double lossDb);
148  typedef void (* GainTracedCallback)
150  double txAntennaGain, double rxAntennaGain,
151  double propagationGain, double pathloss);
158 
159 protected:
160 
166 
173 
178 
184  double m_maxLossDb;
185 
190 
195 
200 
201 
202 };
203 
204 
205 }
206 
207 
208 #endif /* SPECTRUM_CHANNEL_H */
virtual ~SpectrumChannel()
destructor
TracedCallback< Ptr< const SpectrumPhy >, Ptr< const SpectrumPhy >, double > m_pathLossTrace
The PathLoss trace source.
Forward calls to a chain of Callback.
double m_maxLossDb
Maximum loss [dB].
Abstract Channel Base Class.
Definition: channel.h:43
virtual void StartTx(Ptr< SpectrumSignalParameters > params)=0
Used by attached PHY instances to transmit signals on the channel.
void(* LossTracedCallback)(Ptr< const SpectrumPhy > txPhy, Ptr< const SpectrumPhy > rxPhy, double lossDb)
TracedCallback signature for path loss calculation events.
void AddPropagationLossModel(Ptr< PropagationLossModel > loss)
Add the single-frequency propagation loss model to be used.
void AddSpectrumPropagationLossModel(Ptr< SpectrumPropagationLossModel > loss)
Add the frequency-dependent propagation loss model to be used.
phy
Definition: third.py:93
static TypeId GetTypeId(void)
Get the type ID.
Ptr< SpectrumPropagationLossModel > m_spectrumPropagationLoss
Frequency-dependent propagation loss model to be used with this channel.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
SpectrumChannel()
constructor
Ptr< PropagationLossModel > m_propagationLoss
Single-frequency propagation loss model to be used with this channel.
TracedCallback< Ptr< SpectrumSignalParameters > > m_txSigParamsTrace
Traced callback for SpectrumSignalParameters in StartTx requests.
void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
Set the propagation delay model to be used.
Defines the interface for spectrum-aware channel implementations.
Ptr< PropagationDelayModel > m_propagationDelay
Propagation delay model to be used with this channel.
a unique identifier for an interface.
Definition: type-id.h:58
TracedCallback< Ptr< const MobilityModel >, Ptr< const MobilityModel >, double, double, double, double > m_gainTrace
The Gain trace source.
Ptr< PropagationLossModel > GetPropagationLossModel(void)
Get the propagation loss model.
virtual void DoDispose(void)
Destructor implementation.
void(* SignalParametersTracedCallback)(Ptr< SpectrumSignalParameters > params)
TracedCallback signature for Ptr<const SpectrumSignalParameters>.
void(* GainTracedCallback)(Ptr< const MobilityModel > txMobility, Ptr< const MobilityModel > rxMobility, double txAntennaGain, double rxAntennaGain, double propagationGain, double pathloss)
TracedCallback signature for path loss calculation events.
virtual void AddRx(Ptr< SpectrumPhy > phy)=0
Add a SpectrumPhy to a channel, so it can receive packets.
Ptr< SpectrumPropagationLossModel > GetSpectrumPropagationLossModel(void)
Get the frequency-dependent propagation loss model.