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  .SetGroupName ("Uan")
32  ;
33  return tid;
34 }
35 
36 void
38 {
39 }
40 
41 void
43 {
44  Clear ();
46 }
47 
49 
51 {
52  static TypeId tid = TypeId ("ns3::UanPhyPer")
53  .SetParent<Object> ()
54  .SetGroupName ("Uan")
55  ;
56  return tid;
57 }
58 
59 void
61 {
62 }
63 
64 void
66 {
67  Clear ();
69 }
70 
72 
74 {
75  static TypeId tid = TypeId ("ns3::UanPhy")
76  .SetParent<Object> ()
77  .SetGroupName ("Uan")
78  .AddTraceSource ("PhyTxBegin",
79  "Trace source indicating a packet has "
80  "begun transmitting over the channel medium.",
82  "ns3::Packet::TracedCallback")
83  .AddTraceSource ("PhyTxEnd",
84  "Trace source indicating a packet has "
85  "been completely transmitted over the channel.",
87  "ns3::Packet::TracedCallback")
88  .AddTraceSource ("PhyTxDrop",
89  "Trace source indicating a packet has "
90  "been dropped by the device during transmission.",
92  "ns3::Packet::TracedCallback")
93  .AddTraceSource ("PhyRxBegin",
94  "Trace source indicating a packet has "
95  "begun being received from the channel medium by the device.",
97  "ns3::Packet::TracedCallback")
98  .AddTraceSource ("PhyRxEnd",
99  "Trace source indicating a packet has "
100  "been completely received from the channel medium by the device.",
102  "ns3::Packet::TracedCallback")
103  .AddTraceSource ("PhyRxDrop",
104  "Trace source indicating a packet has "
105  "been dropped by the device during reception.",
107  "ns3::Packet::TracedCallback")
108  ;
109  return tid;
110 }
111 
112 
113 void
115 {
116  m_phyTxBeginTrace (packet);
117 }
118 
119 void
121 {
122  m_phyTxEndTrace (packet);
123 }
124 
125 void
127 {
128  m_phyTxDropTrace (packet);
129 }
130 
131 void
133 {
134  m_phyRxBeginTrace (packet);
135 }
136 
137 void
139 {
140  m_phyRxEndTrace (packet);
141 }
142 
143 void
145 {
146  m_phyRxDropTrace (packet);
147 }
148 
149 } // 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:529
ns3::TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
Trace source indicating a packet has been dropped by the device during reception. ...
Definition: uan-phy.h:553
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
void NotifyRxDrop(Ptr< const Packet > packet)
Called when the Phy drops a packet.
Definition: uan-phy.cc:144
virtual void DoDispose(void)
Destructor implementation.
Definition: uan-phy.cc:42
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:346
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:126
void NotifyRxEnd(Ptr< const Packet > packet)
Called when a packet is received without error.
Definition: uan-phy.cc:138
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:37
static TypeId GetTypeId(void)
Register this type.
Definition: uan-phy.cc:50
ns3::TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
Trace source indicating a packet has begun transmitting over the channel medium.
Definition: uan-phy.h:513
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:545
void NotifyTxBegin(Ptr< const Packet > packet)
Called when the transducer begins transmitting a packet.
Definition: uan-phy.cc:114
void NotifyRxBegin(Ptr< const Packet > packet)
Called when the Phy begins to receive a packet.
Definition: uan-phy.cc:132
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Register this type.
Definition: uan-phy.cc:73
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:537
virtual void DoDispose(void)
Destructor implementation.
Definition: uan-phy.cc:65
Base class for UAN Phy models.
Definition: uan-phy.h:175
virtual void Clear(void)
Clear all pointer references.
Definition: uan-phy.cc:60
ns3::TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
Trace source indicating a packet has been completely transmitted over the channel.
Definition: uan-phy.h:521
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:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
void NotifyTxEnd(Ptr< const Packet > packet)
Called when the transducer finishes transmitting a packet.
Definition: uan-phy.cc:120