Loading...
Searching...
No Matches
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#include <stdint.h>
31#include <utility>
32
33namespace ns3
34{
35
48
49class SatChannelPair : public Object
50{
51 public:
52 typedef std::pair<Ptr<SatChannel>, Ptr<SatChannel>>
53 ChannelPair_t; // forward = first, return = second
54
59
63 virtual ~SatChannelPair();
64
69 static TypeId GetTypeId(void);
70
77 ChannelPair_t GetChannelPair(uint32_t satId, uint32_t beamId) const;
78 Ptr<SatChannel> GetForwardChannel(uint32_t satId, uint32_t frequencyId) const;
79 Ptr<SatChannel> GetReturnChannel(uint32_t satId, uint32_t frequencyId) const;
80
87 // bool HasChannelPair (uint32_t frequencyId);
88 bool HasFwdChannel(uint32_t satId, uint32_t frequencyId) const;
89 bool HasRtnChannel(uint32_t satId, uint32_t frequencyId) const;
90
97 // void UpdateBeamsForFrequency (uint32_t beamdId, uint32_t frequencyId);
98 void UpdateBeamsForFrequency(uint32_t satId,
99 uint32_t beamdId,
100 uint32_t fwdFrequencyId,
101 uint32_t rtnFrequencyId);
102
111 // void StoreChannelPair (uint32_t beamId, uint32_t frequencyId, ChannelPair_t channels);
112 void StoreChannelPair(uint32_t satId,
113 uint32_t beamId,
114 uint32_t fwdFrequencyId,
115 Ptr<SatChannel> fwdChannel,
116 uint32_t rtnFrequencyId,
117 Ptr<SatChannel> rtnChannel);
118
119 private:
120 std::map<std::pair<uint32_t, uint32_t>, std::pair<uint32_t, uint32_t>>
121 m_frequencies; // map from beam ID to frequency ID
122 std::map<std::pair<uint32_t, uint32_t>, Ptr<SatChannel>> m_fwdChannels;
123 std::map<std::pair<uint32_t, uint32_t>, Ptr<SatChannel>> m_rtnChannels;
124};
125
126} // namespace ns3
127
128#endif /* SATELLITE_BEAM_CHANNEL_PAIR_H */
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.