A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
mu-snr-tag.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Universita' degli Studi di Napoli Federico II
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Stefano Avallone <stavallo@unina.it>
18 */
19
20#ifndef MU_SNR_TAG_H
21#define MU_SNR_TAG_H
22
23#include "ns3/tag.h"
24
25#include <map>
26
27namespace ns3
28{
29
30/**
31 * \ingroup wifi
32 *
33 * A tag to be attached to a response to a multi-user UL frame, that carries the SNR
34 * values with which the individual frames have been received.
35 */
36class MuSnrTag : public Tag
37{
38 public:
39 /**
40 * \brief Get the type ID.
41 * \return the object TypeId
42 */
43 static TypeId GetTypeId();
44 TypeId GetInstanceTypeId() const override;
45
46 /**
47 * Create an empty MuSnrTag
48 */
49 MuSnrTag();
50
51 uint32_t GetSerializedSize() const override;
52 void Serialize(TagBuffer i) const override;
53 void Deserialize(TagBuffer i) override;
54 void Print(std::ostream& os) const override;
55
56 /**
57 * Reset the content of the tag.
58 */
59 void Reset();
60 /**
61 * Set the SNR for the given sender to the given value.
62 *
63 * \param staId the STA-ID of the given sender
64 * \param snr the value of the SNR to set in linear scale
65 */
66 void Set(uint16_t staId, double snr);
67 /**
68 * Return true if the SNR value for the given STA-ID is present
69 *
70 * \param staId the STA-ID
71 * \return true if the SNR value for the given STA-ID is present
72 */
73 bool IsPresent(uint16_t staId) const;
74 /**
75 * Return the SNR value for the given sender.
76 *
77 * \param staId the STA-ID of the given sender
78 * \return the SNR value in linear scale
79 */
80 double Get(uint16_t staId) const;
81
82 private:
83 std::map<uint16_t, double> m_snrMap; //!< Map containing (STA-ID, SNR) pairs
84};
85
86} // namespace ns3
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:37
std::map< uint16_t, double > m_snrMap
Map containing (STA-ID, SNR) pairs.
Definition: mu-snr-tag.h:83
void Print(std::ostream &os) const override
Definition: mu-snr-tag.cc:101
void Reset()
Reset the content of the tag.
Definition: mu-snr-tag.cc:46
static TypeId GetTypeId()
Get the type ID.
Definition: mu-snr-tag.cc:28
double Get(uint16_t staId) const
Return the SNR value for the given sender.
Definition: mu-snr-tag.cc:64
bool IsPresent(uint16_t staId) const
Return true if the SNR value for the given STA-ID is present.
Definition: mu-snr-tag.cc:58
void Serialize(TagBuffer i) const override
Definition: mu-snr-tag.cc:77
void Set(uint16_t staId, double snr)
Set the SNR for the given sender to the given value.
Definition: mu-snr-tag.cc:52
uint32_t GetSerializedSize() const override
Definition: mu-snr-tag.cc:71
void Deserialize(TagBuffer i) override
Definition: mu-snr-tag.cc:89
MuSnrTag()
Create an empty MuSnrTag.
Definition: mu-snr-tag.cc:41
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: mu-snr-tag.cc:36
read and write tag data
Definition: tag-buffer.h:52
tag a set of bytes in a packet
Definition: tag.h:39
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.