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-transducer.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_TRANSDUCER_H
22
#define UAN_TRANSDUCER_H
23
24
#include "ns3/object.h"
25
#include "ns3/packet.h"
26
#include "
uan-tx-mode.h
"
27
#include "ns3/uan-prop-model.h"
28
29
#include <list>
30
31
namespace
ns3 {
32
33
class
UanPhy;
34
class
UanChannel;
35
36
42
class
UanPacketArrival
43
{
44
public
:
45
46
/* default constructor so python scan works */
47
UanPacketArrival
()
48
{
49
}
50
58
UanPacketArrival
(
Ptr<Packet>
packet,
double
rxPowerDb,
UanTxMode
txMode,
UanPdp
pdp,
Time
arrTime)
59
:
m_packet
(packet),
60
m_rxPowerDb
(rxPowerDb),
61
m_txMode
(txMode),
62
m_pdp
(pdp),
63
m_arrTime
(arrTime)
64
{
65
}
66
67
~UanPacketArrival
()
68
{
69
m_packet
= 0;
70
}
71
75
inline
Ptr<Packet>
GetPacket
(
void
)
const
76
{
77
return
m_packet
;
78
}
82
inline
double
GetRxPowerDb
(
void
)
const
83
{
84
return
m_rxPowerDb
;
85
}
89
inline
const
UanTxMode
&
GetTxMode
(
void
)
const
90
{
91
return
m_txMode
;
92
}
96
inline
Time
GetArrivalTime
(
void
)
const
97
{
98
return
m_arrTime
;
99
}
103
inline
UanPdp
GetPdp
(
void
)
const
104
{
105
return
m_pdp
;
106
}
107
private
:
108
Ptr<Packet>
m_packet
;
109
double
m_rxPowerDb
;
110
UanTxMode
m_txMode
;
111
UanPdp
m_pdp
;
112
Time
m_arrTime
;
113
};
114
123
class
UanTransducer
:
public
Object
124
{
125
public
:
126
static
TypeId
GetTypeId
(
void
);
127
131
enum
State
{
132
TX
,
RX
133
};
134
138
typedef
std::list<UanPacketArrival>
ArrivalList
;
142
typedef
std::list<Ptr<UanPhy> >
UanPhyList
;
143
147
virtual
State
GetState
(
void
)
const
= 0;
148
152
virtual
bool
IsRx
(
void
)
const
= 0;
156
virtual
bool
IsTx
(
void
)
const
= 0;
160
virtual
const
ArrivalList
&
GetArrivalList
(
void
)
const
= 0;
168
virtual
void
Receive
(
Ptr<Packet>
packet,
double
rxPowerDb,
UanTxMode
txMode,
UanPdp
pdp) = 0;
176
virtual
void
Transmit
(
Ptr<UanPhy>
src,
Ptr<Packet>
packet,
double
txPowerDb,
UanTxMode
txMode) = 0;
180
virtual
void
SetChannel
(
Ptr<UanChannel>
chan) = 0;
184
virtual
Ptr<UanChannel>
GetChannel
(
void
)
const
= 0;
188
virtual
void
AddPhy
(
Ptr<UanPhy>
phy) = 0;
192
virtual
const
UanPhyList
&
GetPhyList
(
void
)
const
= 0;
196
virtual
void
Clear
(
void
) = 0;
197
198
};
199
200
}
// namespace ns3
201
202
#endif
/* UAN_TRANSDUCER_H */
src
uan
model
uan-transducer.h
Generated on Tue Nov 13 2012 10:32:23 for ns-3 by
1.8.1.2