A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
uan-channel.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_CHANNEL_H
22 #define UAN_CHANNEL_H
23 
24 #include "ns3/net-device.h"
25 #include "ns3/channel.h"
26 #include "ns3/packet.h"
27 #include "ns3/uan-prop-model.h"
28 #include "ns3/uan-noise-model.h"
29 
30 #include <list>
31 #include <vector>
32 
33 namespace ns3 {
34 
35 class UanNetDevice;
36 class UanPhy;
37 class UanTransducer;
38 class UanTxMode;
39 
44 class UanChannel : public Channel
45 {
46 public:
50  typedef std::vector<std::pair<Ptr<UanNetDevice>, Ptr<UanTransducer> > > UanDeviceList;
51 
52 
53  UanChannel ();
54  virtual ~UanChannel ();
55 
56  static TypeId GetTypeId ();
57 
58  // Methods inherrited from base class
59  virtual uint32_t GetNDevices (void) const;
60  virtual Ptr<NetDevice> GetDevice (uint32_t i) const;
61 
69  void TxPacket (Ptr<UanTransducer> src, Ptr<Packet> packet, double txPowerDb,
70  UanTxMode txmode);
71 
79 
84 
89  void SetNoiseModel (Ptr<UanNoiseModel> noise);
90 
95  double GetNoiseDbHz (double fKhz);
96 
100  void Clear (void);
101 
102 private:
103  UanDeviceList m_devList;
104  Ptr<UanPropModel> m_prop;
105  Ptr<UanNoiseModel> m_noise;
106  bool m_cleared;
107 
108  void SendUp (uint32_t i, Ptr<Packet> packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp);
109 protected:
110  virtual void DoDispose ();
111 };
112 
113 }
114 
115 #endif /* UAN_CHANNEL_H */
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
Channel class used by UAN devices.
Definition: uan-channel.h:44
Abstract Channel Base Class.
Definition: channel.h:43
double GetNoiseDbHz(double fKhz)
Definition: uan-channel.cc:212
void SetNoiseModel(Ptr< UanNoiseModel > noise)
Definition: uan-channel.cc:198
void TxPacket(Ptr< UanTransducer > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txmode)
Definition: uan-channel.cc:146
void AddDevice(Ptr< UanNetDevice > dev, Ptr< UanTransducer > trans)
Definition: uan-channel.cc:139
Abstraction of packet modulation information.
Definition: uan-tx-mode.h:36
virtual void DoDispose()
Definition: uan-channel.cc:114
void Clear(void)
Definition: uan-channel.cc:78
std::vector< std::pair< Ptr< UanNetDevice >, Ptr< UanTransducer > > > UanDeviceList
UanDeviceList is a standard template vector of pairs (UanNetDevice, UanTransducer) ...
Definition: uan-channel.h:50
virtual uint32_t GetNDevices(void) const
Definition: uan-channel.cc:127
virtual Ptr< NetDevice > GetDevice(uint32_t i) const
Definition: uan-channel.cc:133
void SetPropagationModel(Ptr< UanPropModel > prop)
Definition: uan-channel.cc:120
a unique identifier for an interface.
Definition: type-id.h:44