A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
uan-transducer-hd.h
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 
35 {
36 public:
37  UanTransducerHd ();
38  virtual ~UanTransducerHd ();
39 
40  static TypeId GetTypeId (void);
41 
42  // inherited methods
43  virtual State GetState (void) const;
44  virtual bool IsRx (void) const;
45  virtual bool IsTx (void) const;
46  virtual const ArrivalList &GetArrivalList (void) const;
47  virtual void Receive (Ptr<Packet> packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp);
48  virtual void Transmit (Ptr<UanPhy> src, Ptr<Packet> packet, double txPowerDb, UanTxMode txMode);
49  virtual void SetChannel (Ptr<UanChannel> chan);
50  virtual Ptr<UanChannel> GetChannel (void) const;
51  virtual void AddPhy (Ptr<UanPhy>);
52  virtual const UanPhyList &GetPhyList (void) const;
53  virtual void Clear (void);
54 
55 private:
56  State m_state;
57  ArrivalList m_arrivalList;
58  UanPhyList m_phyList;
59  Ptr<UanChannel> m_channel;
60  EventId m_endTxEvent;
61  Time m_endTxTime;
62  bool m_cleared;
63 
64  void RemoveArrival (UanPacketArrival arrival);
65  void EndTx (void);
66 protected:
67  virtual void DoDispose ();
68 };
69 
70 }
71 
72 #endif /* UAN_TRANSDUCER_HD_H */
keep track of time unit.
Definition: nstime.h:149
std::list< Ptr< UanPhy > > UanPhyList
UanPhyList is a standard template library list of UanPhy objects.
virtual const UanPhyList & GetPhyList(void) const
virtual bool IsTx(void) const
virtual void Receive(Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
Receive Notify this object that a new packet has arrived at this nodes location.
virtual void DoDispose()
virtual Ptr< UanChannel > GetChannel(void) const
Abstraction of packet modulation information.
Definition: uan-tx-mode.h:36
Virtual base for Transducer objects.
std::list< UanPacketArrival > ArrivalList
Arrival list is a standard template library list of UanPacketArrivals objects.
virtual const ArrivalList & GetArrivalList(void) const
virtual void SetChannel(Ptr< UanChannel > chan)
virtual void AddPhy(Ptr< UanPhy >)
an identifier for simulation events.
Definition: event-id.h:46
virtual void Clear(void)
virtual State GetState(void) const
State
Transducer state (receiving or transmitting)
virtual void Transmit(Ptr< UanPhy > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)
Transmit a packet from this transducer.
virtual bool IsRx(void) const
a unique identifier for an interface.
Definition: type-id.h:44
Half duplex implementation of transducer object.
Class consisting of packet arrival information (Time, RxPower, mode, PDP)