A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
cid.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008,2009 INRIA, UDcast
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
7 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
8 * <amine.ismail@UDcast.com>
9 */
10
11#ifndef CID_H
12#define CID_H
13
14#include <ostream>
15#include <stdint.h>
16
17namespace ns3
18{
19
20/**
21 * \ingroup wimax
22 * \class Cid
23 * \brief Cid class
24 */
25class Cid
26{
27 public:
28 /// Type enumeration
39
40 /// Create a cid of unknown type
41 Cid();
42 /**
43 * Constructor
44 *
45 * \param cid
46 */
47 Cid(uint16_t cid);
48 ~Cid();
49 /**
50 * \return the identifier of the cid
51 */
52 uint16_t GetIdentifier() const;
53 /**
54 * \return true if the cid is a multicast cid, false otherwise
55 */
56 bool IsMulticast() const;
57 /**
58 * \return true if the cid is a broadcast cid, false otherwise
59 */
60 bool IsBroadcast() const;
61 /**
62 * \return true if the cid is a padding cid, false otherwise
63 */
64 bool IsPadding() const;
65 /**
66 * \return true if the cid is an initial ranging cid, false otherwise
67 */
68 bool IsInitialRanging() const;
69 /**
70 * \return the broadcast cid
71 */
72 static Cid Broadcast();
73 /**
74 * \return the padding cid
75 */
76 static Cid Padding();
77 /**
78 * \return the initial ranging cid
79 */
80 static Cid InitialRanging();
81
82 private:
83 /// allow CidFactory class friend access
84 friend class CidFactory;
85 /// equality operator
86 friend bool operator==(const Cid& lhs, const Cid& rhs);
87 uint16_t m_identifier; ///< identiifier
88};
89
90bool operator==(const Cid& lhs, const Cid& rhs);
91bool operator!=(const Cid& lhs, const Cid& rhs);
92
93std::ostream& operator<<(std::ostream& os, const Cid& cid);
94
95} // namespace ns3
96
97#endif /* CID_H */
This class is used exclusively by the BS to allocate CIDs to new connections.
Definition cid-factory.h:35
Cid class.
Definition cid.h:26
Type
Type enumeration.
Definition cid.h:30
@ PRIMARY
Definition cid.h:34
@ BROADCAST
Definition cid.h:31
@ TRANSPORT
Definition cid.h:35
@ MULTICAST
Definition cid.h:36
@ BASIC
Definition cid.h:33
@ PADDING
Definition cid.h:37
@ INITIAL_RANGING
Definition cid.h:32
uint16_t GetIdentifier() const
Definition cid.cc:34
bool IsInitialRanging() const
Definition cid.cc:58
~Cid()
Definition cid.cc:29
Cid()
Create a cid of unknown type.
Definition cid.cc:19
static Cid InitialRanging()
Definition cid.cc:76
bool IsPadding() const
Definition cid.cc:52
static Cid Padding()
Definition cid.cc:70
friend bool operator==(const Cid &lhs, const Cid &rhs)
equality operator
Definition cid.cc:88
bool IsMulticast() const
Definition cid.cc:40
bool IsBroadcast() const
Definition cid.cc:46
static Cid Broadcast()
Definition cid.cc:64
uint16_t m_identifier
identiifier
Definition cid.h:87
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
Definition callback.h:658
bool operator==(const EventId &a, const EventId &b)
Definition event-id.h:155
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148