A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-sinr-chunk-processor.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 Centre Tecnologic de Telecomunicacions de Catalunya (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 #include <ns3/log.h>
23 
25 
26 NS_LOG_COMPONENT_DEFINE ("LteSinrChunkProcessor");
27 
28 namespace ns3 {
29 
31 {
32  NS_LOG_FUNCTION (this);
33 }
34 
35 
37  : m_phy (p)
38 {
39  NS_LOG_FUNCTION (this << p);
40  NS_ASSERT (m_phy);
41 }
42 
43 
45 {
46  NS_LOG_FUNCTION (this);
47 }
48 
49 
50 void
52 {
53  NS_LOG_FUNCTION (this);
54  m_sumSinr = 0;
56 }
57 
58 
59 void
61 {
62  NS_LOG_FUNCTION (this << sinr << duration);
63  if (m_sumSinr == 0)
64  {
65  m_sumSinr = Create<SpectrumValue> (sinr.GetSpectrumModel ());
66  }
67  (*m_sumSinr) += sinr * duration.GetSeconds ();
68  m_totDuration += duration;
69 }
70 
71 void
73 {
74  NS_LOG_FUNCTION (this);
75  if (m_totDuration.GetSeconds () > 0)
76  {
78  }
79  else
80  {
81  NS_LOG_WARN ("m_numSinr == 0");
82  }
83 }
84 
85 
86 
87 
89 : m_phy (p)
90 {
91  NS_LOG_FUNCTION (this << p);
92  NS_ASSERT (m_phy);
93 }
94 
95 
97 {
98  NS_LOG_FUNCTION (this);
99 }
100 
101 
102 void
104 {
105  NS_LOG_FUNCTION (this);
106  m_sumSinr = 0;
108 }
109 
110 
111 void
113 {
114  NS_LOG_FUNCTION (this << sinr << duration);
115  if (m_sumSinr == 0)
116  {
117  m_sumSinr = Create<SpectrumValue> (sinr.GetSpectrumModel ());
118  }
119  (*m_sumSinr) += sinr * duration.GetSeconds ();
120  m_totDuration += duration;
121 }
122 
123 void
125 {
126  NS_LOG_FUNCTION (this);
127  if (m_totDuration.GetSeconds () > 0)
128  {
130  }
131  else
132  {
133  NS_LOG_WARN ("m_numSinr == 0");
134  }
135 }
136 
137 
138 } // namespace ns3