Loading...
Searching...
No Matches
satellite-time-tag.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_TIME_TAG_H
22#define SATELLITE_TIME_TAG_H
23
24#include "ns3/nstime.h"
25#include "ns3/tag.h"
26
27#include <ostream>
28#include <stdint.h>
29
30namespace ns3
31{
32
33/*
34 * There are 4 classes defined here: SatTimeTag, SatPhyTimeTag, SatMacTimeTag,
35 * and SatDevTimeTag. Except of the name difference, they share
36 * exactly the same definitions.
37 */
38
44class SatTimeTag : public Tag
45{
46 public:
51 static TypeId GetTypeId(void);
52
57 virtual TypeId GetInstanceTypeId(void) const;
58
62 SatTimeTag();
63
68 SatTimeTag(Time senderTimestamp);
69
74 virtual void Serialize(TagBuffer i) const;
75
80 virtual void Deserialize(TagBuffer i);
81
86 virtual uint32_t GetSerializedSize() const;
87
92 virtual void Print(std::ostream& os) const;
93
98 Time GetSenderTimestamp(void) const;
99
104 void SetSenderTimestamp(Time senderTimestamp);
105
106 private:
108};
109
115class SatPhyTimeTag : public Tag
116{
117 public:
122 static TypeId GetTypeId(void);
123
128 virtual TypeId GetInstanceTypeId(void) const;
129
134
139 SatPhyTimeTag(Time senderTimestamp);
140
145 virtual void Serialize(TagBuffer i) const;
146
151 virtual void Deserialize(TagBuffer i);
152
157 virtual uint32_t GetSerializedSize() const;
158
163 virtual void Print(std::ostream& os) const;
164
169 Time GetSenderTimestamp(void) const;
170
175 void SetSenderTimestamp(Time senderTimestamp);
176
177 private:
179};
180
186class SatPhyLinkTimeTag : public Tag
187{
188 public:
193 static TypeId GetTypeId(void);
194
199 virtual TypeId GetInstanceTypeId(void) const;
200
205
210 SatPhyLinkTimeTag(Time senderTimestamp);
211
216 virtual void Serialize(TagBuffer i) const;
217
222 virtual void Deserialize(TagBuffer i);
223
228 virtual uint32_t GetSerializedSize() const;
229
234 virtual void Print(std::ostream& os) const;
235
240 Time GetSenderLinkTimestamp(void) const;
241
246 void SetSenderLinkTimestamp(Time senderLinkTimestamp);
247
248 private:
250};
251
257class SatMacTimeTag : public Tag
258{
259 public:
264 static TypeId GetTypeId(void);
265
270 virtual TypeId GetInstanceTypeId(void) const;
271
276
281 SatMacTimeTag(Time senderTimestamp);
282
287 virtual void Serialize(TagBuffer i) const;
288
293 virtual void Deserialize(TagBuffer i);
294
299 virtual uint32_t GetSerializedSize() const;
300
305 virtual void Print(std::ostream& os) const;
306
311 Time GetSenderTimestamp(void) const;
312
317 void SetSenderTimestamp(Time senderTimestamp);
318
319 private:
321};
322
328class SatMacLinkTimeTag : public Tag
329{
330 public:
335 static TypeId GetTypeId(void);
336
341 virtual TypeId GetInstanceTypeId(void) const;
342
347
352 SatMacLinkTimeTag(Time senderTimestamp);
353
358 virtual void Serialize(TagBuffer i) const;
359
364 virtual void Deserialize(TagBuffer i);
365
370 virtual uint32_t GetSerializedSize() const;
371
376 virtual void Print(std::ostream& os) const;
377
382 Time GetSenderLinkTimestamp(void) const;
383
388 void SetSenderLinkTimestamp(Time senderLinkTimestamp);
389
390 private:
392};
393
399class SatDevTimeTag : public Tag
400{
401 public:
406 static TypeId GetTypeId(void);
407
412 virtual TypeId GetInstanceTypeId(void) const;
413
418
423 SatDevTimeTag(Time senderTimestamp);
424
429 virtual void Serialize(TagBuffer i) const;
430
435 virtual void Deserialize(TagBuffer i);
436
441 virtual uint32_t GetSerializedSize() const;
442
447 virtual void Print(std::ostream& os) const;
448
453 Time GetSenderTimestamp(void) const;
454
459 void SetSenderTimestamp(Time senderTimestamp);
460
461 private:
463};
464
470class SatDevLinkTimeTag : public Tag
471{
472 public:
477 static TypeId GetTypeId(void);
478
483 virtual TypeId GetInstanceTypeId(void) const;
484
489
494 SatDevLinkTimeTag(Time senderTimestamp);
495
500 virtual void Serialize(TagBuffer i) const;
501
506 virtual void Deserialize(TagBuffer i);
507
512 virtual uint32_t GetSerializedSize() const;
513
518 virtual void Print(std::ostream& os) const;
519
524 Time GetSenderTimestamp(void) const;
525
530 void SetSenderTimestamp(Time senderTimestamp);
531
532 private:
534};
535
536} // namespace ns3
537
538#endif /* SATELLITE_TIME_TAG_H */
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatDevTimeTag.
SatDevTimeTag()
Default constructor.
static TypeId GetTypeId(void)
Get the type ID.
virtual uint32_t GetSerializedSize() const
Get serialized size of SatDevTimeTag.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
void SetSenderTimestamp(Time senderTimestamp)
Set sender time stamp of this tag.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatDevTimeTag.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatDevTimeTag.
Time GetSenderTimestamp(void) const
Get sender time stamp of this tag.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatMacTimeTag.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatMacTimeTag.
SatMacTimeTag()
Default constructor.
static TypeId GetTypeId(void)
Get the type ID.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
virtual uint32_t GetSerializedSize() const
Get serialized size of SatMacTimeTag.
void SetSenderTimestamp(Time senderTimestamp)
Set sender time stamp of this tag.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatMacTimeTag.
Time GetSenderTimestamp(void) const
Get sender time stamp of this tag.
void SetSenderTimestamp(Time senderTimestamp)
Set sender time stamp of this tag.
Time GetSenderTimestamp(void) const
Get sender time stamp of this tag.
SatPhyTimeTag()
Default constructor.
virtual uint32_t GetSerializedSize() const
Get serialized size of SatPhyTimeTag.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatPhyTimeTag.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatPhyTimeTag.
static TypeId GetTypeId(void)
Get the type ID.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatPhyTimeTag.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
virtual uint32_t GetSerializedSize() const
Get serialized size of SatTimeTag.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatTimeTag.
Time GetSenderTimestamp(void) const
Get sender time stamp of this tag.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatTimeTag.
static TypeId GetTypeId(void)
Get the type ID.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatTimeTag.
void SetSenderTimestamp(Time senderTimestamp)
Set sender time stamp of this tag.
SatTimeTag()
Default constructor.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.