A Discrete-Event Network Simulator
API
uan-transducer-hd.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_HD_H
22 #define UAN_TRANSDUCER_HD_H
23 
24 #include "uan-transducer.h"
25 #include "ns3/simulator.h"
26 namespace ns3 {
27 
37 {
38 public:
40  UanTransducerHd ();
42  virtual ~UanTransducerHd ();
43 
48  static TypeId GetTypeId (void);
49 
50  // inherited methods
51  virtual State GetState (void) const;
52  virtual bool IsRx (void) const;
53  virtual bool IsTx (void) const;
54  virtual const ArrivalList &GetArrivalList (void) const;
55  virtual double ApplyRxGainDb (double rxPowerDb, UanTxMode mode);
56  virtual void SetRxGainDb (double gainDb);
57  virtual double GetRxGainDb (void);
58  virtual void Receive (Ptr<Packet> packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp);
59  virtual void Transmit (Ptr<UanPhy> src, Ptr<Packet> packet, double txPowerDb, UanTxMode txMode);
60  virtual void SetChannel (Ptr<UanChannel> chan);
61  virtual Ptr<UanChannel> GetChannel (void) const;
62  virtual void AddPhy (Ptr<UanPhy>);
63  virtual const UanPhyList &GetPhyList (void) const;
64  virtual void Clear (void);
65 
66 private:
73  bool m_cleared;
74  double m_rxGainDb;
75 
81  void RemoveArrival (UanPacketArrival arrival);
83  void EndTx (void);
84 protected:
85  virtual void DoDispose ();
86 
87 }; // class UanTransducerHd
88 
89 } // namespace ns3
90 
91 #endif /* UAN_TRANSDUCER_HD_H */
static TypeId GetTypeId(void)
Register this type.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
EventId m_endTxEvent
Event scheduled for end of transmission.
virtual const UanPhyList & GetPhyList(void) const
Get the list of physical layer above this transducer.
void EndTx(void)
Handle end of transmission event.
std::list< Ptr< UanPhy > > UanPhyList
List of UanPhy objects.
ArrivalList m_arrivalList
List of arriving packets which overlap in time.
virtual bool IsRx(void) const
Is the state receiving (or available for reception)?
Ptr< UanChannel > m_channel
The attached channel.
virtual void Receive(Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
Notify this object that a new packet has arrived at this nodes location.
bool m_cleared
Flab when we&#39;ve been cleared.
virtual void DoDispose()
Destructor implementation.
virtual ~UanTransducerHd()
Dummy destructor, see DoDispose.
The power delay profile returned by propagation models.
Abstraction of packet modulation information.
Definition: uan-tx-mode.h:41
Virtual base for Transducer objects.
std::list< UanPacketArrival > ArrivalList
List of arriving packets overlapping in time.
UanTransducerHd()
Constructor.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual State GetState(void) const
Get the transducer state.
double m_rxGainDb
Receive gain in dB.
virtual double GetRxGainDb(void)
Get the receiver gain added to signal at receiver in dB.
void RemoveArrival(UanPacketArrival arrival)
Remove an entry from the arrival list.
Time m_endTxTime
Time at which transmission will be completed.
virtual const ArrivalList & GetArrivalList(void) const
Get the list of overlapped (in time) packets at this transducer.
virtual double ApplyRxGainDb(double rxPowerDb, UanTxMode mode)
Apply receiver gain in dB to the received power.
virtual void SetChannel(Ptr< UanChannel > chan)
Attach this transducer to a channel.
virtual void AddPhy(Ptr< UanPhy >)
Attach a physical network layer above this transducer.
virtual void SetRxGainDb(double gainDb)
Set the receiver gain.
An identifier for simulation events.
Definition: event-id.h:53
virtual void Clear(void)
Clears all pointer references.
virtual Ptr< UanChannel > GetChannel(void) const
Get the attached channel.
UanPhyList m_phyList
List of physical layers attached above this tranducer.
State
Transducer state.
virtual void Transmit(Ptr< UanPhy > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)
Transmit a packet from this transducer.
virtual bool IsTx(void) const
Is the state transmitting?
a unique identifier for an interface.
Definition: type-id.h:58
State m_state
Transducer state.
Half duplex implementation of transducer object.
Class consisting of packet arrival information (Time, RxPower, mode, PDP).