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