A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
spectrum-interference.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_INTERFERENCE_H
23 #define SPECTRUM_INTERFERENCE_H
24 
25 #include <ns3/object.h>
26 #include <ns3/packet.h>
27 #include <ns3/nstime.h>
28 #include <ns3/spectrum-value.h>
29 
30 namespace ns3 {
31 
32 
33 
34 
35 class SpectrumErrorModel;
36 
37 
38 
47 {
48 public:
50  virtual ~SpectrumInterference ();
51 
58 
66 
70  void AbortRx ();
71 
83  bool EndRx ();
84 
85 
94  void AddSignal (Ptr<const SpectrumValue> spd, const Time duration);
95 
96 
103 
104 
105 protected:
106  void DoDispose ();
107 
108 private:
109  void ConditionallyEvaluateChunk ();
110  void DoAddSignal (Ptr<const SpectrumValue> spd);
111  void DoSubtractSignal (Ptr<const SpectrumValue> spd);
112 
113 
114 
115  bool m_receiving;
116 
127  Ptr<const SpectrumValue> m_noise;
128 
132  Ptr<SpectrumErrorModel> m_errorModel;
133 
134 
135 
136 };
137 
138 
139 
140 } // namespace ns3
141 
142 
143 
144 
145 
146 #endif /* SPECTRUM_INTERFERENCE_H */
keep track of time unit.
Definition: nstime.h:149
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
void SetNoisePowerSpectralDensity(Ptr< const SpectrumValue > noisePsd)
void AddSignal(Ptr< const SpectrumValue > spd, const Time duration)
void StartRx(Ptr< const Packet > p, Ptr< const SpectrumValue > rxPsd)
Ptr< SpectrumValue > m_allSignals
Ptr< const SpectrumValue > m_rxSignal
void SetErrorModel(Ptr< SpectrumErrorModel > e)
a base class which provides memory management and object aggregation
Definition: object.h:63