A Discrete-Event Network Simulator
API
spectrum-analyzer.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 #ifndef SPECTRUM_ANALYZER_H
22 #define SPECTRUM_ANALYZER_H
23 
24 
25 #include <ns3/spectrum-value.h>
26 #include <ns3/mobility-model.h>
27 #include <ns3/packet.h>
28 #include <ns3/nstime.h>
29 #include <ns3/net-device.h>
30 #include <ns3/spectrum-phy.h>
31 #include <ns3/spectrum-channel.h>
32 #include <string>
33 #include <fstream>
34 
35 namespace ns3 {
36 
37 
49 {
50 
51 public:
53  virtual ~SpectrumAnalyzer ();
54 
55  static TypeId GetTypeId (void);
56 
57 // inherited from SpectrumPhy
60  void SetDevice (Ptr<NetDevice> d);
62  Ptr<NetDevice> GetDevice () const;
66 
67 
74 
81 
86  virtual void Start ();
87 
92  virtual void Stop ();
93 
94 
95 protected:
96  void DoDispose ();
97 
98 private:
103 
104  virtual void GenerateReport ();
105 
109 
116  bool m_active;
117 
119 
120 };
121 
122 
123 
124 
125 
126 
127 }
128 
129 
130 
131 
132 
133 #endif /* SPECTRUM_ANALYZER_H */
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:45
Ptr< NetDevice > m_netDevice
void StartRx(Ptr< SpectrumSignalParameters > params)
Notify the SpectrumPhy instance of an incoming signal.
Forward calls to a chain of Callback.
Ptr< AntennaModel > m_antenna
virtual void Start()
Start the spectrum analyzer.
Ptr< NetDevice > GetDevice() const
get the associated NetDevice instance
void SetChannel(Ptr< SpectrumChannel > c)
Set the channel attached to this device.
Ptr< SpectrumChannel > m_channel
static TypeId GetTypeId(void)
virtual void Stop()
Stop the spectrum analyzer.
void SetRxSpectrumModel(Ptr< SpectrumModel > m)
Set the spectrum model used by the SpectrumAnalyzer to represent incoming signals.
void DoDispose()
Destructor implementation.
void SetDevice(Ptr< NetDevice > d)
set the associated NetDevice instance
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Simple SpectrumPhy implemetation that averages the spectrum power density of incoming transmissions t...
void AddSignal(Ptr< const SpectrumValue > psd)
TracedCallback< Ptr< const SpectrumValue > > m_averagePowerSpectralDensityReportTrace
Ptr< SpectrumValue > m_sumPowerSpectralDensity
Ptr< SpectrumModel > m_spectrumModel
Ptr< MobilityModel > GetMobility()
get the associated MobilityModel instance
virtual void GenerateReport()
void SetMobility(Ptr< MobilityModel > m)
Set the mobility model associated with this device.
Ptr< const SpectrumModel > GetRxSpectrumModel() const
Ptr< AntennaModel > GetRxAntenna()
get the AntennaModel used by the NetDevice for reception
void SubtractSignal(Ptr< const SpectrumValue > psd)
a unique identifier for an interface.
Definition: type-id.h:58
Ptr< MobilityModel > m_mobility
Ptr< SpectrumValue > m_energySpectralDensity
void SetAntenna(Ptr< AntennaModel > a)
set the AntennaModel to be used