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
uan-tx-mode.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 University of Washington
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: Leonard Tracy <lentracy@gmail.com>
19
*/
20
21
#ifndef UAN_TX_MODE_H
22
#define UAN_TX_MODE_H
23
24
#include "ns3/object.h"
25
#include <map>
26
27
namespace
ns3 {
28
29
class
UanTxModeFactory;
30
class
UanTxMode;
31
36
class
UanTxMode
37
{
38
public
:
39
UanTxMode
();
40
~UanTxMode
();
41
45
typedef
enum
{
46
PSK
,
QAM
,
FSK
,
OTHER
47
}
ModulationType
;
51
ModulationType
GetModType
(
void
)
const
;
55
uint32_t
GetDataRateBps
(
void
)
const
;
59
uint32_t
GetPhyRateSps
(
void
)
const
;
63
uint32_t
GetCenterFreqHz
(
void
)
const
;
67
uint32_t
GetBandwidthHz
(
void
)
const
;
71
uint32_t
GetConstellationSize
(
void
)
const
;
75
std::string
GetName
(
void
)
const
;
79
uint32_t
GetUid
(
void
)
const
;
80
81
private
:
82
friend
class
UanTxModeFactory
;
83
friend
std::ostream &
operator<<
(std::ostream & os,
const
UanTxMode
&mode);
84
friend
std::istream &
operator>>
(std::istream & is,
UanTxMode
&mode);
85
86
87
uint32_t
m_uid
;
88
89
};
93
std::ostream &
operator <<
(std::ostream & os,
const
UanTxMode
&mode);
97
std::istream &
operator >>
(std::istream & is,
const
UanTxMode
&mode);
98
99
class
UanTxModeFactory
100
{
101
public
:
102
UanTxModeFactory
();
103
~UanTxModeFactory
();
104
115
static
UanTxMode
CreateMode
(
UanTxMode::ModulationType
type,
116
uint32_t dataRateBps,
117
uint32_t phyRateSps,
118
uint32_t cfHz,
119
uint32_t bwHz,
120
uint32_t constSize,
121
std::string name);
122
127
static
UanTxMode
GetMode
(std::string name);
132
static
UanTxMode
GetMode
(uint32_t uid);
133
private
:
134
friend
class
UanTxMode
;
135
uint32_t
m_nextUid
;
136
137
struct
UanTxModeItem
138
{
139
UanTxMode::ModulationType
m_type
;
140
uint32_t
m_cfHz
;
141
uint32_t
m_bwHz
;
142
uint32_t
m_dataRateBps
;
143
uint32_t
m_phyRateSps
;
144
uint32_t
m_constSize
;
145
uint32_t
m_uid
;
146
std::string
m_name
;
147
};
148
149
std::map<uint32_t, UanTxModeItem>
m_modes
;
150
bool
NameUsed
(std::string name);
151
static
UanTxModeFactory
&
GetFactory
(
void
);
152
UanTxModeItem
&
GetModeItem
(uint32_t uid);
153
UanTxModeItem
&
GetModeItem
(std::string name);
154
UanTxMode
MakeModeFromItem
(
const
UanTxModeItem
&item);
155
156
};
157
162
class
UanModesList
163
{
164
public
:
165
UanModesList
();
166
virtual
~UanModesList
();
167
171
void
AppendMode
(
UanTxMode
mode);
176
void
DeleteMode
(uint32_t num);
181
UanTxMode
operator[]
(uint32_t index)
const
;
185
uint32_t
GetNModes
(
void
)
const
;
186
187
188
private
:
189
std::vector<UanTxMode>
m_modes
;
190
friend
std::ostream &
operator <<
(std::ostream &os,
const
UanModesList
&ml);
191
friend
std::istream &
operator >>
(std::istream &is,
UanModesList
&ml);
192
};
193
197
std::ostream &
operator <<
(std::ostream &os,
const
UanModesList
&ml);
201
std::istream &
operator >>
(std::istream &is,
UanModesList
&ml);
202
204
ATTRIBUTE_HELPER_HEADER
(
UanModesList
);
205
206
}
// namespace ns3
207
208
#endif
/* UAN_TX_MODE_H */
src
uan
model
uan-tx-mode.h
Generated on Fri Dec 21 2012 19:00:48 for ns-3 by
1.8.1.2