A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
spectrum-error-model.h
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 
22 #ifndef SPECTRUM_ERROR_MODEL_H
23 #define SPECTRUM_ERROR_MODEL_H
24 
25 #include <ns3/spectrum-value.h>
26 #include <ns3/ptr.h>
27 #include <ns3/packet.h>
28 #include <ns3/nstime.h>
29 #include <ns3/object.h>
30 
31 namespace ns3 {
32 
33 
34 
39 class SpectrumErrorModel : public Object
40 {
41 public:
42  virtual ~SpectrumErrorModel ();
43  virtual void StartRx (Ptr<const Packet> p) = 0;
44  virtual void EvaluateChunk (const SpectrumValue& sinr, Time duration) = 0;
45  virtual bool IsRxCorrect () = 0;
46 };
47 
48 
58 {
59 protected:
60  virtual void DoDispose ();
61 
62 public:
63  // inherited from SpectrumErrorModel
64  void StartRx (Ptr<const Packet> p);
65  void EvaluateChunk (const SpectrumValue& sinr, Time duration);
66  bool IsRxCorrect ();
67 
68 private:
69  uint32_t m_bytes;
70  uint32_t m_deliverableBytes;
71 
72 };
73 
74 
75 // class EffectiveSnrSpectrumErrorModel
76 // {
77 // public:
78 
79 // enum ModulationAndCoding {
80 // BPSK_1_2,
81 // BPSK_1_3,
82 // QPSK_1_2,
83 // QPSK_1_3,
84 // QAM16_1_2,
85 // QAM64_1_2
86 // };
87 
88 // void StartRx (uint32_t bytes);
89 // void EvaluateChunk (const SpectrumValue& sinr, Time duration);
90 // bool IsRxCorrect ();
91 
92 // protected:
93 // uint32_t m_bytes;
94 // uint32_t m_deliverableBytes;
95 
96 // };
97 
98 
99 
100 } // namespace ns3
101 
102 
103 
104 #endif /* SPECTRUM_ERROR_MODEL_H */
keep track of time unit.
Definition: nstime.h:149
a base class which provides memory management and object aggregation
Definition: object.h:63
Set of values corresponding to a given SpectrumModel.