satellite-stats-carrier-id-helper.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2018 CNES
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: Mathias Ettinger <mettinger@toulouse.viveris.com>
19  */
20 
21 #ifndef SATELLITE_STATS_CARRIER_ID_HELPER_H
22 #define SATELLITE_STATS_CARRIER_ID_HELPER_H
23 
24 #include <ns3/address.h>
25 #include <ns3/collector-map.h>
26 #include <ns3/ptr.h>
27 #include <ns3/satellite-phy-rx-carrier.h>
28 #include <ns3/satellite-stats-helper.h>
29 
30 #include <map>
31 
32 namespace ns3
33 {
34 
35 // BASE CLASS /////////////////////////////////////////////////////////////////
36 
37 class SatHelper;
38 class Node;
39 class DataCollectionObject;
40 
46 {
47  public:
48  // inherited from SatStatsHelper base class
49  SatStatsCarrierIdHelper(Ptr<const SatHelper> satHelper);
50 
54  virtual ~SatStatsCarrierIdHelper();
55 
59  static TypeId GetTypeId();
60 
67  void CarrierIdRxCallback(uint32_t carrierId, const Address& from);
68 
72  std::string GetTraceSourceName() const;
73 
79  {
80  return m_carrierType;
81  }
82 
83  protected:
84  // inherited from SatStatsHelper base class
85  void DoInstall();
86 
90  void SetTraceSourceName(std::string traceSourceName);
91 
97  {
98  m_carrierType = carrierType;
99  }
100 
101  private:
109  void SaveAddressAndIdentifier(Ptr<Node> utNode);
110 
112  CollectorMap m_terminalCollectors;
113 
115  Ptr<DataCollectionObject> m_aggregator;
116 
118  std::map<const Address, uint32_t> m_identifierMap;
119 
120  std::string m_traceSourceName;
121 
123 
124 }; // end of class SatStatsCarrierIdHelper
125 
126 } // end of namespace ns3
127 
128 #endif /* SATELLITE_STATS_CARRIER_ID_HELPER_H */
CarrierType
Possible carrier types.
std::map< const Address, uint32_t > m_identifierMap
Map of address and the identifier associated with it (for forward link).
SatStatsCarrierIdHelper(Ptr< const SatHelper > satHelper)
SatPhyRxCarrier::CarrierType GetValidCarrierType() const
Get the valid carrier type.
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
void SetValidCarrierType(SatPhyRxCarrier::CarrierType carrierType)
Set valid carrier type for this statistics helper type.
static TypeId GetTypeId()
inherited from ObjectBase base class
void CarrierIdRxCallback(uint32_t carrierId, 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.
void SaveAddressAndIdentifier(Ptr< Node > utNode)
Save the address and the proper identifier from the given UT node.
void SetTraceSourceName(std::string traceSourceName)
Parent abstract class of all satellite statistics helpers.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.