A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
spectrum-data.h
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License version 2 as
4  * published by the Free Software Foundation;
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public License
12  * along with this program; if not, write to the Free Software
13  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14  *
15  * Author: Abdulla K. Al-Ali <abdulla.alali@qu.edu.qa>
16  */
17 
18 
19 #ifndef SPECTRUM_DATA_H
20 #define SPECTRUM_DATA_H
21 
22 
23 #include "common-cognitive-header.h"
24 #include <stdio.h>
25 #include "ns3/object.h"
26 
27 // Verbose mode
28 #define IO_SPECTRUM_DEBUG 1
29 
30 namespace ns3 {
31 // Spectrum Entry Information
32 struct SpectrumEntry {
33 
34  // current bandwidth
35  double bandwidth;
36 
37  // Packet Error Rate (PER) value
38  double per;
39 
40  };
41 
42 
43 class SpectrumData : public Object {
44 
45  public:
46  static TypeId GetTypeId (void);
47  // SpectrumData Initializer
48  SpectrumData();
49 
50  // Return the spectrum-entry information for the current channel
51  SpectrumEntry GetSpectrumData(int channel);
52 
53  private:
54 
55  // read the current spectrum file, and load the information in the spectrum_table_
56  void ReadSpectrumFile(char *fileName);
57 
58  // Spectrum_table, loaded by the spectrum file
59  SpectrumEntry m_spectrumTable_[MAX_CHANNELS];
60 
61  };
62 
63 }
64 #endif
65 
66 
67 
Definition: spectrum-data.h:32
a base class which provides memory management and object aggregation
Definition: object.h:63
a unique identifier for an interface.
Definition: type-id.h:44