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 <set>
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::set<Ptr<SpectrumPhy> >
m_rxPhySet
;
66
};
67
68
typedef
std::map<SpectrumModelUid_t, RxSpectrumModelInfo>
RxSpectrumModelInfoMap_t
;
69
70
71
72
86
class
MultiModelSpectrumChannel
:
public
SpectrumChannel
87
{
88
89
public
:
90
MultiModelSpectrumChannel
();
91
92
static
TypeId
GetTypeId
(
void
);
93
94
// inherited from SpectrumChannel
95
virtual
void
AddPropagationLossModel
(
Ptr<PropagationLossModel>
loss);
96
virtual
void
AddSpectrumPropagationLossModel
(
Ptr<SpectrumPropagationLossModel>
loss);
97
virtual
void
SetPropagationDelayModel
(
Ptr<PropagationDelayModel>
delay);
98
virtual
void
AddRx
(
Ptr<SpectrumPhy>
phy);
99
virtual
void
StartTx
(
Ptr<SpectrumSignalParameters>
params);
100
101
102
// inherited from Channel
103
virtual
uint32_t
GetNDevices
(
void
)
const
;
104
virtual
Ptr<NetDevice>
GetDevice
(uint32_t i)
const
;
105
106
virtual
Ptr<SpectrumPropagationLossModel>
GetSpectrumPropagationLossModel
(
void
);
107
108
109
protected
:
110
void
DoDispose
();
111
112
113
114
private
:
125
TxSpectrumModelInfoMap_t::const_iterator
FindAndEventuallyAddTxSpectrumModel
(
Ptr<const SpectrumModel>
txSpectrumModel);
126
133
virtual
void
StartRx
(
Ptr<SpectrumSignalParameters>
params,
Ptr<SpectrumPhy>
receiver);
134
135
136
141
Ptr<PropagationDelayModel>
m_propagationDelay
;
142
147
Ptr<PropagationLossModel>
m_propagationLoss
;
148
153
Ptr<SpectrumPropagationLossModel>
m_spectrumPropagationLoss
;
154
155
162
TxSpectrumModelInfoMap_t
m_txSpectrumModelInfoMap
;
163
164
170
RxSpectrumModelInfoMap_t
m_rxSpectrumModelInfoMap
;
171
172
uint32_t
m_numDevices
;
173
174
double
m_maxLossDb
;
175
176
TracedCallback<Ptr<SpectrumPhy>
,
Ptr<SpectrumPhy>
,
double
>
m_pathLossTrace
;
177
};
178
179
180
181
}
182
183
184
185
#endif
/* MULTI_MODEL_SPECTRUM_CHANNEL_H */
src
spectrum
model
multi-model-spectrum-channel.h
Generated on Tue May 14 2013 11:08:32 for ns-3 by
1.8.1.2