A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
waveform-generator.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 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
52
class
WaveformGenerator
:
public
SpectrumPhy
53
{
54
55
public
:
56
WaveformGenerator
();
57
virtual
~WaveformGenerator
();
58
59
static
TypeId
GetTypeId
(
void
);
60
61
// inherited from SpectrumPhy
62
void
SetChannel
(
Ptr<SpectrumChannel>
c);
63
void
SetMobility
(
Ptr<MobilityModel>
m);
64
void
SetDevice
(
Ptr<NetDevice>
d);
65
Ptr<MobilityModel>
GetMobility
();
66
Ptr<NetDevice>
GetDevice
();
67
Ptr<const SpectrumModel>
GetRxSpectrumModel
()
const
;
68
Ptr<AntennaModel>
GetRxAntenna
();
69
void
StartRx
(
Ptr<SpectrumSignalParameters>
params);
70
71
77
void
SetTxPowerSpectralDensity
(
Ptr<SpectrumValue>
txs);
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 */
src
spectrum
model
waveform-generator.h
Generated on Tue Oct 9 2012 16:45:46 for ns-3 by
1.8.1.2