satellite-beam-channel-pair.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_BEAM_CHANNEL_PAIR_H
22 #define SATELLITE_BEAM_CHANNEL_PAIR_H
23 
24 #include "satellite-channel.h"
25 #include "satellite-typedefs.h"
26 
27 #include <ns3/object.h>
28 
29 #include <map>
30 
31 namespace ns3
32 {
33 
47 class SatChannelPair : public Object
48 {
49  public:
50  typedef std::pair<Ptr<SatChannel>, Ptr<SatChannel>>
51  ChannelPair_t; // forward = first, return = second
52 
57 
61  virtual ~SatChannelPair();
62 
67  static TypeId GetTypeId(void);
68 
75  ChannelPair_t GetChannelPair(uint32_t satId, uint32_t beamId) const;
76  Ptr<SatChannel> GetForwardChannel(uint32_t satId, uint32_t frequencyId) const;
77  Ptr<SatChannel> GetReturnChannel(uint32_t satId, uint32_t frequencyId) const;
78 
85  // bool HasChannelPair (uint32_t frequencyId);
86  bool HasFwdChannel(uint32_t satId, uint32_t frequencyId) const;
87  bool HasRtnChannel(uint32_t satId, uint32_t frequencyId) const;
88 
95  // void UpdateBeamsForFrequency (uint32_t beamdId, uint32_t frequencyId);
96  void UpdateBeamsForFrequency(uint32_t satId,
97  uint32_t beamdId,
98  uint32_t fwdFrequencyId,
99  uint32_t rtnFrequencyId);
100 
109  // void StoreChannelPair (uint32_t beamId, uint32_t frequencyId, ChannelPair_t channels);
110  void StoreChannelPair(uint32_t satId,
111  uint32_t beamId,
112  uint32_t fwdFrequencyId,
113  Ptr<SatChannel> fwdChannel,
114  uint32_t rtnFrequencyId,
115  Ptr<SatChannel> rtnChannel);
116 
117  private:
118  std::map<std::pair<uint32_t, uint32_t>, std::pair<uint32_t, uint32_t>>
119  m_frequencies; // map from beam ID to frequency ID
120  std::map<std::pair<uint32_t, uint32_t>, Ptr<SatChannel>> m_fwdChannels;
121  std::map<std::pair<uint32_t, uint32_t>, Ptr<SatChannel>> m_rtnChannels;
122 };
123 
124 } // namespace ns3
125 
126 #endif /* SATELLITE_BEAM_CHANNEL_PAIR_H */
Container of Satellite channels pairs.
virtual ~SatChannelPair()
Destructor for SatChannel.
Ptr< SatChannel > GetForwardChannel(uint32_t satId, uint32_t frequencyId) const
Ptr< SatChannel > GetReturnChannel(uint32_t satId, uint32_t frequencyId) const
bool HasFwdChannel(uint32_t satId, uint32_t frequencyId) const
Test if a channel pair has been stored for a given color.
void UpdateBeamsForFrequency(uint32_t satId, uint32_t beamdId, uint32_t fwdFrequencyId, uint32_t rtnFrequencyId)
Associate a new beam to a given color.
std::map< std::pair< uint32_t, uint32_t >, Ptr< SatChannel > > m_fwdChannels
static TypeId GetTypeId(void)
Get the type ID.
bool HasRtnChannel(uint32_t satId, uint32_t frequencyId) const
std::map< std::pair< uint32_t, uint32_t >, Ptr< SatChannel > > m_rtnChannels
std::pair< Ptr< SatChannel >, Ptr< SatChannel > > ChannelPair_t
ChannelPair_t GetChannelPair(uint32_t satId, uint32_t beamId) const
Retrieve the channel pair associated to a beam.
std::map< std::pair< uint32_t, uint32_t >, std::pair< uint32_t, uint32_t > > m_frequencies
void StoreChannelPair(uint32_t satId, uint32_t beamId, uint32_t fwdFrequencyId, Ptr< SatChannel > fwdChannel, uint32_t rtnFrequencyId, Ptr< SatChannel > rtnChannel)
Store a pair of SatChannel for the given color and associate the given beam to said color.
SatChannelPair()
Default constructor.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.