A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
spectrum-model.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 CTTC
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Nicola Baldo <nbaldo@cttc.es>
18
*/
19
20
#ifndef SPECTRUM_MODEL_H
21
#define SPECTRUM_MODEL_H
22
23
#include <ns3/simple-ref-count.h>
24
25
#include <vector>
26
27
namespace
ns3
28
{
29
51
struct
BandInfo
52
{
53
double
fl
;
54
double
fc
;
55
double
fh
;
56
};
57
59
typedef
std::vector<BandInfo>
Bands
;
60
62
typedef
uint32_t
SpectrumModelUid_t
;
63
71
class
SpectrumModel
:
public
SimpleRefCount
<SpectrumModel>
72
{
73
public
:
80
friend
bool
operator==
(
const
SpectrumModel
& lhs,
const
SpectrumModel
& rhs);
81
91
SpectrumModel
(
const
std::vector<double>& centerFreqs);
92
99
SpectrumModel
(
const
Bands
& bands);
100
108
SpectrumModel
(
Bands
&& bands);
109
114
size_t
GetNumBands
()
const
;
115
120
SpectrumModelUid_t
GetUid
()
const
;
121
127
Bands::const_iterator
Begin
()
const
;
133
Bands::const_iterator
End
()
const
;
134
141
bool
IsOrthogonal
(
const
SpectrumModel
& other)
const
;
142
143
private
:
144
Bands
m_bands
;
145
SpectrumModelUid_t
m_uid
;
146
static
SpectrumModelUid_t
m_uidCount
;
147
};
148
149
}
// namespace ns3
150
151
#endif
/* SPECTRUM_MODEL_H */
ns3::SimpleRefCount
A template-based reference counting class.
Definition:
simple-ref-count.h:81
ns3::SpectrumModel
Set of frequency values implementing the domain of the functions in the Function Space defined by Spe...
Definition:
spectrum-model.h:72
ns3::SpectrumModel::operator==
friend bool operator==(const SpectrumModel &lhs, const SpectrumModel &rhs)
Comparison operator.
Definition:
spectrum-model.cc:34
ns3::SpectrumModel::IsOrthogonal
bool IsOrthogonal(const SpectrumModel &other) const
Check if another SpectrumModels has bands orthogonal to our bands.
Definition:
spectrum-model.cc:111
ns3::SpectrumModel::m_uidCount
static SpectrumModelUid_t m_uidCount
counter to assign m_uids
Definition:
spectrum-model.h:146
ns3::SpectrumModel::m_uid
SpectrumModelUid_t m_uid
unique id for a given set of frequencies
Definition:
spectrum-model.h:145
ns3::SpectrumModel::End
Bands::const_iterator End() const
Const Iterator to the model Bands container end.
Definition:
spectrum-model.cc:93
ns3::SpectrumModel::GetNumBands
size_t GetNumBands() const
Definition:
spectrum-model.cc:99
ns3::SpectrumModel::Begin
Bands::const_iterator Begin() const
Const Iterator to the model Bands container start.
Definition:
spectrum-model.cc:87
ns3::SpectrumModel::GetUid
SpectrumModelUid_t GetUid() const
Definition:
spectrum-model.cc:105
ns3::SpectrumModel::m_bands
Bands m_bands
Actual definition of frequency bands within this SpectrumModel.
Definition:
spectrum-model.h:144
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Bands
std::vector< BandInfo > Bands
Container of BandInfo.
Definition:
spectrum-model.h:59
ns3::SpectrumModelUid_t
uint32_t SpectrumModelUid_t
Uid for SpectrumModels.
Definition:
spectrum-model.h:62
ns3::BandInfo
The building block of a SpectrumModel.
Definition:
spectrum-model.h:52
ns3::BandInfo::fc
double fc
center frequency
Definition:
spectrum-model.h:54
ns3::BandInfo::fl
double fl
lower limit of subband
Definition:
spectrum-model.h:53
ns3::BandInfo::fh
double fh
upper limit of subband
Definition:
spectrum-model.h:55
src
spectrum
model
spectrum-model.h
Generated on Sun Jul 2 2023 18:22:03 for ns-3 by
1.9.6