A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
connection-manager.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 CONNECTION_MANAGER_H
12#define CONNECTION_MANAGER_H
13
14#include "cid.h"
15#include "wimax-connection.h"
16
17#include "ns3/mac48-address.h"
18
19#include <stdint.h>
20
21namespace ns3
22{
23
24class CidFactory;
25class SSRecord;
26class RngRsp;
27class WimaxNetDevice;
28class SubscriberStationNetDevice;
29
30/**
31 * \ingroup wimax
32 * The same connection manager class serves both for BS and SS though some functions are exclusive
33 * to only one of them.
34 */
35
37{
38 public:
39 /**
40 * \brief Get the type ID.
41 * \return the object TypeId
42 */
43 static TypeId GetTypeId();
45 ~ConnectionManager() override;
46 void DoDispose() override;
47 /**
48 * Set CID factory
49 * \param cidFactory the CID factory
50 */
51 void SetCidFactory(CidFactory* cidFactory);
52 /**
53 * \brief allocates the management connection for an ss record. This method is only used by BS
54 * \param ssRecord the ss record to which the management connection will be allocated
55 * \param rngrsp the ranging response message
56 */
57 void AllocateManagementConnections(SSRecord* ssRecord, RngRsp* rngrsp);
58 /**
59 * \brief create a connection of type type
60 * \param type type of the connection to create
61 * \return a smart pointer to the created WimaxConnection
62 */
64 /**
65 * \brief add a connection to the list of managed connections
66 * \param connection the connection to add
67 * \param type the type of connection to add
68 */
69 void AddConnection(Ptr<WimaxConnection> connection, Cid::Type type);
70 /**
71 * \param cid the connection identifier
72 * \return the connection corresponding to cid
73 */
75 /**
76 * \param type the type of connection to add
77 * \return a vector of all connections matching the input type
78 */
79 std::vector<Ptr<WimaxConnection>> GetConnections(Cid::Type type) const;
80 /**
81 * \brief get number of packets
82 * \param type the type of connection to add
83 * \param schedulingType the scheduling type
84 * \returns number of packets
85 */
87 /**
88 * \return true if one of the managed connection has at least one packet to send, false
89 * otherwise
90 */
91 bool HasPackets() const;
92
93 private:
94 std::vector<Ptr<WimaxConnection>> m_basicConnections; ///< basic connections
95 std::vector<Ptr<WimaxConnection>> m_primaryConnections; ///< primary connections
96 std::vector<Ptr<WimaxConnection>> m_transportConnections; ///< transport connections
97 std::vector<Ptr<WimaxConnection>> m_multicastConnections; ///< multicast connections
98 // only for BS
99 CidFactory* m_cidFactory; ///< the factory
100};
101
102} // namespace ns3
103
104#endif /* CONNECTION_MANAGER_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
The same connection manager class serves both for BS and SS though some functions are exclusive to on...
std::vector< Ptr< WimaxConnection > > m_primaryConnections
primary connections
std::vector< Ptr< WimaxConnection > > m_basicConnections
basic connections
void DoDispose() override
Destructor implementation.
void AllocateManagementConnections(SSRecord *ssRecord, RngRsp *rngrsp)
allocates the management connection for an ss record.
std::vector< Ptr< WimaxConnection > > m_transportConnections
transport connections
Ptr< WimaxConnection > GetConnection(Cid cid)
Ptr< WimaxConnection > CreateConnection(Cid::Type type)
create a connection of type type
std::vector< Ptr< WimaxConnection > > GetConnections(Cid::Type type) const
uint32_t GetNPackets(Cid::Type type, ServiceFlow::SchedulingType schedulingType) const
get number of packets
void SetCidFactory(CidFactory *cidFactory)
Set CID factory.
static TypeId GetTypeId()
Get the type ID.
void AddConnection(Ptr< WimaxConnection > connection, Cid::Type type)
add a connection to the list of managed connections
CidFactory * m_cidFactory
the factory
std::vector< Ptr< WimaxConnection > > m_multicastConnections
multicast connections
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
This class implements the ranging response message described by "IEEE Standard forLocal and metropoli...
This class is used by the base station to store some information related to subscriber station in the...
Definition ss-record.h:35
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.