A Discrete-Event Network Simulator
API
mu-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) 2021 Universita' degli Studi di Napoli Federico II
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: Stefano Avallone <stavallo@unina.it>
19  */
20 
21 #ifndef MU_SNR_TAG_H
22 #define MU_SNR_TAG_H
23 
24 #include "ns3/tag.h"
25 #include <map>
26 
27 namespace ns3 {
28 
35 class MuSnrTag : public Tag
36 {
37 public:
42  static TypeId GetTypeId (void);
43  TypeId GetInstanceTypeId (void) const override;
44 
48  MuSnrTag ();
49 
50  uint32_t GetSerializedSize (void) const override;
51  void Serialize (TagBuffer i) const override;
52  void Deserialize (TagBuffer i) override;
53  void Print (std::ostream &os) const override;
54 
58  void Reset (void);
65  void Set (uint16_t staId, double snr);
72  bool IsPresent (uint16_t staId) const;
79  double Get (uint16_t staId) const;
80 
81 
82 private:
83  std::map<uint16_t, double> m_snrMap;
84 };
85 
86 }
87 
88 #endif /* MU_SNR_TAG_H */
A tag to be attached to a response to a multi-user UL frame, that carries the SNR values with which t...
Definition: mu-snr-tag.h:36
std::map< uint16_t, double > m_snrMap
Map containing (STA-ID, SNR) pairs.
Definition: mu-snr-tag.h:83
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: mu-snr-tag.cc:39
void Print(std::ostream &os) const override
Definition: mu-snr-tag.cc:104
uint32_t GetSerializedSize(void) const override
Definition: mu-snr-tag.cc:74
void Reset(void)
Reset the content of the tag.
Definition: mu-snr-tag.cc:49
double Get(uint16_t staId) const
Return the SNR value for the given sender.
Definition: mu-snr-tag.cc:67
static TypeId GetTypeId(void)
Get the type ID.
Definition: mu-snr-tag.cc:28
bool IsPresent(uint16_t staId) const
Return true if the SNR value for the given STA-ID is present.
Definition: mu-snr-tag.cc:61
void Serialize(TagBuffer i) const override
Definition: mu-snr-tag.cc:80
void Set(uint16_t staId, double snr)
Set the SNR for the given sender to the given value.
Definition: mu-snr-tag.cc:55
void Deserialize(TagBuffer i) override
Definition: mu-snr-tag.cc:92
MuSnrTag()
Create an empty MuSnrTag.
Definition: mu-snr-tag.cc:44
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.