A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
spectrum-error-model.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 CTTC
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Nicola Baldo <nbaldo@cttc.es>
18 */
19
20#ifndef SPECTRUM_ERROR_MODEL_H
21#define SPECTRUM_ERROR_MODEL_H
22
23#include <ns3/nstime.h>
24#include <ns3/object.h>
25#include <ns3/packet.h>
26#include <ns3/ptr.h>
27#include <ns3/spectrum-value.h>
28
29namespace ns3
30{
31
37{
38 public:
43 static TypeId GetTypeId();
44 ~SpectrumErrorModel() override;
45
50 virtual void StartRx(Ptr<const Packet> p) = 0;
51
57 virtual void EvaluateChunk(const SpectrumValue& sinr, Time duration) = 0;
58
63 virtual bool IsRxCorrect() = 0;
64};
65
75{
76 protected:
77 void DoDispose() override;
78
79 public:
84 static TypeId GetTypeId();
85 // inherited from SpectrumErrorModel
86 void StartRx(Ptr<const Packet> p) override;
87 void EvaluateChunk(const SpectrumValue& sinr, Time duration) override;
88 bool IsRxCorrect() override;
89
90 private:
93};
94
95} // namespace ns3
96
97#endif /* SPECTRUM_ERROR_MODEL_H */
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
This class implements the error model described in this paper: N.
void StartRx(Ptr< const Packet > p) override
Start a packet reception.
uint32_t m_bytes
Length of the packet being received.
void EvaluateChunk(const SpectrumValue &sinr, Time duration) override
Evaluates a chunk.
bool IsRxCorrect() override
Checks if the packet being received is correct.
uint32_t m_deliverableBytes
Bytes that can be received according to the Shnanon's formula.
static TypeId GetTypeId()
Register this type.
void DoDispose() override
Destructor implementation.
Introspection did not find any typical Config paths.
virtual void StartRx(Ptr< const Packet > p)=0
Start a packet reception.
static TypeId GetTypeId()
Register this type.
virtual bool IsRxCorrect()=0
Checks if the packet being received is correct.
virtual void EvaluateChunk(const SpectrumValue &sinr, Time duration)=0
Evaluates a chunk.
Set of values corresponding to a given SpectrumModel.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.