Loading...
Searching...
No Matches
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
26
27#include "ns3/address.h"
28#include "ns3/collector-map.h"
29#include "ns3/ptr.h"
30
31#include <list>
32#include <map>
33#include <utility>
34
35namespace ns3
36{
37
38// BASE CLASS /////////////////////////////////////////////////////////////////
39
40class SatHelper;
41class Node;
42class Time;
43class DataCollectionObject;
44class DistributionCollector;
45
51{
52 public:
53 // inherited from SatStatsHelper base class
54 SatStatsPltHelper(Ptr<const SatHelper> satHelper);
55
59 virtual ~SatStatsPltHelper();
60
64 static TypeId GetTypeId();
65
69 void SetAveragingMode(bool averagingMode);
70
74 bool GetAveragingMode() const;
75
80 void InstallProbes();
81
91 void RxPltCallback(const Time& plt, const Address& from);
92
93 protected:
94 // inherited from SatStatsHelper base class
95 void DoInstall();
96
100 virtual void DoInstallProbes() = 0;
101
107 bool ConnectProbeToCollector(Ptr<Probe> probe, uint32_t identifier);
108
114 bool DisconnectProbeFromCollector(Ptr<Probe> probe, uint32_t identifier);
115
122 void PassSampleToCollector(const Time& plt, uint32_t identifier);
123
126
128 Ptr<DistributionCollector> m_averagingCollector;
129
131 Ptr<DataCollectionObject> m_aggregator;
132
133 private:
135
136}; // end of class SatStatsPltHelper
137
138// FORWARD LINK APPLICATION-LEVEL /////////////////////////////////////////////
139
140class Probe;
141
143{
144 public:
145 // inherited from SatStatsHelper base class
146 SatStatsFwdAppPltHelper(Ptr<const SatHelper> satHelper);
147
151 virtual ~SatStatsFwdAppPltHelper();
152
156 static TypeId GetTypeId();
157
161 virtual void UpdateIdentifierOnProbes();
162
163 protected:
164 // inherited from SatStatsFwdAppPltHelper base class
165 void DoInstallProbes();
166
167 private:
169 std::map<Ptr<Probe>, std::pair<Ptr<Node>, uint32_t>> m_probes;
170
171}; // end of class SatStatsFwdAppPltHelper
172
173// RETURN LINK APPLICATION-LEVEL //////////////////////////////////////////////
174
176{
177 public:
178 // inherited from SatStatsHelper base class
179 SatStatsRtnAppPltHelper(Ptr<const SatHelper> satHelper);
180
184 virtual ~SatStatsRtnAppPltHelper();
185
189 static TypeId GetTypeId();
190
197 void Ipv4Callback(const Time& plt, const Address& from);
198
199 protected:
200 // inherited from SatStatsRtnAppPltHelper base class
201 void DoInstallProbes();
202
203 private:
212 void SaveIpv4AddressAndIdentifier(Ptr<Node> utUserNode);
213
215
216}; // end of class SatStatsRtnAppPltHelper
217
218} // end of namespace ns3
219
220#endif /* SATELLITE_STATS_PLT_HELPER_H */
Build a satellite network set with needed objects and configuration.
virtual ~SatStatsFwdAppPltHelper()
Destructor for SatStatsFwdAppPltHelper.
SatStatsFwdAppPltHelper(Ptr< const SatHelper > satHelper)
std::map< Ptr< Probe >, std::pair< Ptr< Node >, uint32_t > > m_probes
Maintains a list of probes created by this helper.
virtual void UpdateIdentifierOnProbes()
Change identifier used on probes, when handovers occur.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsHelper(Ptr< const SatHelper > satHelper)
Creates a new helper instance.
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)
bool DisconnectProbeFromCollector(Ptr< Probe > probe, uint32_t identifier)
Disconnect the probe from the right collector.
virtual ~SatStatsPltHelper()
/ Destructor.
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.
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.