A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
wimax-connection.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008, 2009 INRIA, UDcast
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19  * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
20  */
21 
22 #ifndef WIMAX_CONNECTION_H
23 #define WIMAX_CONNECTION_H
24 
25 #include <stdint.h>
26 #include <ostream>
27 #include "cid.h"
28 #include "wimax-mac-header.h"
29 #include "wimax-mac-queue.h"
30 #include "ns3/object.h"
31 #include "service-flow.h"
32 
33 namespace ns3 {
34 
35 class ServiceFlow;
36 class Cid;
37 
41 class WimaxConnection : public Object
42 {
43 public:
44  static TypeId GetTypeId (void);
45 
46  WimaxConnection (Cid cid, enum Cid::Type type);
47  ~WimaxConnection (void);
48 
49  Cid GetCid (void) const;
50 
51  enum Cid::Type GetType (void) const;
55  Ptr<WimaxMacQueue> GetQueue (void) const;
60  void SetServiceFlow (ServiceFlow *serviceFlow);
64  ServiceFlow* GetServiceFlow (void) const;
65 
66  // wrapper functions
70  uint8_t GetSchedulingType (void) const;
77  bool Enqueue (Ptr<Packet> packet, const MacHeaderType &hdrType, const GenericMacHeader &hdr);
83  Ptr<Packet> Dequeue (MacHeaderType::HeaderType packetType, uint32_t availableByte);
87  bool HasPackets (void) const;
92  bool HasPackets (MacHeaderType::HeaderType packetType) const;
93 
94  std::string GetTypeStr (void) const;
95 
96  // Definition of Fragments Queue data type
97  typedef std::list<Ptr<const Packet> > FragmentsQueue;
101  const FragmentsQueue GetFragmentsQueue (void) const;
106  void FragmentEnqueue (Ptr<const Packet> fragment);
110  void ClearFragmentsQueue (void);
111 
112 private:
113  virtual void DoDispose (void);
114 
119 
120  // FragmentsQueue stores all received fragments
122 };
123 
124 } // namespace ns3
125 
126 #endif /* WIMAX_CONNECTION_H */