A Discrete-Event Network Simulator
API
spectrum-error-model.h
Go to the documentation of this file.
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 
47  static TypeId GetTypeId ();
48  virtual ~SpectrumErrorModel ();
49 
54  virtual void StartRx (Ptr<const Packet> p) = 0;
55 
61  virtual void EvaluateChunk (const SpectrumValue& sinr, Time duration) = 0;
62 
67  virtual bool IsRxCorrect () = 0;
68 };
69 
70 
80 {
81 protected:
82  virtual void DoDispose ();
83 
84 public:
89  static TypeId GetTypeId (void);
90  // inherited from SpectrumErrorModel
91  void StartRx (Ptr<const Packet> p);
92  void EvaluateChunk (const SpectrumValue& sinr, Time duration);
93  bool IsRxCorrect ();
94 
95 private:
96  uint32_t m_bytes;
97  uint32_t m_deliverableBytes;
98 
99 };
100 
101 
102 } // namespace ns3
103 
104 
105 
106 #endif /* SPECTRUM_ERROR_MODEL_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::ShannonSpectrumErrorModel::IsRxCorrect
bool IsRxCorrect()
Checks if the packet being received is correct.
Definition: spectrum-error-model.cc:103
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ShannonSpectrumErrorModel::GetTypeId
static TypeId GetTypeId(void)
Register this type.
Definition: spectrum-error-model.cc:52
ns3::Ptr< const Packet >
ns3::ShannonSpectrumErrorModel::StartRx
void StartRx(Ptr< const Packet > p)
Start a packet reception.
Definition: spectrum-error-model.cc:70
ns3::SpectrumErrorModel::EvaluateChunk
virtual void EvaluateChunk(const SpectrumValue &sinr, Time duration)=0
Evaluates a chunk.
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::SpectrumErrorModel::StartRx
virtual void StartRx(Ptr< const Packet > p)=0
Start a packet reception.
ns3::ShannonSpectrumErrorModel::DoDispose
virtual void DoDispose()
Destructor implementation.
Definition: spectrum-error-model.cc:63
ns3::ShannonSpectrumErrorModel
This class implements the error model described in this paper: N.
Definition: spectrum-error-model.h:80
ns3::SpectrumValue
Set of values corresponding to a given SpectrumModel.
Definition: spectrum-value.h:59
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::ShannonSpectrumErrorModel::EvaluateChunk
void EvaluateChunk(const SpectrumValue &sinr, Time duration)
Evaluates a chunk.
Definition: spectrum-error-model.cc:79
ns3::ShannonSpectrumErrorModel::m_bytes
uint32_t m_bytes
Length of the packet being received.
Definition: spectrum-error-model.h:96
ns3::SpectrumErrorModel
Introspection did not find any typical Config paths.
Definition: spectrum-error-model.h:40
ns3::ShannonSpectrumErrorModel::m_deliverableBytes
uint32_t m_deliverableBytes
Bytes that can be received according to the Shnanon's formula.
Definition: spectrum-error-model.h:97
ns3::SpectrumErrorModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition: spectrum-error-model.cc:33
ns3::SpectrumErrorModel::~SpectrumErrorModel
virtual ~SpectrumErrorModel()
Definition: spectrum-error-model.cc:43
ns3::SpectrumErrorModel::IsRxCorrect
virtual bool IsRxCorrect()=0
Checks if the packet being received is correct.