A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
single-model-spectrum-channel.h
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 #ifndef SINGLE_MODEL_SPECTRUM_CHANNEL_H
22 #define SINGLE_MODEL_SPECTRUM_CHANNEL_H
23 
24 
25 #include <ns3/spectrum-channel.h>
26 #include <ns3/spectrum-model.h>
27 #include <ns3/traced-callback.h>
28 
29 namespace ns3 {
30 
31 
32 
41 {
42 
43 public:
45 
46  static TypeId GetTypeId (void);
47 
48 
49  // inherited from SpectrumChannel
53  virtual void AddRx (Ptr<SpectrumPhy> phy);
54  virtual void StartTx (Ptr<SpectrumSignalParameters> params);
55 
56 
57  // inherited from Channel
58  virtual uint32_t GetNDevices (void) const;
59  virtual Ptr<NetDevice> GetDevice (uint32_t i) const;
60 
61 
62  typedef std::vector<Ptr<SpectrumPhy> > PhyList;
63 
64  virtual Ptr<SpectrumPropagationLossModel> GetSpectrumPropagationLossModel (void);
65 
66 private:
67  virtual void DoDispose ();
68 
76 
81  PhyList m_phyList;
82 
88 
89 
95 
96 
102 
108 
109 
110  double m_maxLossDb;
111 
112  TracedCallback<Ptr<SpectrumPhy>, Ptr<SpectrumPhy>, double > m_pathLossTrace;
113 };
114 
115 
116 
117 }
118 
119 
120 
121 #endif /* SINGLE_MODEL_SPECTRUM_CHANNEL_H */
Ptr< PropagationDelayModel > m_propagationDelay
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
virtual void AddRx(Ptr< SpectrumPhy > phy)
add a SpectrumPhy to a channel, so it can receive packets
virtual void AddSpectrumPropagationLossModel(Ptr< SpectrumPropagationLossModel > loss)
virtual void AddPropagationLossModel(Ptr< PropagationLossModel > loss)
virtual Ptr< NetDevice > GetDevice(uint32_t i) const
Ptr< PropagationLossModel > m_propagationLoss
void StartRx(Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver)
virtual void StartTx(Ptr< SpectrumSignalParameters > params)
Ptr< SpectrumPropagationLossModel > m_spectrumPropagationLoss
SpectrumChannel implementation which handles a single spectrum model.
virtual void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
a unique identifier for an interface.
Definition: type-id.h:44