A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
lte-rlc-sdu-status-tag.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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  * Author: Manuel Requena <manuel.requena@cttc.es>
18  */
19 
20 #include "lte-rlc-sdu-status-tag.h"
21 
22 namespace ns3
23 {
24 
25 NS_OBJECT_ENSURE_REGISTERED(LteRlcSduStatusTag);
26 
28 {
29 }
30 
31 void
33 {
34  m_sduStatus = status;
35 }
36 
37 uint8_t
39 {
40  return m_sduStatus;
41 }
42 
43 TypeId
45 {
46  static TypeId tid = TypeId("ns3::LteRlcSduStatusTag")
47  .SetParent<Tag>()
48  .SetGroupName("Lte")
49  .AddConstructor<LteRlcSduStatusTag>();
50  return tid;
51 }
52 
53 TypeId
55 {
56  return GetTypeId();
57 }
58 
59 uint32_t
61 {
62  return 1;
63 }
64 
65 void
67 {
69 }
70 
71 void
73 {
74  m_sduStatus = i.ReadU8();
75 }
76 
77 void
78 LteRlcSduStatusTag::Print(std::ostream& os) const
79 {
80  os << "SDU Status=" << (uint32_t)m_sduStatus;
81 }
82 
83 }; // namespace ns3
This class implements a tag that carries the status of a RLC SDU for the fragmentation process Status...
static TypeId GetTypeId()
Get the type ID.
void Serialize(TagBuffer i) const override
uint8_t GetStatus() const
Get status function.
uint8_t m_sduStatus
SDU status.
uint32_t GetSerializedSize() const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Deserialize(TagBuffer i) override
void Print(std::ostream &os) const override
void SetStatus(uint8_t status)
Set status function.
read and write tag data
Definition: tag-buffer.h:52
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Definition: tag-buffer.h:172
TAG_BUFFER_INLINE uint8_t ReadU8()
Definition: tag-buffer.h:196
tag a set of bytes in a packet
Definition: tag.h:39
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:931
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Every class exported by the ns3 library is enclosed in the ns3 namespace.