satellite-sinr-probe.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Bucknell University
4  * Copyright (c) 2014 Magister Solutions
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors of original work (application-packet-probe.h) which this work
20  * derives from:
21  * - L. Felipe Perrone (perrone@bucknell.edu)
22  * - Tiago G. Rodrigues (tgr002@bucknell.edu)
23  * - Mitch Watrous (watrous@u.washington.edu)
24  *
25  * Modified for Sinr trace source by:
26  * - Budiarto Herman (budiarto.herman@magister.fi)
27  */
28 
29 #ifndef SATELLITE_SINR_PROBE_H
30 #define SATELLITE_SINR_PROBE_H
31 
32 #include <ns3/address.h>
33 #include <ns3/nstime.h>
34 #include <ns3/probe.h>
35 #include <ns3/traced-callback.h>
36 
37 namespace ns3
38 {
39 
50 class SatSinrProbe : public Probe
51 {
52  public:
57  static TypeId GetTypeId();
58 
62  SatSinrProbe();
63 
67  virtual ~SatSinrProbe();
68 
75  void SetValue(double sinrDb, const Address& address);
76 
84  static void SetValueByPath(std::string path, double sinrDb, const Address& address);
85 
93  virtual bool ConnectByObject(std::string traceSource, Ptr<Object> obj);
94 
103  virtual void ConnectByPath(std::string path);
104 
110  typedef void (*SinrCallback)(double sinr, const Address& from);
111 
112  private:
121  void TraceSink(double sinrDb, const Address& address);
122 
124  TracedCallback<double, const Address&> m_output;
126  TracedCallback<double, double> m_outputSinr;
127 
129  double m_sinr;
130 
132  Address m_address;
133 };
134 
135 } // namespace ns3
136 
137 #endif // SATELLITE_SINR_PROBE_H
Probe to translate from a TraceSource to two more easily parsed TraceSources.
Address m_address
The socket address for the traced packet.
void TraceSink(double sinrDb, const Address &address)
Method to connect to an underlying ns3::TraceSource with arguments of type double and const Address&.
TracedCallback< double, double > m_outputSinr
Output trace, previous SINR and current SINR.
virtual bool ConnectByObject(std::string traceSource, Ptr< Object > obj)
connect to a trace source attribute provided by a given object
virtual ~SatSinrProbe()
Destructor for SatSinrProbe.
SatSinrProbe()
Default constructor.
static void SetValueByPath(std::string path, double sinrDb, const Address &address)
Set a probe value by its name in the Config system.
TracedCallback< double, const Address & > m_output
Output trace, the SINR and source address.
void(* SinrCallback)(double sinr, const Address &from)
Callback signature for SINR and an address.
void SetValue(double sinrDb, const Address &address)
Set a probe value.
static TypeId GetTypeId()
Get the type ID.
double m_sinr
The traced SINR.
virtual void ConnectByPath(std::string path)
connect to a trace source provided by a config path
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.