1 /* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 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_SIGNAL_PARAMETERS_H
23 #define SPECTRUM_SIGNAL_PARAMETERS_H
24 
25 
26 #include <ns3/simple-ref-count.h>
27 #include <ns3/ptr.h>
28 #include <ns3/nstime.h>
29 
30 
31 namespace ns3 {
32 
33 class SpectrumPhy;
34 class SpectrumValue;
35 class AntennaModel;
36 
37 /**
38  * \ingroup spectrum
39  *
40  * This struct provides the generic signal representation to be used by
41  * all wireless technologies. Any specific wireless technology is
42  * allowed to define additional signal parameters by inheriting from this
43  * struct and providing additional member variables. This makes sure
44  * that a minimum set of parameters (in particular, the ones needed
45  * for interference calculation) is
46  * common across all wireless technologies, while at the same time
47  * allowing each technology to have its own specific signal parameters.
48  *
49  * Furthermore, since the signal parameters specific of every technology inherit
50  * directly from this struct, each PHY can test (by using a dynamic
51  * cast) if a signal being received belongs to a given technology or not.
52  *
53  * \note when inheriting from this class, make sure that the assignment operator and the copy constructor work properly, making deep copies if needed.
54  */
55 struct SpectrumSignalParameters : public SimpleRefCount<SpectrumSignalParameters>
56 {
57   /**
58    * default constructor
59    */
60   SpectrumSignalParameters ();
61 
62   /**
63    * destructor
64    */
65   virtual ~SpectrumSignalParameters ();
66 
67   /**
68    * copy constructor
69    */
70   SpectrumSignalParameters (const SpectrumSignalParameters& p);
71 
72   /**
73    * make a "virtual" copy of this class, where "virtual" refers to
74    * the fact that if the actual object is a derived class of
75    * SpectrumSignalParameters, then the copy is also a derived class
76    * of the same type.
77    * Each class inheriting from
78    * SpectrumSignalParameters should override this method and use it
79    * to call the copy constructor of the derived class.
80    *
81    * \return a copy of the (possibly derived) class
82    */
83   virtual Ptr<SpectrumSignalParameters> Copy ();
84 
85   /**
86    * The Power Spectral Density of the
87    * waveform, in linear units. The exact unit will depend on the
88    * type of transmission medium involved: W for radio communications, Pa for
89    * underwater acoustic communications. Other transmission media to
90    * be defined.
91    *
92    * \note when SpectrumSignalParameters is copied, only the pointer to the PSD will be copied. This is because SpectrumChannel objects normally overwrite the psd anyway, so there is no point in making a copy.
93    */
94   Ptr <SpectrumValue> psd;
95 
96   /**
97    * The duration of the packet transmission. It is
98    * assumed that the Power Spectral Density remains constant for the
99    * whole duration of the transmission. In other words, all waveform
100    * have a rect shape with respect to time.
101    */
102   Time duration;
103 
104   /**
105    * The SpectrumPhy instance that is making the transmission
106    */
107   Ptr<SpectrumPhy> txPhy;
108 
109   /**
110    * The AntennaModel instance that was used to transmit this signal.
111    */
112   Ptr<AntennaModel> txAntenna;
113 };
114 
115 
116 }
117 
118 
119 
120 
121 #endif /* SPECTRUM_SIGNAL_PARAMETERS_H */
122