satellite-stats-plt-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Magister Solutions
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: Budiarto Herman <budiarto.herman@magister.fi>
19  *
20  */
21 
22 #ifndef SATELLITE_STATS_PLT_HELPER_H
23 #define SATELLITE_STATS_PLT_HELPER_H
24 
25 #include <ns3/address.h>
26 #include <ns3/collector-map.h>
27 #include <ns3/ptr.h>
28 #include <ns3/satellite-stats-helper.h>
29 
30 #include <list>
31 #include <map>
32 
33 namespace ns3
34 {
35 
36 // BASE CLASS /////////////////////////////////////////////////////////////////
37 
38 class SatHelper;
39 class Node;
40 class Time;
41 class DataCollectionObject;
42 class DistributionCollector;
43 
49 {
50  public:
51  // inherited from SatStatsHelper base class
52  SatStatsPltHelper(Ptr<const SatHelper> satHelper);
53 
57  virtual ~SatStatsPltHelper();
58 
62  static TypeId GetTypeId();
63 
67  void SetAveragingMode(bool averagingMode);
68 
72  bool GetAveragingMode() const;
73 
78  void InstallProbes();
79 
89  void RxPltCallback(const Time& plt, const Address& from);
90 
91  protected:
92  // inherited from SatStatsHelper base class
93  void DoInstall();
94 
98  virtual void DoInstallProbes() = 0;
99 
110  void SaveAddressAndIdentifier(Ptr<Node> utNode);
111 
117  bool ConnectProbeToCollector(Ptr<Probe> probe, uint32_t identifier);
118 
125  void PassSampleToCollector(const Time& plt, uint32_t identifier);
126 
128  CollectorMap m_terminalCollectors;
129 
131  Ptr<DistributionCollector> m_averagingCollector;
132 
134  Ptr<DataCollectionObject> m_aggregator;
135 
137  std::map<const Address, uint32_t> m_identifierMap;
138 
139  private:
141 
142 }; // end of class SatStatsPltHelper
143 
144 // FORWARD LINK APPLICATION-LEVEL /////////////////////////////////////////////
145 
146 class Probe;
147 
149 {
150  public:
151  // inherited from SatStatsHelper base class
152  SatStatsFwdAppPltHelper(Ptr<const SatHelper> satHelper);
153 
157  virtual ~SatStatsFwdAppPltHelper();
158 
162  static TypeId GetTypeId();
163 
164  protected:
165  // inherited from SatStatsFwdAppPltHelper base class
166  void DoInstallProbes();
167 
168  private:
170  std::list<Ptr<Probe>> m_probes;
171 
172 }; // end of class SatStatsFwdAppPltHelper
173 
174 // RETURN LINK APPLICATION-LEVEL //////////////////////////////////////////////
175 
177 {
178  public:
179  // inherited from SatStatsHelper base class
180  SatStatsRtnAppPltHelper(Ptr<const SatHelper> satHelper);
181 
185  virtual ~SatStatsRtnAppPltHelper();
186 
190  static TypeId GetTypeId();
191 
198  void Ipv4Callback(const Time& plt, const Address& from);
199 
200  protected:
201  // inherited from SatStatsRtnAppPltHelper base class
202  void DoInstallProbes();
203 
204  private:
213  void SaveIpv4AddressAndIdentifier(Ptr<Node> utUserNode);
214 
216 
217 }; // end of class SatStatsRtnAppPltHelper
218 
219 } // end of namespace ns3
220 
221 #endif /* SATELLITE_STATS_PLT_HELPER_H */
virtual ~SatStatsFwdAppPltHelper()
Destructor for SatStatsFwdAppPltHelper.
SatStatsFwdAppPltHelper(Ptr< const SatHelper > satHelper)
std::list< Ptr< Probe > > m_probes
Maintains a list of probes created by this helper.
static TypeId GetTypeId()
inherited from ObjectBase base class
Parent abstract class of all satellite statistics helpers.
Base class for PLT statistics helpers.
static TypeId GetTypeId()
inherited from ObjectBase base class
virtual void DoInstallProbes()=0
void RxPltCallback(const Time &plt, const Address &from)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
CollectorMap m_terminalCollectors
Maintains a list of collectors created by this helper.
Ptr< DistributionCollector > m_averagingCollector
The final collector utilized in averaged output (histogram, PDF, and CDF).
bool ConnectProbeToCollector(Ptr< Probe > probe, uint32_t identifier)
Connect the probe to the right collector.
bool m_averagingMode
AveragingMode attribute.
void SetAveragingMode(bool averagingMode)
virtual ~SatStatsPltHelper()
/ Destructor.
void SaveAddressAndIdentifier(Ptr< Node > utNode)
Save the address and the proper identifier from the given UT node.
SatStatsPltHelper(Ptr< const SatHelper > satHelper)
void InstallProbes()
Set up several probes or other means of listeners and connect them to the collectors.
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
void PassSampleToCollector(const Time &plt, uint32_t identifier)
Find a collector with the right identifier and pass a sample data to it.
std::map< const Address, uint32_t > m_identifierMap
Map of address and the identifier associated with it (for return link).
void Ipv4Callback(const Time &plt, const Address &from)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
virtual ~SatStatsRtnAppPltHelper()
/ Destructor.
void SaveIpv4AddressAndIdentifier(Ptr< Node > utUserNode)
Save the IPv4 address and the proper identifier from the given UT user node.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsRtnAppPltHelper(Ptr< const SatHelper > satHelper)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.