5G-LENA nr-v3.1-69-g2dd513a7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
beam-id.h
1// Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef SRC_NR_MODEL_BEAM_ID_H_
6#define SRC_NR_MODEL_BEAM_ID_H_
7
8#include <complex>
9#include <stdint.h>
10
11namespace ns3
12{
13
25class BeamId
26{
27 public:
31 BeamId();
32
38 BeamId(uint16_t sector, double elevation);
39
46 bool operator==(const BeamId& p) const;
47
52 bool operator!=(const BeamId& p) const;
53
58 uint16_t GetSector() const;
59
64 double GetElevation() const;
65
66 /*
67 * \brief Create BeamId with 0 sector and 0 elevation
68 * \return BeamId (0,0)
69 */
70 static BeamId GetEmptyBeamId();
71
75 uint32_t GetCantor() const;
76
77 private:
78 uint16_t m_sector{0};
79 double m_elevation{0};
80};
81
82// we reserve pair 65535, 65535 to identify the OMNI beam
87extern const BeamId OMNI_BEAM_ID;
88
89// we reserve pair 65534, 65534 to identify the directional predefined beam
95extern const BeamId PREDEFINED_BEAM_ID;
96
102{
108 size_t operator()(const BeamId& x) const;
109};
110
111std::ostream& operator<<(std::ostream& os, const BeamId& item);
112
113} /* namespace ns3 */
114
115#endif /* SRC_NR_MODEL_ID_MANAGER_H_ */
Representation of a beam id.
Definition beam-id.h:26
uint16_t GetSector() const
Extract the sector from the beam id.
Definition beam-id.cc:43
uint32_t GetCantor() const
Definition beam-id.cc:75
double GetElevation() const
Extract the elevation from the beam id.
Definition beam-id.cc:49
BeamId()
Default constructor which created beamId with 0 sector and 0 elevation.
Definition beam-id.cc:20
bool operator!=(const BeamId &p) const
Overrides != operator for the general use case.
Definition beam-id.cc:37
bool operator==(const BeamId &p) const
Objects of this class are used as key in hash table. This class must implement operator ==() to handl...
Definition beam-id.cc:31
const BeamId PREDEFINED_BEAM_ID
Reserved ID for the predefined directional beam if it cannot be expressed through sector and elevatio...
Definition beam-id.cc:10
const BeamId OMNI_BEAM_ID
Name of the OMNI beam.
Definition beam-id.cc:9
Calculate the hash of a BeamId.
Definition beam-id.h:102
size_t operator()(const BeamId &x) const
operator ()
Definition beam-id.cc:81