A Discrete-Event Network Simulator
API
snr-to-block-error-rate-manager.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008, 2009 INRIA, UDcast
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: Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19  * <amine.ismail@udcast.com>
20  */
21 
22 
23 #ifndef SNR_TO_BLOCK_ERROR_RATE_MANAGER_H
24 #define SNR_TO_BLOCK_ERROR_RATE_MANAGER_H
25 
26 #include "ns3/snr-to-block-error-rate-record.h"
27 #include <vector>
28 #include "ns3/ptr.h"
29 
30 namespace ns3 {
31 
56 {
57 public:
64  void SetTraceFilePath (char *traceFilePath);
68  std::string GetTraceFilePath (void);
75  double GetBlockErrorRate (double SNR, uint8_t modulation);
83  GetSNRToBlockErrorRateRecord (double SNR, uint8_t modulation);
89  void LoadTraces (void);
93  void LoadDefaultTraces (void);
97  void ReLoadTraces (void);
102  void ActivateLoss (bool loss);
103 private:
105  void ClearRecords (void);
106  uint8_t m_activateLoss;
107  std::string m_traceFilePath;
108 
109  std::vector<SNRToBlockErrorRateRecord *> * m_recordModulation[7];
110 
111 };
112 }
113 
114 #endif /* SNR_TO_BLOCK_ERROR_RATE_MANAGER_H */
void LoadDefaultTraces(void)
Loads the default traces from default-traces.h file.
This class represents a record (handled by SnrToBlockErrorRate manager) that keeps a mapping between ...
SNRToBlockErrorRateRecord * GetSNRToBlockErrorRateRecord(double SNR, uint8_t modulation)
returns a record of type SNRToBlockErrorRateRecord corresponding to a given modulation and SNR value ...
void ActivateLoss(bool loss)
If activate loss is called with false, all the returned BlcER will be 0 (no losses) ...
void SetTraceFilePath(char *traceFilePath)
Set the path of the repository containing the traces.
void LoadTraces(void)
Loads the traces form the repository specified in the constructor or set by SetTraceFilePath function...
double GetBlockErrorRate(double SNR, uint8_t modulation)
returns the Block Error Rate for a given modulation and SNR value
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::vector< SNRToBlockErrorRateRecord * > * m_recordModulation[7]
record modulation
void ClearRecords(void)
Clear records function.
This class handles the SNR to BlcER traces.