author | Mitch Watrous <watrous@u.washington.edu> |
Wed, 18 May 2011 17:24:04 -0700 | |
changeset 7241 | 0a7a16b599e8 |
parent 6801 | f07f7f809160 |
child 7385 | 10beb0e53130 |
permissions | -rw-r--r-- |
6349 | 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 SPECTRUM_TYPE_H |
|
22 |
#define SPECTRUM_TYPE_H |
|
23 |
||
24 |
#include <ns3/log.h> |
|
25 |
#include <iostream> |
|
26 |
#include <vector> |
|
27 |
#include <string> |
|
28 |
||
29 |
||
30 |
namespace ns3 { |
|
31 |
||
32 |
||
33 |
/** |
|
7241
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6801
diff
changeset
|
34 |
* \ingroup spectrum |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6801
diff
changeset
|
35 |
* |
6349 | 36 |
* This class represent a type of signal that can be transmitted by |
37 |
* SpectrumPhy instances over a SpectrumChannel. By means of this |
|
38 |
* class a SpectrumPhy is able to recognize which type of signals it |
|
39 |
* is able to decode (i.e., receive) and which are to be considered |
|
40 |
* only as a source of interference. Note that this distinction of |
|
41 |
* signal types is an abstraction which is introduced only for |
|
42 |
* simulation purposes: in the real world a device needs to infer |
|
43 |
* whether a signal is of a known type by examining at properties of the |
|
44 |
* signal, such as preamble, CRC fields, etc. |
|
45 |
* |
|
46 |
*/ |
|
47 |
class SpectrumType |
|
48 |
{ |
|
49 |
friend class SpectrumTypeFactory; |
|
50 |
||
51 |
public: |
|
52 |
uint32_t GetUid () const; |
|
53 |
std::string GetName () const; |
|
54 |
||
55 |
private: |
|
56 |
SpectrumType (uint32_t m_uid); |
|
57 |
uint32_t m_uid; |
|
58 |
}; |
|
59 |
||
60 |
||
61 |
bool operator== (const SpectrumType& lhs, const SpectrumType& rhs); |
|
62 |
bool operator!= (const SpectrumType& lhs, const SpectrumType& rhs); |
|
63 |
std::ostream& operator<< (std::ostream& os, const SpectrumType& rhs); |
|
64 |
||
65 |
||
66 |
||
7241
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6801
diff
changeset
|
67 |
/** |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6801
diff
changeset
|
68 |
* \ingroup spectrum |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6801
diff
changeset
|
69 |
* |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6801
diff
changeset
|
70 |
*/ |
6349 | 71 |
class SpectrumTypeFactory |
72 |
{ |
|
73 |
||
74 |
public: |
|
75 |
static SpectrumType Create (std::string name); |
|
76 |
static std::string GetNameByUid (uint32_t uid); |
|
77 |
||
78 |
private: |
|
79 |
static std::vector<std::string> m_names; |
|
80 |
}; |
|
81 |
||
82 |
||
83 |
} // namespace ns3 |
|
84 |
||
85 |
||
86 |
#endif /* SPECTRUM_TYPE_H */ |