5G-LENA nr-v3.0-32-g83aee33
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
beam-id.h
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
3// Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4//
5// SPDX-License-Identifier: GPL-2.0-only
6
7#ifndef SRC_NR_MODEL_BEAM_ID_H_
8#define SRC_NR_MODEL_BEAM_ID_H_
9
10#include <complex>
11#include <stdint.h>
12
13namespace ns3
14{
15
27class BeamId
28{
29 public:
33 BeamId();
34
40 BeamId(uint16_t sector, double elevation);
41
48 bool operator==(const BeamId& p) const;
49
54 bool operator!=(const BeamId& p) const;
55
60 uint16_t GetSector() const;
61
66 double GetElevation() const;
67
68 /*
69 * \brief Create BeamId with 0 sector and 0 elevation
70 * \return BeamId (0,0)
71 */
72 static BeamId GetEmptyBeamId();
73
77 uint32_t GetCantor() const;
78
79 private:
80 uint16_t m_sector{0};
81 double m_elevation{0};
82};
83
84// we reserve pair 65535, 65535 to identify the OMNI beam
89extern const BeamId OMNI_BEAM_ID;
90
91// we reserve pair 65534, 65534 to identify the directional predefined beam
97extern const BeamId PREDEFINED_BEAM_ID;
98
104{
110 size_t operator()(const BeamId& x) const;
111};
112
113std::ostream& operator<<(std::ostream& os, const BeamId& item);
114
115} /* namespace ns3 */
116
117#endif /* SRC_NR_MODEL_ID_MANAGER_H_ */
Representation of a beam id.
Definition beam-id.h:28
uint16_t GetSector() const
Extract the sector from the beam id.
Definition beam-id.cc:45
uint32_t GetCantor() const
Definition beam-id.cc:75
double GetElevation() const
Extract the elevation from the beam id.
Definition beam-id.cc:51
BeamId()
Default constructor which created beamId with 0 sector and 0 elevation.
Definition beam-id.cc:22
bool operator!=(const BeamId &p) const
Overrides != operator for the general use case.
Definition beam-id.cc:39
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:33
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:12
const BeamId OMNI_BEAM_ID
Name of the OMNI beam.
Definition beam-id.cc:11
Calculate the hash of a BeamId.
Definition beam-id.h:104
size_t operator()(const BeamId &x) const
operator ()
Definition beam-id.cc:81