A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
uan-phy.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 University of Washington
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: Leonard Tracy <lentracy@gmail.com>
18 */
19
20#include "uan-phy.h"
21
22namespace ns3
23{
24
25NS_OBJECT_ENSURE_REGISTERED(UanPhyCalcSinr);
26
27TypeId
29{
30 static TypeId tid = TypeId("ns3::UanPhyCalcSinr").SetParent<Object>().SetGroupName("Uan");
31 return tid;
32}
33
34void
36{
37}
38
39void
41{
42 Clear();
44}
45
47
50{
51 static TypeId tid = TypeId("ns3::UanPhyPer").SetParent<Object>().SetGroupName("Uan");
52 return tid;
53}
54
55void
57{
58}
59
60void
62{
63 Clear();
65}
66
68
71{
72 static TypeId tid =
73 TypeId("ns3::UanPhy")
75 .SetGroupName("Uan")
76 .AddTraceSource("PhyTxBegin",
77 "Trace source indicating a packet has "
78 "begun transmitting over the channel medium.",
80 "ns3::Packet::TracedCallback")
81 .AddTraceSource("PhyTxEnd",
82 "Trace source indicating a packet has "
83 "been completely transmitted over the channel.",
85 "ns3::Packet::TracedCallback")
86 .AddTraceSource("PhyTxDrop",
87 "Trace source indicating a packet has "
88 "been dropped by the device during transmission.",
90 "ns3::Packet::TracedCallback")
91 .AddTraceSource("PhyRxBegin",
92 "Trace source indicating a packet has "
93 "begun being received from the channel medium by the device.",
95 "ns3::Packet::TracedCallback")
96 .AddTraceSource("PhyRxEnd",
97 "Trace source indicating a packet has "
98 "been completely received from the channel medium by the device.",
100 "ns3::Packet::TracedCallback")
101 .AddTraceSource("PhyRxDrop",
102 "Trace source indicating a packet has "
103 "been dropped by the device during reception.",
105 "ns3::Packet::TracedCallback");
106 return tid;
107}
108
109void
111{
112 m_phyTxBeginTrace(packet);
113}
114
115void
117{
118 m_phyTxEndTrace(packet);
119}
120
121void
123{
124 m_phyTxDropTrace(packet);
125}
126
127void
129{
130 m_phyRxBeginTrace(packet);
131}
132
133void
135{
136 m_phyRxEndTrace(packet);
137}
138
139void
141{
142 m_phyRxDropTrace(packet);
143}
144
145} // namespace ns3
A base class which provides memory management and object aggregation.
Definition: object.h:89
virtual void DoDispose()
Destructor implementation.
Definition: object.cc:444
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:932
static TypeId GetTypeId()
Register this type.
Definition: uan-phy.cc:28
virtual void Clear()
Clear all pointer references.
Definition: uan-phy.cc:35
void DoDispose() override
Destructor implementation.
Definition: uan-phy.cc:40
Base class for UAN Phy models.
Definition: uan-phy.h:178
static TypeId GetTypeId()
Register this type.
Definition: uan-phy.cc:70
void NotifyTxDrop(Ptr< const Packet > packet)
Called when the transducer attempts to transmit a new packet while already transmitting a prior packe...
Definition: uan-phy.cc:122
ns3::TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
Trace source indicating a packet has begun being received from the channel medium by the device.
Definition: uan-phy.h:534
void NotifyTxEnd(Ptr< const Packet > packet)
Called when the transducer finishes transmitting a packet.
Definition: uan-phy.cc:116
void NotifyRxDrop(Ptr< const Packet > packet)
Called when the Phy drops a packet.
Definition: uan-phy.cc:140
ns3::TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
Trace source indicating a packet has been dropped by the device during transmission.
Definition: uan-phy.h:526
ns3::TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
Trace source indicating a packet has been dropped by the device during reception.
Definition: uan-phy.h:550
ns3::TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
Trace source indicating a packet has been completely received from the channel medium by the device.
Definition: uan-phy.h:542
ns3::TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
Trace source indicating a packet has been completely transmitted over the channel.
Definition: uan-phy.h:518
ns3::TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
Trace source indicating a packet has begun transmitting over the channel medium.
Definition: uan-phy.h:510
void NotifyRxBegin(Ptr< const Packet > packet)
Called when the Phy begins to receive a packet.
Definition: uan-phy.cc:128
void NotifyRxEnd(Ptr< const Packet > packet)
Called when a packet is received without error.
Definition: uan-phy.cc:134
void NotifyTxBegin(Ptr< const Packet > packet)
Called when the transducer begins transmitting a packet.
Definition: uan-phy.cc:110
Calculate packet error probability, based on received SINR and modulation (mode).
Definition: uan-phy.h:110
virtual void Clear()
Clear all pointer references.
Definition: uan-phy.cc:56
static TypeId GetTypeId()
Register this type.
Definition: uan-phy.cc:49
void DoDispose() override
Destructor implementation.
Definition: uan-phy.cc:61
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.