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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stavallo@unina.it>
7 */
8
9#ifndef MU_SNR_TAG_H
10#define MU_SNR_TAG_H
11
12#include "ns3/tag.h"
13
14#include <map>
15
16namespace ns3
17{
18
19/**
20 * \ingroup wifi
21 *
22 * A tag to be attached to a response to a multi-user UL frame, that carries the SNR
23 * values with which the individual frames have been received.
24 */
25class MuSnrTag : public Tag
26{
27 public:
28 /**
29 * \brief Get the type ID.
30 * \return the object TypeId
31 */
32 static TypeId GetTypeId();
33 TypeId GetInstanceTypeId() const override;
34
35 /**
36 * Create an empty MuSnrTag
37 */
38 MuSnrTag();
39
40 uint32_t GetSerializedSize() const override;
41 void Serialize(TagBuffer i) const override;
42 void Deserialize(TagBuffer i) override;
43 void Print(std::ostream& os) const override;
44
45 /**
46 * Reset the content of the tag.
47 */
48 void Reset();
49 /**
50 * Set the SNR for the given sender to the given value.
51 *
52 * \param staId the STA-ID of the given sender
53 * \param snr the value of the SNR to set in linear scale
54 */
55 void Set(uint16_t staId, double snr);
56 /**
57 * Return true if the SNR value for the given STA-ID is present
58 *
59 * \param staId the STA-ID
60 * \return true if the SNR value for the given STA-ID is present
61 */
62 bool IsPresent(uint16_t staId) const;
63 /**
64 * Return the SNR value for the given sender.
65 *
66 * \param staId the STA-ID of the given sender
67 * \return the SNR value in linear scale
68 */
69 double Get(uint16_t staId) const;
70
71 private:
72 std::map<uint16_t, double> m_snrMap; //!< Map containing (STA-ID, SNR) pairs
73};
74
75} // namespace ns3
76
77#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:26
std::map< uint16_t, double > m_snrMap
Map containing (STA-ID, SNR) pairs.
Definition mu-snr-tag.h:72
void Print(std::ostream &os) const override
Definition mu-snr-tag.cc:90
void Reset()
Reset the content of the tag.
Definition mu-snr-tag.cc:35
static TypeId GetTypeId()
Get the type ID.
Definition mu-snr-tag.cc:17
double Get(uint16_t staId) const
Return the SNR value for the given sender.
Definition mu-snr-tag.cc:53
bool IsPresent(uint16_t staId) const
Return true if the SNR value for the given STA-ID is present.
Definition mu-snr-tag.cc:47
void Serialize(TagBuffer i) const override
Definition mu-snr-tag.cc:66
void Set(uint16_t staId, double snr)
Set the SNR for the given sender to the given value.
Definition mu-snr-tag.cc:41
uint32_t GetSerializedSize() const override
Definition mu-snr-tag.cc:60
void Deserialize(TagBuffer i) override
Definition mu-snr-tag.cc:78
MuSnrTag()
Create an empty MuSnrTag.
Definition mu-snr-tag.cc:30
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition mu-snr-tag.cc:25
read and write tag data
Definition tag-buffer.h:41
tag a set of bytes in a packet
Definition tag.h:28
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.