A Discrete-Event Network Simulator
API
uan-phy.cc
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 #include "uan-phy.h"
22 
23 namespace ns3 {
24 
25 NS_OBJECT_ENSURE_REGISTERED (UanPhyCalcSinr);
26 
28 {
29  static TypeId tid = TypeId ("ns3::UanPhyCalcSinr")
30  .SetParent<Object> ();
31  return tid;
32 }
33 
34 void
36 {
37 }
38 
39 void
41 {
42  Clear ();
44 }
45 
47 
49 {
50  static TypeId tid = TypeId ("ns3::UanPhyPer")
51  .SetParent<Object> ();
52  return tid;
53 }
54 
55 void
57 {
58 }
59 
60 void
62 {
63  Clear ();
65 }
66 
68 
70 {
71  static TypeId tid = TypeId ("ns3::UanPhy")
72  .SetParent<Object> ()
73  .AddTraceSource ("PhyTxBegin",
74  "Trace source indicating a packet has "
75  "begun transmitting over the channel medium.",
77  "ns3::Packet::TracedCallback")
78  .AddTraceSource ("PhyTxEnd",
79  "Trace source indicating a packet has "
80  "been completely transmitted over the channel.",
82  "ns3::Packet::TracedCallback")
83  .AddTraceSource ("PhyTxDrop",
84  "Trace source indicating a packet has "
85  "been dropped by the device during transmission.",
87  "ns3::Packet::TracedCallback")
88  .AddTraceSource ("PhyRxBegin",
89  "Trace source indicating a packet has "
90  "begun being received from the channel medium by the device.",
92  "ns3::Packet::TracedCallback")
93  .AddTraceSource ("PhyRxEnd",
94  "Trace source indicating a packet has "
95  "been completely received from the channel medium by the device.",
97  "ns3::Packet::TracedCallback")
98  .AddTraceSource ("PhyRxDrop",
99  "Trace source indicating a packet has "
100  "been dropped by the device during reception.",
102  "ns3::Packet::TracedCallback")
103  ;
104  return tid;
105 }
106 
107 
108 void
110 {
111  m_phyTxBeginTrace (packet);
112 }
113 
114 void
116 {
117  m_phyTxEndTrace (packet);
118 }
119 
120 void
122 {
123  m_phyTxDropTrace (packet);
124 }
125 
126 void
128 {
129  m_phyRxBeginTrace (packet);
130 }
131 
132 void
134 {
135  m_phyRxEndTrace (packet);
136 }
137 
138 void
140 {
141  m_phyRxDropTrace (packet);
142 }
143 
144 } // namespace ns3
ns3::TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
Trace source indicating a packet has been dropped by the device during transmission.
Definition: uan-phy.h:536
ns3::TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
Trace source indicating a packet has been dropped by the device during reception. ...
Definition: uan-phy.h:560
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
void NotifyRxDrop(Ptr< const Packet > packet)
Called when the Phy drops a packet.
Definition: uan-phy.cc:139
virtual void DoDispose(void)
Destructor implementation.
Definition: uan-phy.cc:40
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:338
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:121
void NotifyRxEnd(Ptr< const Packet > packet)
Called when a packet is received without error.
Definition: uan-phy.cc:133
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
virtual void Clear(void)
Clear all pointer references.
Definition: uan-phy.cc:35
static TypeId GetTypeId(void)
Register this type.
Definition: uan-phy.cc:48
ns3::TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
Trace source indicating a packet has begun transmitting over the channel medium.
Definition: uan-phy.h:520
Calculate packet error probability, based on received SINR and modulation (mode). ...
Definition: uan-phy.h:110
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:552
void NotifyTxBegin(Ptr< const Packet > packet)
Called when the transducer begins transmitting a packet.
Definition: uan-phy.cc:109
void NotifyRxBegin(Ptr< const Packet > packet)
Called when the Phy begins to receive a packet.
Definition: uan-phy.cc:127
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Register this type.
Definition: uan-phy.cc:69
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:544
virtual void DoDispose(void)
Destructor implementation.
Definition: uan-phy.cc:61
Base class for UAN Phy models.
Definition: uan-phy.h:175
virtual void Clear(void)
Clear all pointer references.
Definition: uan-phy.cc:56
ns3::TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
Trace source indicating a packet has been completely transmitted over the channel.
Definition: uan-phy.h:528
static TypeId GetTypeId(void)
Register this type.
Definition: uan-phy.cc:27
A base class which provides memory management and object aggregation.
Definition: object.h:87
a unique identifier for an interface.
Definition: type-id.h:51
TypeId SetParent(TypeId tid)
Definition: type-id.cc:631
void NotifyTxEnd(Ptr< const Packet > packet)
Called when the transducer finishes transmitting a packet.
Definition: uan-phy.cc:115