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 */
HeaderType
this class implements the mac header type field.
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
Type
Definition: cid.h:38
void FragmentEnqueue(Ptr< const Packet > fragment)
enqueue a received packet (that is a fragment) into the fragments queue
ServiceFlow * m_serviceFlow
enum Cid::Type m_cidType
uint8_t GetSchedulingType(void) const
ServiceFlow * GetServiceFlow(void) const
this class implements the Generic mac Header as described by IEEE Standard for Local and metropolitan...
Ptr< WimaxMacQueue > GetQueue(void) const
WimaxConnection(Cid cid, enum Cid::Type type)
const FragmentsQueue GetFragmentsQueue(void) const
get a queue of received fragments
enum Cid::Type GetType(void) const
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
bool HasPackets(void) const
Represents the HT (Header Type) field of generic MAC and bandwidth request headers.
void ClearFragmentsQueue(void)
delete all enqueued fragments
bool Enqueue(Ptr< Packet > packet, const MacHeaderType &hdrType, const GenericMacHeader &hdr)
enqueue a packet in the queue of the connection
Definition: cid.h:35
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:39
Cid GetCid(void) const
std::list< Ptr< const Packet > > FragmentsQueue
Ptr< Packet > Dequeue(MacHeaderType::HeaderType packetType=MacHeaderType::HEADER_TYPE_GENERIC)
dequeue a packet from the queue of the connection
void SetServiceFlow(ServiceFlow *serviceFlow)
set the service flow associated to this connection
FragmentsQueue m_fragmentsQueue
static TypeId GetTypeId(void)
std::string GetTypeStr(void) const
a base class which provides memory management and object aggregation
Definition: object.h:63
a unique identifier for an interface.
Definition: type-id.h:49
Ptr< WimaxMacQueue > m_queue