satellite-tbtp-container.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions Ltd.
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: Jani Puttonen <jani.puttonen@magister.fi>
19  */
20 
21 #ifndef SATELLITE_TBTP_CONTAINER_H_
22 #define SATELLITE_TBTP_CONTAINER_H_
23 
25 #include "satellite-frame-conf.h"
27 
28 #include <ns3/mac48-address.h>
29 #include <ns3/object.h>
30 
31 #include <map>
32 #include <stdint.h>
33 
34 namespace ns3
35 {
36 
43 {
44  public:
46  {
47  }
48 
55  bool operator()(Ptr<SatTimeSlotConf> p1, Ptr<SatTimeSlotConf> p2)
56  {
57  return p1->GetStartTime() < p2->GetStartTime();
58  }
59 };
60 
68 class SatTbtpContainer : public Object
69 {
70  public:
75 
80  SatTbtpContainer(Ptr<SatSuperframeSeq> seq);
81 
86 
91  static TypeId GetTypeId(void);
92 
96  virtual void DoDispose();
97 
102  void SetMacAddress(Mac48Address address);
103 
109  void Add(Time startTime, Ptr<SatTbtpMessage> tbtp);
110 
111  void Clear();
112 
119  bool HasScheduledTimeSlots();
120 
121  private:
125  void RemovePastTbtps();
126 
127  typedef std::multimap<Time, Ptr<SatTbtpMessage>> TbtpMap_t;
129 
133  Mac48Address m_address;
134 
138  Ptr<SatSuperframeSeq> m_superframeSeq;
139 
144 
148  uint32_t m_rcvdTbtps;
149 
154 };
155 
156 } // namespace ns3
157 
158 #endif /* SATELLITE_TBTP_CONTAINER_H_ */
A container of received TBTPs.
Ptr< SatSuperframeSeq > m_superframeSeq
Superframe sequence.
Mac48Address m_address
Address of this UT.
static TypeId GetTypeId(void)
Get the type ID.
uint32_t m_rcvdTbtps
Number of received TBTPs.
virtual void DoDispose()
Dispose of this class instance.
bool HasScheduledTimeSlots()
Method of checking whether the UT has been scheduled time slots into the future.
uint32_t m_maxStoredTbtps
Maximum stored TBTPs in the container.
void Add(Time startTime, Ptr< SatTbtpMessage > tbtp)
Add a TBTP message to the container.
std::multimap< Time, Ptr< SatTbtpMessage > > TbtpMap_t
~SatTbtpContainer()
Destructor for SatTbtpContainer.
void RemovePastTbtps()
Function for removing the TBTPs which are in the past.
void SetMacAddress(Mac48Address address)
Set the MAC address of this node.
Time m_superFrameDuration
Superframe duration.
SatTbtpContainer()
Default constructor.
This class sorts time slots within TBTP into increasing order based on start time.
bool operator()(Ptr< SatTimeSlotConf > p1, Ptr< SatTimeSlotConf > p2)
Operator overload for sorting function.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.