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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19 * <amine.ismail@UDcast.com>
20 */
21
22#ifndef CID_H
23#define CID_H
24
25#include <ostream>
26#include <stdint.h>
27
28namespace ns3
29{
30
31/**
32 * \ingroup wimax
33 * \class Cid
34 * \brief Cid class
35 */
36class Cid
37{
38 public:
39 /// Type enumeration
40 enum Type
41 {
49 };
50
51 /// Create a cid of unknown type
52 Cid();
53 /**
54 * Constructor
55 *
56 * \param cid
57 */
58 Cid(uint16_t cid);
59 ~Cid();
60 /**
61 * \return the identifier of the cid
62 */
63 uint16_t GetIdentifier() const;
64 /**
65 * \return true if the cid is a multicast cid, false otherwise
66 */
67 bool IsMulticast() const;
68 /**
69 * \return true if the cid is a broadcast cid, false otherwise
70 */
71 bool IsBroadcast() const;
72 /**
73 * \return true if the cid is a padding cid, false otherwise
74 */
75 bool IsPadding() const;
76 /**
77 * \return true if the cid is an initial ranging cid, false otherwise
78 */
79 bool IsInitialRanging() const;
80 /**
81 * \return the broadcast cid
82 */
83 static Cid Broadcast();
84 /**
85 * \return the padding cid
86 */
87 static Cid Padding();
88 /**
89 * \return the initial ranging cid
90 */
91 static Cid InitialRanging();
92
93 private:
94 /// allow CidFactory class friend access
95 friend class CidFactory;
96 /// equality operator
97 friend bool operator==(const Cid& lhs, const Cid& rhs);
98 uint16_t m_identifier; ///< identiifier
99};
100
101bool operator==(const Cid& lhs, const Cid& rhs);
102bool operator!=(const Cid& lhs, const Cid& rhs);
103
104std::ostream& operator<<(std::ostream& os, const Cid& cid);
105
106} // namespace ns3
107
108#endif /* CID_H */
This class is used exclusively by the BS to allocate CIDs to new connections.
Definition: cid-factory.h:46
Cid class.
Definition: cid.h:37
Type
Type enumeration.
Definition: cid.h:41
@ PRIMARY
Definition: cid.h:45
@ BROADCAST
Definition: cid.h:42
@ TRANSPORT
Definition: cid.h:46
@ MULTICAST
Definition: cid.h:47
@ BASIC
Definition: cid.h:44
@ PADDING
Definition: cid.h:48
@ INITIAL_RANGING
Definition: cid.h:43
uint16_t GetIdentifier() const
Definition: cid.cc:45
bool IsInitialRanging() const
Definition: cid.cc:69
~Cid()
Definition: cid.cc:40
Cid()
Create a cid of unknown type.
Definition: cid.cc:30
static Cid InitialRanging()
Definition: cid.cc:87
bool IsPadding() const
Definition: cid.cc:63
static Cid Padding()
Definition: cid.cc:81
friend bool operator==(const Cid &lhs, const Cid &rhs)
equality operator
Definition: cid.cc:99
bool IsMulticast() const
Definition: cid.cc:51
bool IsBroadcast() const
Definition: cid.cc:57
static Cid Broadcast()
Definition: cid.cc:75
uint16_t m_identifier
identiifier
Definition: cid.h:98
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:678
bool operator==(const EventId &a, const EventId &b)
Definition: event-id.h:157
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:159