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
multi-model-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 MULTI_MODEL_SPECTRUM_CHANNEL_H
23
#define MULTI_MODEL_SPECTRUM_CHANNEL_H
24
25
#include <ns3/spectrum-value.h>
26
#include <ns3/spectrum-converter.h>
27
#include <ns3/spectrum-channel.h>
28
#include <ns3/spectrum-propagation-loss-model.h>
29
#include <ns3/propagation-delay-model.h>
30
#include <map>
31
#include <list>
32
33
namespace
ns3 {
34
35
36
typedef
std::map<SpectrumModelUid_t, SpectrumConverter>
SpectrumConverterMap_t
;
37
38
43
class
TxSpectrumModelInfo
44
{
45
public
:
46
TxSpectrumModelInfo
(
Ptr<const SpectrumModel>
txSpectrumModel);
47
48
Ptr<const SpectrumModel>
m_txSpectrumModel
;
49
SpectrumConverterMap_t
m_spectrumConverterMap
;
50
};
51
52
typedef
std::map<SpectrumModelUid_t, TxSpectrumModelInfo>
TxSpectrumModelInfoMap_t
;
53
54
59
class
RxSpectrumModelInfo
60
{
61
public
:
62
RxSpectrumModelInfo
(
Ptr<const SpectrumModel>
rxSpectrumModel);
63
64
Ptr<const SpectrumModel>
m_rxSpectrumModel
;
65
std::list<Ptr<SpectrumPhy> >
m_rxPhyList
;
66
};
67
68
typedef
std::map<SpectrumModelUid_t, RxSpectrumModelInfo>
RxSpectrumModelInfoMap_t
;
69
70
71
72
82
class
MultiModelSpectrumChannel
:
public
SpectrumChannel
83
{
84
85
public
:
86
MultiModelSpectrumChannel
();
87
88
static
TypeId
GetTypeId
(
void
);
89
90
// inherited from SpectrumChannel
91
virtual
void
AddPropagationLossModel
(
Ptr<PropagationLossModel>
loss);
92
virtual
void
AddSpectrumPropagationLossModel
(
Ptr<SpectrumPropagationLossModel>
loss);
93
virtual
void
SetPropagationDelayModel
(
Ptr<PropagationDelayModel>
delay);
94
virtual
void
AddRx
(
Ptr<SpectrumPhy>
phy);
95
virtual
void
StartTx
(
Ptr<SpectrumSignalParameters>
params);
96
97
98
// inherited from Channel
99
virtual
uint32_t
GetNDevices
(
void
)
const
;
100
virtual
Ptr<NetDevice>
GetDevice
(uint32_t i)
const
;
101
102
virtual
Ptr<SpectrumPropagationLossModel>
GetSpectrumPropagationLossModel
(
void
);
103
104
105
protected
:
106
void
DoDispose
();
107
108
109
110
private
:
121
TxSpectrumModelInfoMap_t::const_iterator
FindAndEventuallyAddTxSpectrumModel
(
Ptr<const SpectrumModel>
txSpectrumModel);
122
123
131
void
CheckAddRxSpectrumModel
(
Ptr<SpectrumPhy>
rxPhy,
Ptr<const SpectrumModel>
rxSpectrumModel);
132
133
134
141
virtual
void
StartRx
(
Ptr<SpectrumSignalParameters>
params,
Ptr<SpectrumPhy>
receiver);
142
143
144
149
Ptr<PropagationDelayModel>
m_propagationDelay
;
150
155
Ptr<PropagationLossModel>
m_propagationLoss
;
156
161
Ptr<SpectrumPropagationLossModel>
m_spectrumPropagationLoss
;
162
163
170
TxSpectrumModelInfoMap_t
m_txSpectrumModelInfoMap
;
171
172
178
RxSpectrumModelInfoMap_t
m_rxSpectrumModelInfoMap
;
179
185
std::vector<Ptr<SpectrumPhy> >
m_phyVector
;
186
187
188
double
m_maxLossDb
;
189
190
TracedCallback<Ptr<SpectrumPhy>
,
Ptr<SpectrumPhy>
,
double
>
m_pathLossTrace
;
191
};
192
193
194
195
}
196
197
198
199
#endif
/* MULTI_MODEL_SPECTRUM_CHANNEL_H */
src
spectrum
model
multi-model-spectrum-channel.h
Generated on Tue Nov 13 2012 10:32:22 for ns-3 by
1.8.1.2