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 
33 namespace ns3
34 {
35 
42 {
43  public:
45  {
46  }
47 
54  bool operator()(Ptr<SatTimeSlotConf> p1, Ptr<SatTimeSlotConf> p2)
55  {
56  return p1->GetStartTime() < p2->GetStartTime();
57  }
58 };
59 
67 class SatTbtpContainer : public Object
68 {
69  public:
74 
79  SatTbtpContainer(Ptr<SatSuperframeSeq> seq);
80 
85 
90  static TypeId GetTypeId(void);
91 
95  virtual void DoDispose();
96 
101  void SetMacAddress(Mac48Address address);
102 
108  void Add(Time startTime, Ptr<SatTbtpMessage> tbtp);
109 
110  void Clear();
111 
118  bool HasScheduledTimeSlots();
119 
120  private:
124  void RemovePastTbtps();
125 
126  typedef std::multimap<Time, Ptr<SatTbtpMessage>> TbtpMap_t;
128 
132  Mac48Address m_address;
133 
137  Ptr<SatSuperframeSeq> m_superframeSeq;
138 
143 
147  uint32_t m_rcvdTbtps;
148 
153 };
154 
155 } // namespace ns3
156 
157 #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.