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