author | Vedran Miletić <rivanvx@gmail.com> |
Tue, 02 Aug 2011 17:42:33 -0400 | |
changeset 7385 | 10beb0e53130 |
parent 7343 | b3e668a5949c |
child 7581 | 6ac3fa410583 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7343
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
6349 | 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 |
||
22 |
#ifndef SPECTRUM_CHANNEL_H |
|
23 |
#define SPECTRUM_CHANNEL_H |
|
24 |
||
25 |
#include <ns3/object.h> |
|
26 |
#include <ns3/nstime.h> |
|
27 |
#include <ns3/channel.h> |
|
28 |
#include <ns3/spectrum-type.h> |
|
29 |
||
30 |
namespace ns3 { |
|
31 |
||
32 |
||
33 |
class PacketBurst; |
|
34 |
class SpectrumValue; |
|
35 |
class SpectrumPhy; |
|
36 |
class SpectrumPropagationLossModel; |
|
7343
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
37 |
class PropagationLossModel; |
6349 | 38 |
class PropagationDelayModel; |
39 |
||
40 |
/** |
|
7241
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7142
diff
changeset
|
41 |
* \ingroup spectrum |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7142
diff
changeset
|
42 |
* |
6349 | 43 |
* Defines the interface for spectrum-aware channel implementations |
44 |
* |
|
45 |
*/ |
|
46 |
class SpectrumChannel : public Channel |
|
47 |
{ |
|
48 |
public: |
|
49 |
virtual ~SpectrumChannel (); |
|
50 |
static TypeId GetTypeId (void); |
|
51 |
||
52 |
||
53 |
/** |
|
7343
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
54 |
* set the single-frequency propagation loss model to be used |
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
55 |
* \warning only models that do not depend on the TX power should be used. |
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
56 |
* |
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
57 |
* \param loss a pointer to the propagation loss model to be used. |
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
58 |
*/ |
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
59 |
virtual void AddPropagationLossModel (Ptr<PropagationLossModel> loss) = 0; |
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
60 |
|
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
61 |
/** |
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
62 |
* set the frequency-dependent propagation loss model to be used |
b3e668a5949c
added support for single-freq PropagationLossModel to SpectrumChannel
Nicola Baldo <nbaldo@cttc.es>
parents:
7241
diff
changeset
|
63 |
* \param loss a pointer to the propagation loss model to be used. |
6349 | 64 |
*/ |
65 |
virtual void AddSpectrumPropagationLossModel (Ptr<SpectrumPropagationLossModel> loss) = 0; |
|
66 |
||
67 |
/** |
|
68 |
* set the propagation delay model to be used |
|
69 |
* \param delay Ptr to the propagation delay model to be used. |
|
70 |
*/ |
|
71 |
virtual void SetPropagationDelayModel (Ptr<PropagationDelayModel> delay) = 0; |
|
72 |
||
73 |
||
74 |
/** |
|
75 |
* Used by attached PHY instances to transmit waveforms on the channel |
|
76 |
* |
|
77 |
* @param p the PacketBurst associated with the waveform being transmitted |
|
6706
0a030d4fcc5b
LTE module from GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
6704
diff
changeset
|
78 |
* @param txPsd the Power Spectral Density of the |
6349 | 79 |
* waveform, in linear units. The exact unit will depend on the |
80 |
* type of transmission medium involved: W for radio communications, Pa for |
|
81 |
* underwater acoustic communications. Other transmission media to be defined. |
|
6706
0a030d4fcc5b
LTE module from GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
6704
diff
changeset
|
82 |
* @param st spectrum type |
6349 | 83 |
* @param duration duration of the packet transmission. It is |
84 |
* assumed that the Power Spectral Density remains constant for the |
|
85 |
* whole duration of the transmission. In other words, all waveform |
|
86 |
* have a rect shape with respect to time. |
|
87 |
* @param sender the SpectrumPhy instance making this function call |
|
88 |
*/ |
|
89 |
virtual void StartTx (Ptr<PacketBurst> p, Ptr <SpectrumValue> txPsd, SpectrumType st, Time duration, Ptr<SpectrumPhy> sender) = 0; |
|
90 |
||
91 |
/** |
|
92 |
* @brief add a SpectrumPhy to a channel, so it can receive packets |
|
93 |
* |
|
94 |
* This method is used to attach a SpectrumPhy instance to a |
|
95 |
* SpectrumChannel instance, so that the SpectrumPhy can receive |
|
96 |
* packets sent on that channel. Note that a SpectrumPhy that only |
|
97 |
* transmits (without receiveing ever) does not need to be added to |
|
7142
89a701fec3a1
run check-style.py on src/spectrum
Nicola Baldo <nicola@baldo.biz>
parents:
6801
diff
changeset
|
98 |
* the channel. |
6349 | 99 |
* |
100 |
* This method is to be implemented by all classes inheriting from |
|
7142
89a701fec3a1
run check-style.py on src/spectrum
Nicola Baldo <nicola@baldo.biz>
parents:
6801
diff
changeset
|
101 |
* SpectrumChannel. |
6349 | 102 |
* |
103 |
* @param phy the SpectrumPhy instance to be added to the channel as |
|
7142
89a701fec3a1
run check-style.py on src/spectrum
Nicola Baldo <nicola@baldo.biz>
parents:
6801
diff
changeset
|
104 |
* a receiver. |
6349 | 105 |
*/ |
106 |
virtual void AddRx (Ptr<SpectrumPhy> phy) = 0; |
|
107 |
||
108 |
}; |
|
109 |
||
110 |
||
111 |
||
112 |
} |
|
113 |
||
114 |
||
115 |
||
116 |
#endif /* SPECTRUM_CHANNEL_H */ |