A Discrete-Event Network Simulator
API
single-model-spectrum-channel.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 CTTC
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: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 #ifndef SINGLE_MODEL_SPECTRUM_CHANNEL_H
22 #define SINGLE_MODEL_SPECTRUM_CHANNEL_H
23 
24 
25 #include <ns3/spectrum-channel.h>
26 #include <ns3/spectrum-model.h>
27 #include <ns3/traced-callback.h>
28 
29 namespace ns3 {
30 
31 
32 
41 {
42 
43 public:
45 
50  static TypeId GetTypeId (void);
51 
52  // inherited from SpectrumChannel
53  virtual void RemoveRx (Ptr<SpectrumPhy> phy);
54  virtual void AddRx (Ptr<SpectrumPhy> phy);
55  virtual void StartTx (Ptr<SpectrumSignalParameters> params);
56 
57 
58  // inherited from Channel
59  virtual std::size_t GetNDevices (void) const;
60  virtual Ptr<NetDevice> GetDevice (std::size_t i) const;
61 
63  typedef std::vector<Ptr<SpectrumPhy> > PhyList;
64 
65 private:
66  virtual void DoDispose ();
67 
75 
80 
85 
86 };
87 
88 }
89 
90 #endif /* SINGLE_MODEL_SPECTRUM_CHANNEL_H */
SpectrumChannel implementation which handles a single spectrum model.
Ptr< const SpectrumModel > m_spectrumModel
SpectrumModel that this channel instance is supporting.
virtual void RemoveRx(Ptr< SpectrumPhy > phy)
Remove a SpectrumPhy from a channel.
PhyList m_phyList
List of SpectrumPhy instances attached to the channel.
virtual void DoDispose()
Destructor implementation.
virtual void StartTx(Ptr< SpectrumSignalParameters > params)
Used by attached PHY instances to transmit signals on the channel.
virtual std::size_t GetNDevices(void) const
static TypeId GetTypeId(void)
Get the type ID.
virtual void AddRx(Ptr< SpectrumPhy > phy)
Add a SpectrumPhy to a channel, so it can receive packets.
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
void StartRx(Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver)
Used internally to reschedule transmission after the propagation delay.
std::vector< Ptr< SpectrumPhy > > PhyList
Container: SpectrumPhy objects.
Defines the interface for spectrum-aware channel implementations.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
phy
Definition: third.py:93