A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  ;
27 
29 {
30  static TypeId tid = TypeId ("ns3::UanPhyCalcSinr")
31  .SetParent<Object> ();
32  return tid;
33 }
34 
35 void
37 {
38 }
39 
40 void
42 {
43  Clear ();
45 }
46 
48  ;
49 
51 {
52  static TypeId tid = TypeId ("ns3::UanPhyPer")
53  .SetParent<Object> ();
54  return tid;
55 }
56 
57 void
59 {
60 }
61 
62 void
64 {
65  Clear ();
67 }
68 
70  ;
71 
73 {
74  static TypeId tid = TypeId ("ns3::UanPhy")
75  .SetParent<Object> ()
76  .AddTraceSource ("PhyTxBegin",
77  "Trace source indicating a packet has begun transmitting over the channel medium.",
79  .AddTraceSource ("PhyTxEnd",
80  "Trace source indicating a packet has been completely transmitted over the channel.",
82  .AddTraceSource ("PhyTxDrop",
83  "Trace source indicating a packet has been dropped by the device during transmission.",
85  .AddTraceSource ("PhyRxBegin",
86  "Trace source indicating a packet has begun being received from the channel medium by the device.",
88  .AddTraceSource ("PhyRxEnd",
89  "Trace source indicating a packet has been completely received from the channel medium by the device.",
91  .AddTraceSource ("PhyRxDrop",
92  "Trace source indicating a packet has been dropped by the device during reception.",
94  ;
95  return tid;
96 }
97 
98 
99 void
101 {
102  m_phyTxBeginTrace (packet);
103 }
104 
105 void
107 {
108  m_phyTxEndTrace (packet);
109 }
110 
111 void
113 {
114  m_phyTxDropTrace (packet);
115 }
116 
117 void
119 {
120  m_phyRxBeginTrace (packet);
121 }
122 
123 void
125 {
126  m_phyRxEndTrace (packet);
127 }
128 
129 void
131 {
132  m_phyRxDropTrace (packet);
133 }
134 
135 } // namespace ns3
TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
Trace source indicating a packet has begun transmitting over the channel medium.
Definition: uan-phy.h:509
void NotifyRxDrop(Ptr< const Packet > packet)
Called when the Phy drops a packet.
Definition: uan-phy.cc:130
TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
Trace source indicating a packet has been dropped by the device during reception. ...
Definition: uan-phy.h:549
TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
Trace source indicating a packet has been dropped by the device during transmission.
Definition: uan-phy.h:525
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: uan-phy.cc:41
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: object.cc:336
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:112
void NotifyRxEnd(Ptr< const Packet > packet)
Called when a packet is received without error.
Definition: uan-phy.cc:124
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:541
virtual void Clear(void)
Clear all pointer references.
Definition: uan-phy.cc:36
static TypeId GetTypeId(void)
Register this type.
Definition: uan-phy.cc:50
Calculate packet error probability, based on received SINR and modulation (mode). ...
Definition: uan-phy.h:110
void NotifyTxBegin(Ptr< const Packet > packet)
Called when the transducer begins transmitting a packet.
Definition: uan-phy.cc:100
void NotifyRxBegin(Ptr< const Packet > packet)
Called when the Phy begins to receive a packet.
Definition: uan-phy.cc:118
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
static TypeId GetTypeId(void)
Register this type.
Definition: uan-phy.cc:72
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: uan-phy.cc:63
Base class for UAN Phy models.
Definition: uan-phy.h:175
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
Trace source indicating a packet has been completely transmitted over the channel.
Definition: uan-phy.h:517
virtual void Clear(void)
Clear all pointer references.
Definition: uan-phy.cc:58
static TypeId GetTypeId(void)
Register this type.
Definition: uan-phy.cc:28
a base class which provides memory management and object aggregation
Definition: object.h:63
a unique identifier for an interface.
Definition: type-id.h:49
TypeId SetParent(TypeId tid)
Definition: type-id.cc:611
void NotifyTxEnd(Ptr< const Packet > packet)
Called when the transducer finishes transmitting a packet.
Definition: uan-phy.cc:106
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:533