A Discrete-Event Network Simulator
API
snr-tag.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  * Copyright (c) 2013 University of Surrey
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation;
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
21  * Mirko Banchi <mk.banchi@gmail.com>
22  * Konstantinos Katsaros <dinos.katsaros@gmail.com>
23  */
24 
25 #ifndef SNR_TAG_H
26 #define SNR_TAG_H
27 
28 #include "ns3/tag.h"
29 
30 namespace ns3 {
31 
32 class Tag;
33 
34 class SnrTag : public Tag
35 {
36 public:
41  static TypeId GetTypeId (void);
42 
46  SnrTag ();
47 
48  TypeId GetInstanceTypeId (void) const override;
49  uint32_t GetSerializedSize (void) const override;
50  void Serialize (TagBuffer i) const override;
51  void Deserialize (TagBuffer i) override;
52  void Print (std::ostream &os) const override;
53 
59  void Set (double snr);
65  double Get (void) const;
66 
67 
68 private:
69  double m_snr;
70 };
71 
72 }
73 
74 #endif /* SNR_TAG_H */
Introspection did not find any typical Config paths.
Definition: snr-tag.h:35
void Set(double snr)
Set the SNR to the given value.
Definition: snr-tag.cc:83
void Serialize(TagBuffer i) const override
Definition: snr-tag.cc:65
uint32_t GetSerializedSize(void) const override
Definition: snr-tag.cc:59
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: snr-tag.cc:48
void Print(std::ostream &os) const override
Definition: snr-tag.cc:77
double m_snr
SNR value in linear scale.
Definition: snr-tag.h:69
static TypeId GetTypeId(void)
Get the type ID.
Definition: snr-tag.cc:33
SnrTag()
Create a SnrTag with the default SNR 0.
Definition: snr-tag.cc:53
void Deserialize(TagBuffer i) override
Definition: snr-tag.cc:71
double Get(void) const
Return the SNR value.
Definition: snr-tag.cc:89
read and write tag data
Definition: tag-buffer.h:52
tag a set of bytes in a packet
Definition: tag.h:37
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.