src/lte/model/rlc-entity.cc
changeset 8749 4462ac63d4cf
parent 8748 87a141a38088
parent 8747 2aec19a85c73
child 8750 b3db7d51f260
child 8765 b89660102b63
equal deleted inserted replaced
8748:87a141a38088 8749:4462ac63d4cf
     1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
       
     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: Giuseppe Piro  <g.piro@poliba.it>
       
    19  */
       
    20 
       
    21 
       
    22 #include "rlc-entity.h"
       
    23 #include <ns3/log.h>
       
    24 #include <ns3/pointer.h>
       
    25 #include <ns3/packet.h>
       
    26 #include "ue-net-device.h"
       
    27 #include "enb-net-device.h"
       
    28 #include "rrc-entity.h"
       
    29 #include "radio-bearer-instance.h"
       
    30 
       
    31 NS_LOG_COMPONENT_DEFINE ("RlcEntity");
       
    32 
       
    33 namespace ns3 {
       
    34 
       
    35 
       
    36 NS_OBJECT_ENSURE_REGISTERED (RlcEntity);
       
    37 
       
    38 TypeId RlcEntity::GetTypeId (void)
       
    39 {
       
    40   static TypeId tid = TypeId ("ns3::RlcEntity")
       
    41     .SetParent<Object> ();
       
    42   return tid;
       
    43 }
       
    44 
       
    45 
       
    46 
       
    47 RlcEntity::RlcEntity ()
       
    48   : m_device (0)
       
    49 {
       
    50   NS_LOG_FUNCTION (this);
       
    51 }
       
    52 
       
    53 
       
    54 RlcEntity::RlcEntity (Ptr<LteNetDevice> d)
       
    55   : m_device (d)
       
    56 {
       
    57   NS_LOG_FUNCTION (this << d);
       
    58 }
       
    59 
       
    60 
       
    61 RlcEntity::~RlcEntity ()
       
    62 {
       
    63   NS_LOG_FUNCTION (this);
       
    64 }
       
    65 
       
    66 void
       
    67 RlcEntity::DoDispose ()
       
    68 {
       
    69   NS_LOG_FUNCTION (this);
       
    70   m_device = 0;
       
    71   m_bearer = 0;
       
    72 }
       
    73 
       
    74 void
       
    75 RlcEntity::SetDevice (Ptr<LteNetDevice> d)
       
    76 {
       
    77   NS_LOG_FUNCTION (this << d);
       
    78   m_device = d;
       
    79 }
       
    80 
       
    81 
       
    82 Ptr<LteNetDevice>
       
    83 RlcEntity::GetDevice (void)
       
    84 {
       
    85   NS_LOG_FUNCTION (this);
       
    86   return m_device;
       
    87 }
       
    88 
       
    89 
       
    90 Ptr<Packet>
       
    91 RlcEntity::Dequeue ()
       
    92 {
       
    93   NS_LOG_FUNCTION (this);
       
    94 
       
    95   Ptr<Packet> p = GetRadioBearer ()->Dequeue ();
       
    96   return p;
       
    97 }
       
    98 
       
    99 
       
   100 void 
       
   101 RlcEntity::SetRadioBearer (Ptr<RadioBearerInstance> b)
       
   102 {
       
   103   NS_LOG_FUNCTION (this << b);
       
   104   m_bearer = b;
       
   105 }
       
   106 
       
   107 Ptr<RadioBearerInstance> 
       
   108 RlcEntity::GetRadioBearer (void)
       
   109 {
       
   110   NS_LOG_FUNCTION (this);
       
   111   return m_bearer;
       
   112 }
       
   113 
       
   114 
       
   115 
       
   116 } // namespace ns3