A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
waveform-generator.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 WAVEFORM_GENERATOR_H
22 #define WAVEFORM_GENERATOR_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 <ns3/trace-source-accessor.h>
33 
34 namespace ns3 {
35 
36 
37 class AntennaModel;
38 
53 {
54 
55 public:
57  virtual ~WaveformGenerator ();
58 
59  static TypeId GetTypeId (void);
60 
61  // inherited from SpectrumPhy
64  void SetDevice (Ptr<NetDevice> d);
70 
71 
78 
85  void SetPeriod (Time period);
86 
87 
93  Time GetPeriod () const;
94 
95 
100  void SetDutyCycle (double value);
101 
106  double GetDutyCycle () const;
107 
113  void SetAntenna (Ptr<AntennaModel> a);
114 
119  virtual void Start ();
120 
125  virtual void Stop ();
126 
127 
128 private:
129  virtual void DoDispose (void);
130 
131  Ptr<MobilityModel> m_mobility;
132  Ptr<AntennaModel> m_antenna;
133  Ptr<NetDevice> m_netDevice;
134  Ptr<SpectrumChannel> m_channel;
135 
136  virtual void GenerateWaveform ();
137 
138  Ptr<SpectrumValue> m_txPowerSpectralDensity;
139  Time m_period;
140  double m_dutyCycle;
141  Time m_startTime;
142  bool m_active;
143 
144  TracedCallback<Ptr<const Packet> > m_phyTxStartTrace;
145  TracedCallback<Ptr<const Packet> > m_phyTxEndTrace;
146 };
147 
148 
149 
150 
151 
152 
153 } // namespace ns3
154 
155 
156 
157 
158 
159 #endif /* WAVEFORM_GENERATOR_H */
virtual void DoDispose(void)
keep track of time unit.
Definition: nstime.h:149
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
void SetDevice(Ptr< NetDevice > d)
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
void StartRx(Ptr< SpectrumSignalParameters > params)
void SetChannel(Ptr< SpectrumChannel > c)
void SetTxPowerSpectralDensity(Ptr< SpectrumValue > txs)
void SetDutyCycle(double value)
Ptr< AntennaModel > GetRxAntenna()
void SetPeriod(Time period)
void SetAntenna(Ptr< AntennaModel > a)
Ptr< MobilityModel > GetMobility()
void SetMobility(Ptr< MobilityModel > m)
Ptr< NetDevice > GetDevice()
a unique identifier for an interface.
Definition: type-id.h:44
Ptr< const SpectrumModel > GetRxSpectrumModel() const