satellite-frame-symbol-load-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 FrameLoadTrace trace source by:
26  * - Budiarto Herman (budiarto.herman@magister.fi)
27  */
28 
29 #ifndef SATELLITE_FRAME_SYMBOL_LOAD_PROBE_H
30 #define SATELLITE_FRAME_SYMBOL_LOAD_PROBE_H
31 
32 #include "ns3/nstime.h"
33 #include "ns3/probe.h"
34 #include "ns3/traced-callback.h"
35 
36 namespace ns3
37 {
38 
48 class SatFrameSymbolLoadProbe : public Probe
49 {
50  public:
55  static TypeId GetTypeId();
56 
61 
65  virtual ~SatFrameSymbolLoadProbe();
66 
73  void SetValue(uint32_t frameId, double loadRatio);
74 
82  static void SetValueByPath(std::string path, uint32_t frameId, double loadRatio);
83 
91  virtual bool ConnectByObject(std::string traceSource, Ptr<Object> obj);
92 
101  virtual void ConnectByPath(std::string path);
102 
110  typedef void (*FrameSymbolLoadCallback)(uint32_t frameId, double loadRatio);
111 
112  private:
120  void TraceSink(uint32_t frameId, double loadRatio);
121 
123  TracedCallback<uint32_t, double> m_output;
124 };
125 
126 } // namespace ns3
127 
128 #endif // SATELLITE_FRAME_SYMBOL_LOAD_PROBE_H
Probe to translate from a FrameLoadTrace trace source.
void TraceSink(uint32_t frameId, double loadRatio)
Method to connect to an underlying ns3::TraceSource with arguments of type double and const Address&.
virtual bool ConnectByObject(std::string traceSource, Ptr< Object > obj)
connect to a trace source attribute provided by a given object
static TypeId GetTypeId()
Get the type ID.
virtual void ConnectByPath(std::string path)
connect to a trace source provided by a config path
virtual ~SatFrameSymbolLoadProbe()
Destructor for SatFrameSymbolLoadProbe.
void SetValue(uint32_t frameId, double loadRatio)
Set a probe value.
TracedCallback< uint32_t, double > m_output
Output trace, the frame ID and ratio of allocated symbols.
void(* FrameSymbolLoadCallback)(uint32_t frameId, double loadRatio)
Callback signature for frame load in unit of symbols.
static void SetValueByPath(std::string path, uint32_t frameId, double loadRatio)
Set a probe value by its name in the Config system.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.